public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH v4 0/3] Respect VASIZE for address limits
@ 2026-04-01 14:43 Ankit Soni
  2026-04-01 14:43 ` [PATCH v4 1/3] iommu_pt: support small VA for AMDv1 Ankit Soni
                   ` (2 more replies)
  0 siblings, 3 replies; 6+ messages in thread
From: Ankit Soni @ 2026-04-01 14:43 UTC (permalink / raw)
  To: iommu
  Cc: vasant.hegde, suravee.suthikulpanit, joro, will, robin.murphy,
	linux-kernel, jgg

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


^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2026-04-06 13:28 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-04-01 14:43 [PATCH v4 0/3] Respect VASIZE for address limits Ankit Soni
2026-04-01 14:43 ` [PATCH v4 1/3] iommu_pt: support small VA for AMDv1 Ankit Soni
2026-04-06 13:28   ` Jason Gunthorpe
2026-04-01 14:43 ` [PATCH v4 2/3] iommu_pt: add kunit config for 32-bit VA (amdv1_cfg_1) Ankit Soni
2026-04-06 13:28   ` Jason Gunthorpe
2026-04-01 14:43 ` [PATCH v4 3/3] iommu/amd: Adhere to IVINFO[VASIZE] for address limits Ankit Soni

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox