Skip to content

[PW_SID:1150555] RISC-V IOMMU HPM support - #2517

Closed
linux-riscv-bot wants to merge 2 commits into
workflow__riscv__fixesfrom
pw1150555
Closed

[PW_SID:1150555] RISC-V IOMMU HPM support#2517
linux-riscv-bot wants to merge 2 commits into
workflow__riscv__fixesfrom
pw1150555

Conversation

@linux-riscv-bot

Copy link
Copy Markdown

PR for series 1150555 applied to workflow__riscv__fixes

Name: RISC-V IOMMU HPM support
URL: https://patchwork.kernel.org/project/linux-riscv/list/?series=1150555
Version: 6

Add a new driver to support the RISC-V IOMMU PMU. This is an auxiliary
device driver created by the parent RISC-V IOMMU driver.

The performance monitor provides counters with filtering support to
collect events for specific device ID/process ID, or GSCID/PSCID.

The RISC-V IOMMU PMU separates the cycle counter from the event counters.
The cycle counter is not associated with iohpmevt0, so a software-defined
cycle event is required for the perf subsystem.

The number and width of the counters are hardware-implemented and must
be detected at runtime.

Leave out all the dead cleanup code (i.e. .remove() operation) if the
PMU driver is tied to the IOMMU driver and can never realistically be
removed.

PMU-related definitions are moved into the perf driver, where they are
used exclusively.

According to RISC-V IOMMU specification Chapter 6:
Whether an 8 byte access to an IOMMU register is single-copy atomic is
UNSPECIFIED. Use two separate 4 byte accesses for hardware
compatibility.

Tested-by: Chen Pei <cp0613@linux.alibaba.com>
Tested-by: Fangyu Yu <fangyu.yu@linux.alibaba.com>
Reviewed-by: Guo Ren (Alibaba DAMO Academy) <guoren@kernel.org>
Suggested-by: David Laight <david.laight.linux@gmail.com>
Suggested-by: Guo Ren <guoren@kernel.org>
Link: https://lore.kernel.org/linux-riscv/20260618143634.7f3dd6c5@pumpkin/
Signed-off-by: Zong Li <zong.li@sifive.com>
Signed-off-by: Linux RISC-V bot <linux.riscv.bot@gmail.com>
Create an auxiliary device for HPM when the IOMMU supports a
hardware performance monitor.

Tested-by: Chen Pei <cp0613@linux.alibaba.com>
Tested-by: Fangyu Yu <fangyu.yu@linux.alibaba.com>
Reviewed-by: Guo Ren <guoren@kernel.org>
Suggested-by: Samuel Holland <samuel.holland@sifive.com>
Signed-off-by: Zong Li <zong.li@sifive.com>
Signed-off-by: Linux RISC-V bot <linux.riscv.bot@gmail.com>
@linux-riscv-bot

Copy link
Copy Markdown
Author

Patch 1: "[v6,1/2] drivers/perf: riscv-iommu: add risc-v iommu pmu driver"
build-rv32-defconfig
Desc: Builds riscv32 defconfig
Duration: 146.33 seconds
Result: PASS

@linux-riscv-bot

Copy link
Copy Markdown
Author

Patch 1: "[v6,1/2] drivers/perf: riscv-iommu: add risc-v iommu pmu driver"
build-rv64-clang-allmodconfig
Desc: Builds riscv64 allmodconfig with Clang, and checks for errors and added warnings
Duration: 783.16 seconds
Result: ERROR
Output:

Redirect to /build/tmp.klr4LqunRw and /build/tmp.mVi5YW8O21
Tree base:
6f6f7c0e8b695 ("Adding CI files")
Building the whole tree with the patch
error:
/build/tmpoctib55f/drivers/perf/riscv_iommu_pmu.c:184:9: error: call to undeclared function 'cpumap_print_to_pagebuf'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration]



real	12m54.687s
user	498m48.676s
sys	88m19.646s

@linux-riscv-bot

Copy link
Copy Markdown
Author

Patch 1: "[v6,1/2] drivers/perf: riscv-iommu: add risc-v iommu pmu driver"
build-rv64-gcc-allmodconfig
Desc: Builds riscv64 allmodconfig with GCC, and checks for errors and added warnings
Duration: 1052.21 seconds
Result: ERROR
Output:

