]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
iommu_pt: support small VA for AMDv1
authorAnkit Soni <Ankit.Soni@amd.com>
Mon, 13 Apr 2026 14:45:19 +0000 (14:45 +0000)
committerJoerg Roedel <joerg.roedel@amd.com>
Tue, 19 May 2026 08:49:03 +0000 (10:49 +0200)
When hardware/VM request a small VA limit, the generic page-table code
clears PT_FEAT_DYNAMIC_TOP. This later causes domain initialization to
fail with -EOPNOTSUPP.

Remove the clearing so init succeeds when the VA fits in the starting
level and no top-level growth is needed.

Signed-off-by: Ankit Soni <Ankit.Soni@amd.com>
Reviewed-by: Vasant Hegde <vasant.hegde@amd.com>
Reviewed-by: Jason Gunthorpe <jgg@nvidia.com>
Signed-off-by: Joerg Roedel <joerg.roedel@amd.com>
drivers/iommu/generic_pt/iommu_pt.h

index 1765986e24e82ac3b9efce892269492491f836b8..512c03f72d921237dccbb7996211094f8c654cb7 100644 (file)
@@ -1149,10 +1149,6 @@ static int pt_init_common(struct pt_common *common)
        if (PT_WARN_ON(top_range.top_level > PT_MAX_TOP_LEVEL))
                return -EINVAL;
 
-       if (top_range.top_level == PT_MAX_TOP_LEVEL ||
-           common->max_vasz_lg2 == top_range.max_vasz_lg2)
-               common->features &= ~BIT(PT_FEAT_DYNAMIC_TOP);
-
        if (top_range.max_vasz_lg2 == PT_VADDR_MAX_LG2)
                common->features |= BIT(PT_FEAT_FULL_VA);