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.
And 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:
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 (3):
iommu/generic_pt: support small VA for AMDv1
iommu/generic_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 | 5 ++++-
drivers/iommu/generic_pt/iommu_pt.h | 4 ----
drivers/iommu/generic_pt/kunit_iommu_pt.h | 5 +++--
7 files changed, 19 insertions(+), 14 deletions(-)
--
2.43.0