Redirect to /build/tmp.PFWJzvyJp8 and /build/tmp.Q2c6eBiT46
Tree base:
6f6f7c0e8b695 ("Adding CI files")
Building the whole tree with the patch
error:
/build/tmpoctib55f/drivers/perf/riscv_iommu_pmu.c:184:16: error: implicit declaration of function 'cpumap_print_to_pagebuf'; did you mean 'cpumap_print_list_to_buf'? [-Wimplicit-function-declaration]



real	17m19.717s
user	679m52.225s
sys	107m9.077s

@linux-riscv-bot

Copy link
Copy Markdown
Author

Patch 1: "[v6,1/2] drivers/perf: riscv-iommu: add risc-v iommu pmu driver"
build-rv64-nommu-k210-defconfig
Desc: Builds riscv64 defconfig with NOMMU for K210
Duration: 29.76 seconds
Result: PASS

@linux-riscv-bot

Copy link
Copy Markdown
Author

Patch 1: "[v6,1/2] drivers/perf: riscv-iommu: add risc-v iommu pmu driver"
build-rv64-nommu-k210-virt
Desc: Builds riscv64 defconfig with NOMMU for the virt platform
Duration: 31.37 seconds
Result: PASS

@linux-riscv-bot

Copy link
Copy Markdown
Author

Patch 1: "[v6,1/2] drivers/perf: riscv-iommu: add risc-v iommu pmu driver"
checkpatch
Desc: Runs checkpatch.pl on the patch
Duration: 3.02 seconds
Result: WARNING
Output:

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

CHECK: Please use a blank line after function/struct/union/enum declarations
#493: FILE: drivers/perf/riscv_iommu_pmu.c:334:
+}
+static void riscv_iommu_pmu_start_all(struct riscv_iommu_pmu *pmu, u32 inhibit)

CHECK: Alignment should match open parenthesis
#713: FILE: drivers/perf/riscv_iommu_pmu.c:554:
+	target_cpu = cpumask_any_and_but(cpumask_of_node(iommu_pmu->numa_node),
+					  cpu_online_mask, cpu);

CHECK: Alignment should match open parenthesis
#901: FILE: drivers/perf/riscv_iommu_pmu.c:742:
+	ret = cpuhp_state_add_instance_nocalls_cpuslocked(cpuhp_state,
+							 &iommu_pmu->node);

total: 0 errors, 1 warnings, 3 checks, 905 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 77e2d4df3727 ("drivers/perf: riscv-iommu: add risc-v iommu pmu driver") 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, 1 warnings, 3 checks, 905 lines checked
CHECK: Alignment should match open parenthesis
CHECK: Please use a blank line after function/struct/union/enum declarations
WARNING: added, moved or deleted file(s), does MAINTAINERS need updating?


@linux-riscv-bot

Copy link
Copy Markdown
Author

Patch 1: "[v6,1/2] drivers/perf: riscv-iommu: add risc-v iommu pmu driver"
dtb-warn-rv64
Desc: Checks for Device Tree warnings/errors
Duration: 90.94 seconds
Result: PASS

@linux-riscv-bot

Copy link
Copy Markdown
Author

Patch 1: "[v6,1/2] drivers/perf: riscv-iommu: add risc-v iommu pmu driver"
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: "[v6,1/2] drivers/perf: riscv-iommu: add risc-v iommu pmu driver"
kdoc
Desc: Detects for kdoc errors
Duration: 0.93 seconds
Result: PASS

@linux-riscv-bot

Copy link
Copy Markdown
Author

Patch 1: "[v6,1/2] drivers/perf: riscv-iommu: add risc-v iommu pmu driver"
module-param
Desc: Detect module_param changes
Duration: 0.26 seconds
Result: PASS

@linux-riscv-bot

Copy link
Copy Markdown
Author

Patch 1: "[v6,1/2] drivers/perf: riscv-iommu: add risc-v iommu pmu driver"
verify-fixes
Desc: Verifies that the Fixes: tags exist
Duration: 0.22 seconds
Result: PASS

@linux-riscv-bot

Copy link
Copy Markdown
Author

