The Linux Kernel Mailing List
 help / color / mirror / Atom feed
* [PATCH 0/2] iommufd: Add AMD vIOMMU HW queue support
@ 2026-07-08  1:56 Suravee Suthikulpanit
  2026-07-08  1:56 ` [PATCH 1/2] iommufd: add hw_queue_init for guest-address queue setup Suravee Suthikulpanit
  2026-07-08  1:56 ` [PATCH 2/2] iommu/amd: add vIOMMU HW queue initialization Suravee Suthikulpanit
  0 siblings, 2 replies; 4+ messages in thread
From: Suravee Suthikulpanit @ 2026-07-08  1:56 UTC (permalink / raw)
  To: linux-kernel, iommu, joro, jgg
  Cc: yi.l.liu, kevin.tian, nicolinc, vasant.hegde, jon.grimm,
	santosh.shukla, sairaj.k, jay.chen, wvw, wnliu, dantuluris,
	chriscli, kpsingh, Suravee Suthikulpanit

Notes:

* This series depends on the "[PATCH v3 00/22] iommu/amd: Introduce
  AMD Hardware-accelerated Virtualized IOMMU (vIOMMU) Support"
  (https://lore.kernel.org/linux-iommu/20260629153535.15775-1-suravee.suthikulpanit@amd.com/)

* Previously, this series was part of the AMD HW vIOMMU series,
  and now is being split into its own series to make it easier to
  review.

Overview:

AMD HW-accelerated Virtualized IOMMU (vIOMMU) guests own command, event,
and PPR queues in guest physical address space. The existing iommufd
HW queue path pins host pages and passes a physical address to the driver
via hw_queue_init_phys(). vIOMMU hardware instead consumes guest queue
GPAs supplied by userspace through IOMMU_HW_QUEUE_ALLOC.

This series adds a guest-address initialization path in the iommufd
core and wires AMD vIOMMU VFCTRL programming for command, event, and
PPR queues.

Patch 1 factors HW queue allocation into _iommufd_hw_queue_init()
and introduces hw_queue_init in iommufd_viommu_ops. Drivers that
implement hw_queue_init receive the queue GPA in hw_queue->base_addr
without the core pinning host backing pages.

Patch 2 extends the IOMMU_HW_QUEUE_ALLOC UAPI with AMD queue types
and per-queue enable flags, stores flags on iommufd_hw_queue, and
programs guest command, event, and PPR control registers in VFCTRL
during _amd_viommu_hw_queue_init().

* In this version, the CommandBuf, EventLog, and PPRLog are expected
  to be allocated when the corresponding enable bits in the guest
  IOMMU Control MMIO register are set, which is different from the
  previous version where the HW queue is allocated when the buffers
  base-address/size are programmed.

Thanks,
Suravee

Suravee Suthikulpanit (2):
  iommufd: add hw_queue_init for guest-address queue setup
  iommu/amd: add vIOMMU HW queue initialization

 drivers/iommu/amd/amd_iommu_types.h |   8 ++
 drivers/iommu/amd/iommufd.c         | 129 ++++++++++++++++++++++++++++
 drivers/iommu/iommufd/viommu.c      |  95 +++++++++++---------
 include/linux/iommufd.h             |   6 +-
 include/uapi/linux/iommufd.h        |  31 ++++++-
 5 files changed, 228 insertions(+), 41 deletions(-)

-- 
2.34.1

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

end of thread, other threads:[~2026-07-08  2:39 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-07-08  1:56 [PATCH 0/2] iommufd: Add AMD vIOMMU HW queue support Suravee Suthikulpanit
2026-07-08  1:56 ` [PATCH 1/2] iommufd: add hw_queue_init for guest-address queue setup Suravee Suthikulpanit
2026-07-08  2:39   ` Nicolin Chen
2026-07-08  1:56 ` [PATCH 2/2] iommu/amd: add vIOMMU HW queue initialization Suravee Suthikulpanit

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