iommu_pt: support small VA for AMDv1

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>
This commit is contained in:
Ankit Soni 2026-04-13 14:45:19 +00:00 committed by Joerg Roedel
parent 04f1f4bf30
commit 5240dab55b

View 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);