[PATCH v1.1 0/7] iommu/riscv: Add HPM support for RISC-V IOMMU
Lv Zheng
lv.zheng at spacemit.com
Wed Jan 28 22:08:17 PST 2026
Includes HPM support for RISC-V IOMMU. The HPM hardware mechnism can be
found in the recent announced SpacemiT SoCs (K3, V100), where T100
(SpacemiT distributed IOMMU) is shipped.
The tested result can be found as follows:
root at sdfirm:~# perf stat --timeout 5000 -a -e riscv_iommu_hpm_0/device_dir_walks,config1=0x20c0010000000000/ dmatest; sleep 1
[ 176.110211] dmatest: Started 1 threads using dma0chan0
[ 176.114933] dmatest: dma0chan0-copy0: summary 1 tests, 0 failures 394.94 iops 394 KB/s (0)
Performance counter stats for 'system wide':
3 riscv_iommu_hpm_0/device_dir_walks,config1=0x20c0010000000000/
0.081056000 seconds time elapsed
root at sdfirm:~# perf stat --timeout 5000 -a -e riscv_iommu_hpm_0/s_stage_walks,config1=0x20c0010000000000/ dmatest; sleep 1
[ 68.152992] dmatest: Started 1 threads using dma0chan0
[ 68.158071] dmatest: dma0chan0-copy0: summary 1 tests, 0 failures 401.92 iops 401 KB/s (0)
Performance counter stats for 'system wide':
6 riscv_iommu_hpm_0/s_stage_walks,config1=0x20c0010000000000/
0.083192000 seconds time elapsed
Jingyu Li (3):
iommu/riscv: Enable IOMMU DMA mapping support
iommu/riscv: Fix WSI mode IRQ number handling
iommu/riscv: Add HPM support for performance monitoring
Lv Zheng (4):
dt-bindings: iommu: Add spacemit/t100 features
spacemit/t100: Add vendor event support for RISC-V IOMMU HPM
spacemit/t100: Add global filter support for RISC-V IOMMU HPM
spacemit/t100: Add SpacemiT T100 IOATC HPM support
.../bindings/iommu/riscv,iommu.yaml | 60 +-
drivers/iommu/Kconfig | 2 +-
drivers/iommu/riscv/Kconfig | 9 +
drivers/iommu/riscv/Makefile | 1 +
drivers/iommu/riscv/iommu-bits.h | 20 +-
drivers/iommu/riscv/iommu-hpm.c | 1135 +++++++++++++++++
drivers/iommu/riscv/iommu-pci.c | 13 +-
drivers/iommu/riscv/iommu-platform.c | 12 +-
drivers/iommu/riscv/iommu.c | 25 +-
drivers/iommu/riscv/iommu.h | 45 +-
10 files changed, 1308 insertions(+), 14 deletions(-)
create mode 100644 drivers/iommu/riscv/iommu-hpm.c
--
2.43.0
This message and any attachment are confidential and may be privileged or otherwise protected from disclosure. If you are not an intended recipient of this message, please delete it and any attachment from your system and notify the sender immediately by reply e-mail. Unintended recipients should not use, copy, disclose or take any action based on this message or any information contained in this message. Emails cannot be guaranteed to be secure or error free as they can be intercepted, amended, lost or destroyed, and you should take full responsibility for security checking.
本邮件及其任何附件具有保密性质,并可能受其他保护或不允许被披露给第三方。如阁下误收到本邮件,敬请立即以回复电子邮件的方式通知发件人,并将本邮件及其任何附件从阁下系统中予以删除。如阁下并非本邮件写明之收件人,敬请切勿使用、复制、披露本邮件或其任何内容,亦请切勿依本邮件或其任何内容而采取任何行动。电子邮件无法保证是一种安全和不会出现任何差错的通信方式,可能会被拦截、修改、丢失或损坏,收件人需自行负责做好安全检查。
More information about the linux-riscv
mailing list