[PATCH v5 0/4] Respect VASIZE for address limits
From: Ankit Soni
Date: Mon Apr 13 2026 - 10:53:38 EST
The AMD IOMMU driver was only using EFR[HATS] to derive the VA size,
ignoring the IVINFO[VASIZE] limit. This could create domains that
exceed the bounds advertised by hypervisor. With this series, driver
respects IVINFO[VASIZE] when determining the addressable VA range.
For a small VA size, domain initialization in the generic page table
framework can fail with -EOPNOTSUPP. This happens because the page table
clears the dynamic top feature from the force enabled feature set, as no
page table growth is needed beyond the current level.
This series also fixes this issue and adds KUnit test coverage for the
32-bit VA configuration.
Changes:
v5: - Added Jason's suggestion for modifying get_info().
v4: - Remove PT_FEAT_DYNAMIC_TOP check from pt_init_common().
- Add test coverage in amdv1 for 32bit va size.
v3: - Remove specific value checking for vasize.
- Add patch for PT_FORCE_ENABLED_FEATURES.
v2: - Mark ivinfo_vasize_bits() as __init.
Ankit Soni (4):
iommu_pt: Fix pgsize_bitmap calculation in get_info for smaller vasz's
iommu_pt: support small VA for AMDv1
iommu_pt: add kunit config for 32-bit VA (amdv1_cfg_1)
iommu/amd: Adhere to IVINFO[VASIZE] for address limits
drivers/iommu/amd/amd_iommu.h | 2 +-
drivers/iommu/amd/amd_iommu_types.h | 1 +
drivers/iommu/amd/init.c | 13 +++++++++----
drivers/iommu/amd/iommu.c | 3 +--
drivers/iommu/generic_pt/fmt/amdv1.h | 1 +
drivers/iommu/generic_pt/iommu_pt.h | 12 ++++++------
drivers/iommu/generic_pt/kunit_generic_pt.h | 10 +++++++---
drivers/iommu/generic_pt/kunit_iommu_pt.h | 5 +++--
8 files changed, 29 insertions(+), 18 deletions(-)
--
2.43.0