public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH v4 00/16] iommu/amd: Introduce Nested Translation support
@ 2025-10-21  1:43 Suravee Suthikulpanit
  2025-10-21  1:43 ` [PATCH v4 01/16] iommu/amd: Rename DEV_DOMID_MASK to DTE_DOMID_MASK Suravee Suthikulpanit
                   ` (15 more replies)
  0 siblings, 16 replies; 43+ messages in thread
From: Suravee Suthikulpanit @ 2025-10-21  1:43 UTC (permalink / raw)
  To: jgg, nicolinc
  Cc: linux-kernel, robin.murphy, will, joro, kevin.tian, jsnitsel,
	vasant.hegde, iommu, santosh.shukla, sairaj.arunkodilkar,
	jon.grimm, prashanthpra, wvw, wnliu, gptran, kpsingh,
	joao.m.martins, alejandro.j.jimenez, Suravee Suthikulpanit

This series introduces support for AMD IOMMU nested page table translation
with the host (v1) and guest (v2) page tables.

In this mode, the AMD IOMMU driver configures the Device Table Entry (DTE)
with host page table root pointer, which is configured by allocating domain
with page table type IOMMU_HWPT_ALLOC_NEST_PARENT.

The guest page tables and Guest CR3 (GCR3) tables are managed by Guest OS,
and stored in the guest DTE (gDTE) in guest memory. VMM is responsible for
passing gDTE information to the host IOMMU driver using struct
iommu_hwpt_amd_guest when allocating a domain type IOMMU_DOMAIN_NESTED.
Then, the gDTE is parsed and program onto host DTE by the AMD IOMMU driver.

In addition, this series introduces base code for IOMMUFD vIOMMU for AMD
IOMMU, and implements vIOMMU-based nested domain allocation interface.
The struct nested_domain to store nested domain information, and
set_dte_nested() helper function to handle DTE programing for the nested
domain.

The series is separated into two parts:
 * Patch 1-7 are preparatory patches.
 * Patch 8-16 implement nest-parent and nested domains support
   for IOMMUFD vIOMMU.

Note: This series is rebased on top of:
 * [PATCH v5] iommu/amd: Add support for hw_info for iommu capability query
   https://lore.kernel.org/linux-iommu/20250926141901.511313-1-suravee.suthikulpanit@amd.com/T/#u 

