mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [RFC PATCH v2 0/4] iommu/riscv: Add irqbypass support without MSI page table
@ 2026-10-14 14:11 fangyu.yu
  2026-10-14 14:11 ` [RFC PATCH v2 1/4] iommupt: Add replace_leaf to atomically swap a leaf OA fangyu.yu
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: fangyu.yu @ 2026-10-14 14:11 UTC (permalink / raw)
  To: tomasz.jeznach, joro, will, robin.murphy, pjw, palmer, aou, alex,
	jroedel, zong.li, andrew.jones, jgg, jgg, gsh517025
  Cc: fangyu.yu, guoren, iommu, linux-kernel, linux-riscv, kvm-riscv

From: Fangyu Yu <fangyu.yu@linux.alibaba.com>

The MSI page table is an optional feature of the RISC-V IOMMU
specification. Hardware without the MSI_FLAT capability has no such
table, and MSI writes from devices are translated by the second-stage
page table like any other DMA.

Since the second-stage page table governs where those MSI writes land,
forwarding is still possible without an MSI page table: map the guest
IMSIC GPA to the host IMSIC HPA in the second-stage domain and device
MSI writes reach the vCPU's interrupt file directly, bypassing the host
MSI path entirely.

This patch implements irqbypass using second-stage page table, so it
is a functional supplement for IOMMU without MSI page table.

This series is based on Andrew Jones' v3 irqbypass support series [1]

[1] https://lore.kernel.org/linux-riscv/20260928143113.49838-1-andrew.jones@oss.qualcomm.com/

---
Changes in v2:
    - Following Jason's and Shuai's suggestion, the atomic PTE replace operation
      is moved into generic_pt as a new replace_leaf op (new patch 1), and the
      riscv driver now uses it to repoint the guest IMSIC GPA mapping instead of
      walking the second-stage page table in the driver (patch 3).
    - Link to v1:
      https://lore.kernel.org/linux-riscv/20261008140001.94508-1-fangyu.yu@linux.alibaba.com/

Fangyu Yu (4):
  iommupt: Add replace_leaf to atomically swap a leaf OA
  iommu/riscv: Extract IRQ forwarding payload validation
  iommu/riscv: Add guest IMSIC GPA mapping helpers
  iommu/riscv: Support IRQ forwarding without MSI page tables

 drivers/iommu/generic_pt/fmt/riscv.h      |  47 ++++++
 drivers/iommu/generic_pt/iommu_pt.h       |  65 ++++++++
 drivers/iommu/generic_pt/kunit_iommu.h    |   7 +
 drivers/iommu/generic_pt/kunit_iommu_pt.h |  54 +++++++
 drivers/iommu/riscv/iommu-ir.c            | 178 ++++++++++++++++++++--
 drivers/iommu/riscv/iommu.c               |  43 ++++++
 drivers/iommu/riscv/iommu.h               |  12 ++
 include/linux/generic_pt/iommu.h          |   4 +
 8 files changed, 401 insertions(+), 9 deletions(-)

-- 
2.50.1


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

end of thread, other threads:[~2026-10-14 14:11 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-10-14 14:11 [RFC PATCH v2 0/4] iommu/riscv: Add irqbypass support without MSI page table fangyu.yu
2026-10-14 14:11 ` [RFC PATCH v2 1/4] iommupt: Add replace_leaf to atomically swap a leaf OA fangyu.yu
2026-10-14 14:11 ` [RFC PATCH v2 2/4] iommu/riscv: Extract IRQ forwarding payload validation fangyu.yu
2026-10-14 14:11 ` [RFC PATCH v2 3/4] iommu/riscv: Add guest IMSIC GPA mapping helpers fangyu.yu
2026-10-14 14:11 ` [RFC PATCH v2 4/4] iommu/riscv: Support IRQ forwarding without MSI page tables fangyu.yu

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

all inboxes | Powered by JetHome®