Skip to content

[PW_SID:1059453] [v5,1/8] iommu/riscv: Enable IOMMU DMA mapping support#1523

Closed
linux-riscv-bot wants to merge 8 commits into
workflow__riscv__fixesfrom
pw1059453
Closed

[PW_SID:1059453] [v5,1/8] iommu/riscv: Enable IOMMU DMA mapping support#1523
linux-riscv-bot wants to merge 8 commits into
workflow__riscv__fixesfrom
pw1059453

Conversation

@linux-riscv-bot
Copy link
Copy Markdown

PR for series 1059453 applied to workflow__riscv__fixes

Name: [v5,1/8] iommu/riscv: Enable IOMMU DMA mapping support
URL: https://patchwork.kernel.org/project/linux-riscv/list/?series=1059453
Version: 5

Jingyu Li and others added 8 commits February 28, 2026 14:53
Enable IOMMU DMA mapping support for RISC-V, so that DMACs can be tested
with translation enabled.

Known Possible Issue:
1. When CONFIG_IOMMU_DMA is enabled, on the tested Linux, RISC-V IOMMU is
   lack of PCIe support, causing riscv_iommu_fault:522 in dealing with
   NVMe PCIe devices.

Signed-off-by: Jingyu Li <joey.li@spacemit.com>
Signed-off-by: Lv Zheng <lv.zheng@linux.spacemit.com>
Signed-off-by: Linux RISC-V bot <linux.riscv.bot@gmail.com>
Introduces auxiliary bus support for RISC-V IOMMU to enable modular
extension of IOMMU capabilities. The framework allows creating auxiliary
devices that can be bound to separate drivers.

The IOMMU HPM featured PMU device ("iommu.riscv_iommu_hpm.0") is created
and registered as RISC-V IOMMU auxiliary device.

Signed-off-by: Jingyu Li <joey.li@spacemit.com>
Signed-off-by: Lv Zheng <lv.zheng@linux.spacemit.com>
Link: https://github.com/riscv-non-isa/riscv-iommu
Cc: Zong Li <zong.li@sifive.com>
Cc: Yaxing Guo <guoyaxing@bosc.ac.cn>
Signed-off-by: Linux RISC-V bot <linux.riscv.bot@gmail.com>
Introduces perf-based HPM driver for RISC-V IOMMU, enabling performance
monitoring capabilities.

Note that the RISC-V IOMMU HPM module uses COUNTER_MAX-1 as a static
counter index of HPMCYCLES, and 0~COUNTER_MAX-2 as the dynamic counter
indexes of other HPMEVENTS in order to correctly index into IOHPMEVT and
IOHPMCTR registers that have already been defined in the iommu-bits.h.
However the users treat 0 as the index of HPMCYCLES and 1~COUNTER_MAX-1 as
the indexes of other HPMEVENTS, thus care should be taken in dealing with
counter indexes between userspace and kernel space.

Signed-off-by: Jingyu Li <joey.li@spacemit.com>
Signed-off-by: Lv Zheng <lv.zheng@linux.spacemit.com>
Link: https://github.com/riscv-non-isa/riscv-iommu
Cc: Zong Li <zong.li@sifive.com>
Cc: Yaxing Guo <guoyaxing@bosc.ac.cn>
Signed-off-by: Linux RISC-V bot <linux.riscv.bot@gmail.com>
Adds device tree bindings for SpacemiT T100 specific features by
introducing spacemit,t100 compatible. T100 contains distributed IOATCs,
each of which exposes pmiv interrupt.

Signed-off-by: Lv Zheng <lv.zheng@linux.spacemit.com>
Signed-off-by: Jingyu Li <joey.li@spacemit.com>
Signed-off-by: Linux RISC-V bot <linux.riscv.bot@gmail.com>
Adds global filter support for RISC-V IOMMU HPM. The global filter can be
seen in SpacemiT T100 which only supports single filter to be applied to
all event counters.

Drivers can program filters in each iohpmevt registers as normal in such a
silicon design, however the underlying hardware filters are wired together
as a global filter applying to all iohpmevt(s). Since the mechanism is
compatible with standard iohpmevt in programming interface, only adds
sanity checks to allow it to be configured with "global" awareness to
inform users a filter incompatiblity.

Signed-off-by: Lv Zheng <lv.zheng@linux.spacemit.com>
Signed-off-by: Jingyu Li <joey.li@spacemit.com>
Signed-off-by: Linux RISC-V bot <linux.riscv.bot@gmail.com>
Add IOATC discovery and HPM support for SpacemiT T100.

SpacemiT T100 supports distributed architecture which allows IOTLBs to be
cached in adjacent to the DMA masters. Such IOTLB controllers are called
as IOATCs. Adds distributed HPM support for IOATCs.

Signed-off-by: Lv Zheng <lv.zheng@linux.spacemit.com>
Signed-off-by: Jingyu Li <joey.li@spacemit.com>
Signed-off-by: Linux RISC-V bot <linux.riscv.bot@gmail.com>
Add a mechanism to allow vendor events to be registered via userspace
jevents. The PMU exposes an "identifier" sysfs attribute derived from the
device tree compatible string (e.g. "spacemit,t100" or "riscv,iommu"),
which perf's jevents uses to match JSON event definitions to the PMU.

Signed-off-by: Lv Zheng <lv.zheng@linux.spacemit.com>
Signed-off-by: Jingyu Li <joey.li@spacemit.com>
Signed-off-by: Linux RISC-V bot <linux.riscv.bot@gmail.com>
Add JSON HPM event aliases for SpacemiT distributed IOMMU (T100) which is
general and compatible for all SpacemiT RISC-V SoCs.

Signed-off-by: Lv Zheng <lv.zheng@linux.spacemit.com>
Signed-off-by: Jingyu Li <joey.li@spacemit.com>
Signed-off-by: Linux RISC-V bot <linux.riscv.bot@gmail.com>
@linux-riscv-bot
Copy link
Copy Markdown
Author

Patch 1: "[v5,1/8] iommu/riscv: Enable IOMMU DMA mapping support"
build-rv32-defconfig
Desc: Builds riscv32 defconfig
Duration: 137.60 seconds
Result: PASS

@linux-riscv-bot
Copy link
Copy Markdown
Author

Patch 1: "[v5,1/8] iommu/riscv: Enable IOMMU DMA mapping support"
build-rv64-clang-allmodconfig
Desc: Builds riscv64 allmodconfig with Clang, and checks for errors and added warnings
Duration: 1931.60 seconds
Result: PASS

@linux-riscv-bot
Copy link
Copy Markdown
Author

Patch 1: "[v5,1/8] iommu/riscv: Enable IOMMU DMA mapping support"
build-rv64-gcc-allmodconfig
Desc: Builds riscv64 allmodconfig with GCC, and checks for errors and added warnings
Duration: 2700.03 seconds
Result: PASS

@linux-riscv-bot
Copy link
Copy Markdown
Author

Patch 1: "[v5,1/8] iommu/riscv: Enable IOMMU DMA mapping support"
build-rv64-nommu-k210-defconfig
Desc: Builds riscv64 defconfig with NOMMU for K210
Duration: 26.45 seconds
Result: PASS

@linux-riscv-bot
Copy link
Copy Markdown
Author

Patch 1: "[v5,1/8] iommu/riscv: Enable IOMMU DMA mapping support"
build-rv64-nommu-k210-virt
Desc: Builds riscv64 defconfig with NOMMU for the virt platform
Duration: 28.04 seconds
Result: PASS

@linux-riscv-bot
Copy link
Copy Markdown
Author

Patch 1: "[v5,1/8] iommu/riscv: Enable IOMMU DMA mapping support"
checkpatch
Desc: Runs checkpatch.pl on the patch
Duration: 0.71 seconds
Result: PASS

@linux-riscv-bot
Copy link
Copy Markdown
Author

Patch 1: "[v5,1/8] iommu/riscv: Enable IOMMU DMA mapping support"
dtb-warn-rv64
Desc: Checks for Device Tree warnings/errors
Duration: 83.38 seconds
Result: PASS

@linux-riscv-bot
Copy link
Copy Markdown
Author

Patch 1: "[v5,1/8] iommu/riscv: Enable IOMMU DMA mapping support"
header-inline
Desc: Detects static functions without inline keyword in header files
Duration: 0.25 seconds
Result: PASS

@linux-riscv-bot
Copy link
Copy Markdown
Author

Patch 1: "[v5,1/8] iommu/riscv: Enable IOMMU DMA mapping support"
kdoc
Desc: Detects for kdoc errors
Duration: 0.97 seconds
Result: PASS

@linux-riscv-bot
Copy link
Copy Markdown
Author

Patch 1: "[v5,1/8] iommu/riscv: Enable IOMMU DMA mapping support"
module-param
Desc: Detect module_param changes
Duration: 0.26 seconds
Result: PASS

@linux-riscv-bot
Copy link
Copy Markdown
Author

Patch 1: "[v5,1/8] iommu/riscv: Enable IOMMU DMA mapping support"
verify-fixes
Desc: Verifies that the Fixes: tags exist
Duration: 0.24 seconds
Result: PASS

@linux-riscv-bot
Copy link
Copy Markdown
Author

Patch 1: "[v5,1/8] iommu/riscv: Enable IOMMU DMA mapping support"
verify-signedoff
Desc: Verifies that Signed-off-by: tags are correct
Duration: 0.32 seconds
Result: PASS

@linux-riscv-bot
Copy link
Copy Markdown
Author

Patch 2: "[v5,2/8] iommu/riscv: Add auxiliary bus framework and HPM device support"
build-rv32-defconfig
Desc: Builds riscv32 defconfig
Duration: 138.03 seconds
Result: PASS

@linux-riscv-bot
Copy link
Copy Markdown
Author

Patch 2: "[v5,2/8] iommu/riscv: Add auxiliary bus framework and HPM device support"
build-rv64-clang-allmodconfig
Desc: Builds riscv64 allmodconfig with Clang, and checks for errors and added warnings
Duration: 1152.78 seconds
Result: PASS

@linux-riscv-bot
Copy link
Copy Markdown
Author

Patch 2: "[v5,2/8] iommu/riscv: Add auxiliary bus framework and HPM device support"
build-rv64-gcc-allmodconfig
Desc: Builds riscv64 allmodconfig with GCC, and checks for errors and added warnings
Duration: 1663.35 seconds
Result: PASS

@linux-riscv-bot
Copy link
Copy Markdown
Author

Patch 2: "[v5,2/8] iommu/riscv: Add auxiliary bus framework and HPM device support"
build-rv64-nommu-k210-defconfig
Desc: Builds riscv64 defconfig with NOMMU for K210
Duration: 26.42 seconds
Result: PASS

@linux-riscv-bot
Copy link
Copy Markdown
Author

Patch 2: "[v5,2/8] iommu/riscv: Add auxiliary bus framework and HPM device support"
build-rv64-nommu-k210-virt
Desc: Builds riscv64 defconfig with NOMMU for the virt platform
Duration: 28.32 seconds
Result: PASS

@linux-riscv-bot
Copy link
Copy Markdown
Author

Patch 2: "[v5,2/8] iommu/riscv: Add auxiliary bus framework and HPM device support"
checkpatch
Desc: Runs checkpatch.pl on the patch
Duration: 2.93 seconds
Result: WARNING
Output:

WARNING: Prefer kzalloc_obj over kzalloc with sizeof
#157: FILE: drivers/iommu/riscv/iommu.c:1646:
+	subdev = kzalloc(sizeof(*subdev), GFP_KERNEL);

WARNING: added, moved or deleted file(s), does MAINTAINERS need updating?
#358: 
new file mode 100644

total: 0 errors, 2 warnings, 0 checks, 369 lines checked

NOTE: For some of the reported defects, checkpatch may be able to
      mechanically convert to the typical style using --fix or --fix-inplace.

Commit b0afc1e6a48c ("iommu/riscv: Add auxiliary bus framework and HPM device support") has style problems, please review.

NOTE: Ignored message types: ALLOC_SIZEOF_STRUCT CAMELCASE COMMIT_LOG_LONG_LINE GIT_COMMIT_ID MACRO_ARG_REUSE NO_AUTHOR_SIGN_OFF

NOTE: If any of the errors are false positives, please report
      them to the maintainer, see CHECKPATCH in MAINTAINERS.
total: 0 errors, 2 warnings, 0 checks, 369 lines checked
WARNING: Prefer kzalloc_obj over kzalloc with sizeof
WARNING: added, moved or deleted file(s), does MAINTAINERS need updating?


@linux-riscv-bot
Copy link
Copy Markdown
Author

Patch 2: "[v5,2/8] iommu/riscv: Add auxiliary bus framework and HPM device support"
dtb-warn-rv64
Desc: Checks for Device Tree warnings/errors
Duration: 84.38 seconds
Result: PASS

@linux-riscv-bot
Copy link
Copy Markdown
Author

Patch 2: "[v5,2/8] iommu/riscv: Add auxiliary bus framework and HPM device support"
header-inline
Desc: Detects static functions without inline keyword in header files
Duration: 0.24 seconds
Result: PASS

@linux-riscv-bot
Copy link
Copy Markdown
Author

Patch 2: "[v5,2/8] iommu/riscv: Add auxiliary bus framework and HPM device support"
kdoc
Desc: Detects for kdoc errors
Duration: 0.88 seconds
Result: PASS

