public inbox for linux-riscv@lists.infradead.org
 help / color / mirror / Atom feed
* [PATCH 0/2] RISC-V IOMMU HPM support
@ 2025-01-15  3:03 Zong Li
  2025-01-15  3:03 ` [PATCH 1/2] iommu/riscv: add RISC-V IOMMU PMU support Zong Li
  2025-01-15  3:03 ` [PATCH 2/2] iommu/riscv: support HPM and interrupt handling Zong Li
  0 siblings, 2 replies; 16+ messages in thread
From: Zong Li @ 2025-01-15  3:03 UTC (permalink / raw)
  To: joro, will, robin.murphy, tjeznach, paul.walmsley, palmer, aou,
	luxu.kernel, linux-kernel, iommu, linux-riscv
  Cc: Zong Li

This serie implements the RISC-V IOMMU hardware performance monitor
includes both counting and sampling modes.

The specification does not define an event ID for counting the number of
clock cycles, meaning there is no associated `iohpmevt0`. However, we
need an event for counting cycle, so we reserve the maximum event ID for
it.

The interrupt handler needs to be a primary handler instead of a
threaded function because 'pt_regs` is empty when threading the IRQ.
However `pt_regs` is required by perf_event_overflow()

Changed in RFC:
- Rebase onto v6.13-rc7
- Clear interrupt pending before handling interrupt
- Fix the counter value issue caused by OF bit in the cycle counter.
- Invoke riscv_iommu_hpm_disable() instead of riscv_iommu_pmu_uninit()
  in riscv_iommu_remove()

Zong Li (2):
  iommu/riscv: add RISC-V IOMMU PMU support
  iommu/riscv: support HPM and interrupt handling

 drivers/iommu/riscv/Makefile     |   2 +-
 drivers/iommu/riscv/iommu-bits.h |  16 +
 drivers/iommu/riscv/iommu-pmu.c  | 486 +++++++++++++++++++++++++++++++
 drivers/iommu/riscv/iommu.c      |  65 +++++
 drivers/iommu/riscv/iommu.h      |   8 +
 5 files changed, 576 insertions(+), 1 deletion(-)
 create mode 100644 drivers/iommu/riscv/iommu-pmu.c

-- 
2.17.1


_______________________________________________
linux-riscv mailing list
linux-riscv@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-riscv

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

end of thread, other threads:[~2025-01-23 12:16 UTC | newest]

Thread overview: 16+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-01-15  3:03 [PATCH 0/2] RISC-V IOMMU HPM support Zong Li
2025-01-15  3:03 ` [PATCH 1/2] iommu/riscv: add RISC-V IOMMU PMU support Zong Li
2025-01-15  3:45   ` [External] " Xu Lu
2025-01-15  7:48     ` Zong Li
2025-01-15  8:25       ` Xu Lu
2025-01-15 21:32   ` Robin Murphy
2025-01-23  6:56     ` Zong Li
2025-01-23  8:35   ` kernel test robot
2025-01-23 12:16   ` kernel test robot
2025-01-15  3:03 ` [PATCH 2/2] iommu/riscv: support HPM and interrupt handling Zong Li
2025-01-15  9:44   ` Andrew Jones
2025-01-17  2:33     ` Zong Li
2025-01-15 21:56   ` Robin Murphy
2025-01-17  2:46     ` Zong Li
2025-01-17 12:45       ` Robin Murphy
2025-01-21  8:37         ` Zong Li

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