Changes from V3:
(https://lore.kernel.org/linux-iommu/20251009235755.4497-1-suravee.suthikulpanit@amd.com)
 * (New) Patch 11 introduces struct amd_iommu_viommu and amd_iommufd_viommu_init(),
   which contain minimal code to store reference to nest parent domain for
   nested domain attachment. (Per Jason / Nicolin)
 * (New) Patch 13 refactor hDomID-related logic, and invalidate host (S2) page
   table with host domain IDs stored in an xarray. (Per Jason)
 * Patch 15: Clean up logic in set_dte_entry().

Thanks,
Suravee

Suravee Suthikulpanit (16):
  iommu/amd: Rename DEV_DOMID_MASK to DTE_DOMID_MASK
  iommu/amd: Make amd_iommu_pdom_id_alloc() non-static
  iommu/amd: Make amd_iommu_pdom_id_free() non-static
  iommu/amd: Make amd_iommu_device_flush_dte() non-static
  iommu/amd: Make amd_iommu_update_dte256() non-static
  iommu/amd: Make amd_iommu_make_clear_dte() non-static inline
  iommu/amd: Make amd_iommu_completion_wait() non-static
  iommufd: Introduce data struct for AMD nested domain allocation
  iommu/amd: Always enable GCR3TRPMode when supported.
  iommu/amd: Add support for nest parent domain allocation
  iommu/amd: Introduce struct amd_iommu_viommu
  iommu/amd: Add support for nested domain allocation
  iommu/amd: Track host Domain ID mapping for each guest Domain ID
  iommu/amd: Refactor persistent DTE bits programming into
    amd_iommu_make_clear_dte()
  iommu/amd: Refactor logic to program the host page table in DTE
  iommu/amd: Add support for nested domain attach/detach

 drivers/iommu/amd/Makefile          |   2 +-
 drivers/iommu/amd/amd_iommu.h       |  36 +++++
 drivers/iommu/amd/amd_iommu_types.h |  28 +++-
 drivers/iommu/amd/init.c            |   3 +
 drivers/iommu/amd/iommu.c           | 200 ++++++++++++++----------
 drivers/iommu/amd/iommufd.c         |  17 ++
 drivers/iommu/amd/iommufd.h         |   5 +
 drivers/iommu/amd/nested.c          | 233 ++++++++++++++++++++++++++++
 include/uapi/linux/iommufd.h        |  11 ++
 9 files changed, 453 insertions(+), 82 deletions(-)
 create mode 100644 drivers/iommu/amd/nested.c

-- 
2.34.1


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

end of thread, other threads:[~2025-11-17 18:08 UTC | newest]

Thread overview: 43+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-10-21  1:43 [PATCH v4 00/16] iommu/amd: Introduce Nested Translation support Suravee Suthikulpanit
2025-10-21  1:43 ` [PATCH v4 01/16] iommu/amd: Rename DEV_DOMID_MASK to DTE_DOMID_MASK Suravee Suthikulpanit
2025-11-08 17:25   ` Vasant Hegde
2025-10-21  1:43 ` [PATCH v4 02/16] iommu/amd: Make amd_iommu_pdom_id_alloc() non-static Suravee Suthikulpanit
2025-11-08 17:24   ` Vasant Hegde
2025-10-21  1:43 ` [PATCH v4 03/16] iommu/amd: Make amd_iommu_pdom_id_free() non-static Suravee Suthikulpanit
2025-11-08 17:26   ` Vasant Hegde
2025-10-21  1:43 ` [PATCH v4 04/16] iommu/amd: Make amd_iommu_device_flush_dte() non-static Suravee Suthikulpanit
2025-11-08 17:27   ` Vasant Hegde
2025-10-21  1:43 ` [PATCH v4 05/16] iommu/amd: Make amd_iommu_update_dte256() non-static Suravee Suthikulpanit
2025-11-08 17:27   ` Vasant Hegde
2025-10-21  1:43 ` [PATCH v4 06/16] iommu/amd: Make amd_iommu_make_clear_dte() non-static inline Suravee Suthikulpanit
2025-11-08 17:27   ` Vasant Hegde
2025-10-21  1:43 ` [PATCH v4 07/16] iommu/amd: Make amd_iommu_completion_wait() non-static Suravee Suthikulpanit
2025-11-08 17:32   ` Vasant Hegde
2025-10-21  1:43 ` [PATCH v4 08/16] iommufd: Introduce data struct for AMD nested domain allocation Suravee Suthikulpanit
2025-11-08 17:30   ` Vasant Hegde
2025-10-21  1:43 ` [PATCH v4 09/16] iommu/amd: Always enable GCR3TRPMode when supported Suravee Suthikulpanit
2025-10-23  2:24   ` Nicolin Chen
2025-11-08 17:39   ` Vasant Hegde
2025-11-11 13:59     ` Suthikulpanit, Suravee
2025-10-21  1:43 ` [PATCH v4 10/16] iommu/amd: Add support for nest parent domain allocation Suravee Suthikulpanit
2025-10-23  2:27   ` Nicolin Chen
2025-10-23 20:08     ` Suthikulpanit, Suravee
2025-10-21  1:43 ` [PATCH v4 11/16] iommu/amd: Introduce struct amd_iommu_viommu Suravee Suthikulpanit
2025-10-22 20:00   ` Jason Gunthorpe
2025-10-23  2:33   ` Nicolin Chen
2025-10-21  1:43 ` [PATCH v4 12/16] iommu/amd: Add support for nested domain allocation Suravee Suthikulpanit
2025-10-22 20:01   ` Jason Gunthorpe
2025-10-21  1:43 ` [PATCH v4 13/16] iommu/amd: Track host Domain ID mapping for each guest Domain ID Suravee Suthikulpanit
2025-10-22 20:08   ` Jason Gunthorpe
2025-11-05 10:50     ` Suthikulpanit, Suravee
2025-11-05 13:35       ` Jason Gunthorpe
2025-10-21  1:43 ` [PATCH v4 14/16] iommu/amd: Refactor persistent DTE bits programming into amd_iommu_make_clear_dte() Suravee Suthikulpanit
2025-10-23  2:49   ` Nicolin Chen
2025-10-21  1:43 ` [PATCH v4 15/16] iommu/amd: Refactor logic to program the host page table in DTE Suravee Suthikulpanit
2025-10-23 13:08   ` Jason Gunthorpe
2025-11-08 17:26     ` Vasant Hegde
2025-11-08 23:03       ` Jason Gunthorpe
2025-11-12 18:40         ` Suthikulpanit, Suravee
2025-11-17 18:08           ` Jason Gunthorpe
2025-10-21  1:43 ` [PATCH v4 16/16] iommu/amd: Add support for nested domain attach/detach Suravee Suthikulpanit
2025-10-23 13:17   ` Jason Gunthorpe

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