@linux-riscv-bot
Copy link
Copy Markdown
Author

Patch 2: "[v5,2/8] iommu/riscv: Add auxiliary bus framework and HPM device support"
module-param
Desc: Detect module_param changes
Duration: 0.25 seconds
Result: PASS

@linux-riscv-bot
Copy link
Copy Markdown
Author

Patch 6: "[v5,6/8] iommu/riscv: Add SpacemiT T100 IOATC HPM support"
kdoc
Desc: Detects for kdoc errors
Duration: 0.91 seconds
Result: PASS

@linux-riscv-bot
Copy link
Copy Markdown
Author

Patch 6: "[v5,6/8] iommu/riscv: Add SpacemiT T100 IOATC HPM support"
module-param
Desc: Detect module_param changes
Duration: 0.27 seconds
Result: PASS

@linux-riscv-bot
Copy link
Copy Markdown
Author

Patch 6: "[v5,6/8] iommu/riscv: Add SpacemiT T100 IOATC HPM support"
verify-fixes
Desc: Verifies that the Fixes: tags exist
Duration: 0.41 seconds
Result: PASS

@linux-riscv-bot
Copy link
Copy Markdown
Author

Patch 6: "[v5,6/8] iommu/riscv: Add SpacemiT T100 IOATC HPM support"
verify-signedoff
Desc: Verifies that Signed-off-by: tags are correct
Duration: 0.30 seconds
Result: PASS

@linux-riscv-bot
Copy link
Copy Markdown
Author

Patch 7: "[v5,7/8] iommu/riscv: Add vendor event support for RISC-V IOMMU HPM"
build-rv32-defconfig
Desc: Builds riscv32 defconfig
Duration: 137.53 seconds
Result: PASS

@linux-riscv-bot
Copy link
Copy Markdown
Author

Patch 7: "[v5,7/8] iommu/riscv: Add vendor event support for RISC-V IOMMU HPM"
build-rv64-clang-allmodconfig
Desc: Builds riscv64 allmodconfig with Clang, and checks for errors and added warnings
Duration: 1137.98 seconds
Result: PASS

@linux-riscv-bot
Copy link
Copy Markdown
Author

Patch 7: "[v5,7/8] iommu/riscv: Add vendor event support for RISC-V IOMMU HPM"
build-rv64-gcc-allmodconfig
Desc: Builds riscv64 allmodconfig with GCC, and checks for errors and added warnings
Duration: 1642.50 seconds
Result: PASS

@linux-riscv-bot
Copy link
Copy Markdown
Author

Patch 7: "[v5,7/8] iommu/riscv: Add vendor event support for RISC-V IOMMU HPM"
build-rv64-nommu-k210-defconfig
Desc: Builds riscv64 defconfig with NOMMU for K210
Duration: 26.52 seconds
Result: PASS

@linux-riscv-bot
Copy link
Copy Markdown
Author

Patch 7: "[v5,7/8] iommu/riscv: Add vendor event support for RISC-V IOMMU HPM"
build-rv64-nommu-k210-virt
Desc: Builds riscv64 defconfig with NOMMU for the virt platform
Duration: 27.88 seconds
Result: PASS

@linux-riscv-bot
Copy link
Copy Markdown
Author

Patch 7: "[v5,7/8] iommu/riscv: Add vendor event support for RISC-V IOMMU HPM"
checkpatch
Desc: Runs checkpatch.pl on the patch
Duration: 1.48 seconds
Result: PASS

@linux-riscv-bot
Copy link
Copy Markdown
Author

Patch 7: "[v5,7/8] iommu/riscv: Add vendor event support for RISC-V IOMMU HPM"
dtb-warn-rv64
Desc: Checks for Device Tree warnings/errors
Duration: 83.28 seconds
Result: PASS

@linux-riscv-bot
Copy link
Copy Markdown
Author

Patch 7: "[v5,7/8] iommu/riscv: Add vendor event support for RISC-V IOMMU HPM"
header-inline
Desc: Detects static functions without inline keyword in header files
Duration: 0.23 seconds
Result: PASS

@linux-riscv-bot
Copy link
Copy Markdown
Author

Patch 7: "[v5,7/8] iommu/riscv: Add vendor event support for RISC-V IOMMU HPM"
kdoc
Desc: Detects for kdoc errors
Duration: 0.83 seconds
Result: PASS

@linux-riscv-bot
Copy link
Copy Markdown
Author

Patch 7: "[v5,7/8] iommu/riscv: Add vendor event support for RISC-V IOMMU HPM"
module-param
Desc: Detect module_param changes
Duration: 0.26 seconds
Result: PASS