Patch 1: "[v6,1/2] drivers/perf: riscv-iommu: add risc-v iommu pmu driver"
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 2: "[v6,2/2] iommu/riscv: create a auxiliary device for HPM"
build-rv32-defconfig
Desc: Builds riscv32 defconfig
Duration: 146.51 seconds
Result: PASS

@linux-riscv-bot

Copy link
Copy Markdown
Author

Patch 2: "[v6,2/2] iommu/riscv: create a auxiliary device for HPM"
build-rv64-clang-allmodconfig
Desc: Builds riscv64 allmodconfig with Clang, and checks for errors and added warnings
Duration: 785.50 seconds
Result: ERROR
Output:

Redirect to /build/tmp.V2X0MIQWnW and /build/tmp.JwlstfL188
Tree base:
77e2d4df37270 ("drivers/perf: riscv-iommu: add risc-v iommu pmu driver")
Building the whole tree with the patch
error:
/build/tmphmvs9u73/drivers/perf/riscv_iommu_pmu.c:184:9: error: call to undeclared function 'cpumap_print_to_pagebuf'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration]



real	12m56.753s
user	500m19.139s
sys	88m47.806s

@linux-riscv-bot

Copy link
Copy Markdown
Author

Patch 2: "[v6,2/2] iommu/riscv: create a auxiliary device for HPM"
build-rv64-gcc-allmodconfig
Desc: Builds riscv64 allmodconfig with GCC, and checks for errors and added warnings
Duration: 1046.08 seconds
Result: ERROR
Output:

Redirect to /build/tmp.KFNVwA9umN and /build/tmp.M9nJfHxyNU
Tree base:
77e2d4df37270 ("drivers/perf: riscv-iommu: add risc-v iommu pmu driver")
Building the whole tree with the patch
error:
/build/tmphmvs9u73/drivers/perf/riscv_iommu_pmu.c:184:16: error: implicit declaration of function 'cpumap_print_to_pagebuf'; did you mean 'cpumap_print_list_to_buf'? [-Wimplicit-function-declaration]



real	17m19.402s
user	679m19.337s
sys	107m33.241s

@linux-riscv-bot

Copy link
Copy Markdown
Author

Patch 2: "[v6,2/2] iommu/riscv: create a auxiliary device for HPM"
build-rv64-nommu-k210-defconfig
Desc: Builds riscv64 defconfig with NOMMU for K210
Duration: 29.17 seconds
Result: PASS

@linux-riscv-bot

Copy link
Copy Markdown
Author

Patch 2: "[v6,2/2] iommu/riscv: create a auxiliary device for HPM"
build-rv64-nommu-k210-virt
Desc: Builds riscv64 defconfig with NOMMU for the virt platform
Duration: 30.87 seconds
Result: PASS

@linux-riscv-bot

Copy link
Copy Markdown
Author

Patch 2: "[v6,2/2] iommu/riscv: create a auxiliary device for HPM"
checkpatch
Desc: Runs checkpatch.pl on the patch
Duration: 0.99 seconds
Result: PASS

@linux-riscv-bot

Copy link
Copy Markdown
Author

Patch 2: "[v6,2/2] iommu/riscv: create a auxiliary device for HPM"
dtb-warn-rv64
Desc: Checks for Device Tree warnings/errors
Duration: 89.47 seconds
Result: PASS

@linux-riscv-bot

Copy link
Copy Markdown
Author

Patch 2: "[v6,2/2] iommu/riscv: create a auxiliary device for HPM"
header-inline
Desc: Detects static functions without inline keyword in header files
Duration: 0.61 seconds
Result: PASS

@linux-riscv-bot

Copy link
Copy Markdown
Author

Patch 2: "[v6,2/2] iommu/riscv: create a auxiliary device for HPM"
kdoc
Desc: Detects for kdoc errors
Duration: 0.80 seconds
Result: PASS

@linux-riscv-bot

Copy link
Copy Markdown
Author

Patch 2: "[v6,2/2] iommu/riscv: create a auxiliary device for HPM"
module-param
Desc: Detect module_param changes
Duration: 0.25 seconds
Result: PASS

@linux-riscv-bot

Copy link
Copy Markdown
Author

Patch 2: "[v6,2/2] iommu/riscv: create a auxiliary device for 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 2: "[v6,2/2] iommu/riscv: create a auxiliary device for HPM"
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 pw1150555 branch August 28, 2026 13:44
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.

2 participants