public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH v5 0/4] Respect VASIZE for address limits
@ 2026-04-13 14:45 Ankit Soni
  2026-04-13 14:45 ` [PATCH v5 1/4] iommu_pt: Fix pgsize_bitmap calculation in get_info for smaller vasz's Ankit Soni
                   ` (3 more replies)
  0 siblings, 4 replies; 7+ messages in thread
From: Ankit Soni @ 2026-04-13 14:45 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.

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


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

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

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-04-13 14:45 [PATCH v5 0/4] Respect VASIZE for address limits Ankit Soni
2026-04-13 14:45 ` [PATCH v5 1/4] iommu_pt: Fix pgsize_bitmap calculation in get_info for smaller vasz's Ankit Soni
2026-04-13 16:11   ` Jason Gunthorpe
2026-04-13 14:45 ` [PATCH v5 2/4] iommu_pt: support small VA for AMDv1 Ankit Soni
2026-04-13 16:11   ` Jason Gunthorpe
2026-04-13 14:45 ` [PATCH v5 3/4] iommu_pt: add kunit config for 32-bit VA (amdv1_cfg_1) Ankit Soni
2026-04-13 14:45 ` [PATCH v5 4/4] 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