@linux-riscv-bot
Copy link
Copy Markdown
Author

Patch 7: "[v5,7/8] iommu/riscv: Add vendor event support for RISC-V IOMMU HPM"
verify-fixes
Desc: Verifies that the Fixes: tags exist
Duration: 0.22 seconds
Result: PASS

@linux-riscv-bot
Copy link
Copy Markdown
Author

Patch 7: "[v5,7/8] iommu/riscv: Add vendor event support for RISC-V IOMMU HPM"
verify-signedoff
Desc: Verifies that Signed-off-by: tags are correct
Duration: 0.30 seconds
Result: PASS

@linux-riscv-bot
Copy link
Copy Markdown
Author

Patch 8: "[v5,8/8] perf vendor events riscv: Add SpacemiT T100 HPM event aliases"
build-rv32-defconfig
Desc: Builds riscv32 defconfig
Duration: 137.63 seconds
Result: PASS

@linux-riscv-bot
Copy link
Copy Markdown
Author

Patch 8: "[v5,8/8] perf vendor events riscv: Add SpacemiT T100 HPM event aliases"
build-rv64-clang-allmodconfig
Desc: Builds riscv64 allmodconfig with Clang, and checks for errors and added warnings
Duration: 998.35 seconds
Result: PASS

@linux-riscv-bot
Copy link
Copy Markdown
Author

Patch 8: "[v5,8/8] perf vendor events riscv: Add SpacemiT T100 HPM event aliases"
build-rv64-gcc-allmodconfig
Desc: Builds riscv64 allmodconfig with GCC, and checks for errors and added warnings
Duration: 1344.90 seconds
Result: PASS

@linux-riscv-bot
Copy link
Copy Markdown
Author

Patch 8: "[v5,8/8] perf vendor events riscv: Add SpacemiT T100 HPM event aliases"
build-rv64-nommu-k210-defconfig
Desc: Builds riscv64 defconfig with NOMMU for K210
Duration: 26.47 seconds
Result: PASS

@linux-riscv-bot
Copy link
Copy Markdown
Author

Patch 8: "[v5,8/8] perf vendor events riscv: Add SpacemiT T100 HPM event aliases"
build-rv64-nommu-k210-virt
Desc: Builds riscv64 defconfig with NOMMU for the virt platform
Duration: 28.08 seconds
Result: PASS

@linux-riscv-bot
Copy link
Copy Markdown
Author

Patch 8: "[v5,8/8] perf vendor events riscv: Add SpacemiT T100 HPM event aliases"
checkpatch
Desc: Runs checkpatch.pl on the patch
Duration: 1.16 seconds
Result: PASS

@linux-riscv-bot
Copy link
Copy Markdown
Author

Patch 8: "[v5,8/8] perf vendor events riscv: Add SpacemiT T100 HPM event aliases"
dtb-warn-rv64
Desc: Checks for Device Tree warnings/errors
Duration: 83.87 seconds
Result: PASS

@linux-riscv-bot
Copy link
Copy Markdown
Author

Patch 8: "[v5,8/8] perf vendor events riscv: Add SpacemiT T100 HPM event aliases"
header-inline
Desc: Detects static functions without inline keyword in header files
Duration: 0.23 seconds
Result: PASS

@linux-riscv-bot
Copy link
Copy Markdown
Author

Patch 8: "[v5,8/8] perf vendor events riscv: Add SpacemiT T100 HPM event aliases"
kdoc
Desc: Detects for kdoc errors
Duration: 0.92 seconds
Result: PASS

@linux-riscv-bot
Copy link
Copy Markdown
Author

Patch 8: "[v5,8/8] perf vendor events riscv: Add SpacemiT T100 HPM event aliases"
module-param
Desc: Detect module_param changes
Duration: 0.32 seconds
Result: PASS

@linux-riscv-bot
Copy link
Copy Markdown
Author

Patch 8: "[v5,8/8] perf vendor events riscv: Add SpacemiT T100 HPM event aliases"
verify-fixes
Desc: Verifies that the Fixes: tags exist
Duration: 0.22 seconds
Result: PASS

@linux-riscv-bot
Copy link
Copy Markdown
Author

Patch 8: "[v5,8/8] perf vendor events riscv: Add SpacemiT T100 HPM event aliases"
verify-signedoff
Desc: Verifies that Signed-off-by: tags are correct
Duration: 0.30 seconds
Result: PASS

@linux-riscv-bot linux-riscv-bot deleted the pw1059453 branch March 8, 2026 01:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant