Skip to content

[PW_SID:1072898] RISC-V: restore U-mode counter access (scounteren)#1672

Closed
linux-riscv-bot wants to merge 1 commit into
workflow__riscv__fixesfrom
pw1072898
Closed

[PW_SID:1072898] RISC-V: restore U-mode counter access (scounteren)#1672
linux-riscv-bot wants to merge 1 commit into
workflow__riscv__fixesfrom
pw1072898

Conversation

@linux-riscv-bot
Copy link
Copy Markdown

PR for series 1072898 applied to workflow__riscv__fixes

Name: RISC-V: restore U-mode counter access (scounteren)
URL: https://patchwork.kernel.org/project/linux-riscv/list/?series=1072898
Version: 1

In commit 5bc4097 ("RISC-V: KVM: Remove scounteren initialization")
the initialization of scounteren was moved from the hypervisor (KVM) to
the supervisor -- a well-argued change. However, the same change also
restricted access to performance counters without comment: previously,
scounteren was set to 0x7 (0b111), allowing U-mode (userspace) access
to instret (IR), cycle (CY), and time (TM). After the change,
scounteren is set to 0x2 (0b010), which allows access only to time (TM)
and prohibits access to instret (IR) and cycle (CY). This breaks user-
space programs that directly use these performance counters.

This change restores the prior behavior: scounteren is set to 0x7,
which re-enables U-mode (userspace) access to instret (IR), cycle (CY),
and time (TM).

Fixes: 5bc4097 ("RISC-V: KVM: Remove scounteren initialization")
Signed-off-by: Manfred SCHLAEGL <manfred.schlaegl@gmx.at>
Signed-off-by: Linux RISC-V bot <linux.riscv.bot@gmail.com>
@linux-riscv-bot
Copy link
Copy Markdown
Author

Patch 1: "RISC-V: restore U-mode counter access (scounteren)"
build-rv32-defconfig
Desc: Builds riscv32 defconfig
Duration: 137.32 seconds
Result: PASS

@linux-riscv-bot
Copy link
Copy Markdown
Author

Patch 1: "RISC-V: restore U-mode counter access (scounteren)"
build-rv64-clang-allmodconfig
Desc: Builds riscv64 allmodconfig with Clang, and checks for errors and added warnings
Duration: 1103.56 seconds
Result: PASS

@linux-riscv-bot
Copy link
Copy Markdown
Author

Patch 1: "RISC-V: restore U-mode counter access (scounteren)"
build-rv64-gcc-allmodconfig
Desc: Builds riscv64 allmodconfig with GCC, and checks for errors and added warnings
Duration: 1639.54 seconds
Result: PASS

@linux-riscv-bot
Copy link
Copy Markdown
Author

Patch 1: "RISC-V: restore U-mode counter access (scounteren)"
build-rv64-nommu-k210-defconfig
Desc: Builds riscv64 defconfig with NOMMU for K210
Duration: 26.71 seconds
Result: PASS

@linux-riscv-bot
Copy link
Copy Markdown
Author

Patch 1: "RISC-V: restore U-mode counter access (scounteren)"
build-rv64-nommu-k210-virt
Desc: Builds riscv64 defconfig with NOMMU for the virt platform
Duration: 28.12 seconds
Result: PASS

@linux-riscv-bot
Copy link
Copy Markdown
Author

Patch 1: "RISC-V: restore U-mode counter access (scounteren)"
checkpatch
Desc: Runs checkpatch.pl on the patch
Duration: 0.71 seconds
Result: PASS

@linux-riscv-bot
Copy link
Copy Markdown
Author

Patch 1: "RISC-V: restore U-mode counter access (scounteren)"
dtb-warn-rv64
Desc: Checks for Device Tree warnings/errors
Duration: 84.27 seconds
Result: PASS

@linux-riscv-bot
Copy link
Copy Markdown
Author

Patch 1: "RISC-V: restore U-mode counter access (scounteren)"
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 1: "RISC-V: restore U-mode counter access (scounteren)"
kdoc
Desc: Detects for kdoc errors
Duration: 0.88 seconds
Result: PASS

@linux-riscv-bot
Copy link
Copy Markdown
Author

Patch 1: "RISC-V: restore U-mode counter access (scounteren)"
module-param
Desc: Detect module_param changes
Duration: 0.24 seconds
Result: PASS

@linux-riscv-bot
Copy link
Copy Markdown
Author

Patch 1: "RISC-V: restore U-mode counter access (scounteren)"
verify-fixes
Desc: Verifies that the Fixes: tags exist
Duration: 0.27 seconds
Result: PASS

@linux-riscv-bot
Copy link
Copy Markdown
Author

Patch 1: "RISC-V: restore U-mode counter access (scounteren)"
verify-signedoff
Desc: Verifies that Signed-off-by: tags are correct
Duration: 0.29 seconds
Result: PASS

@linux-riscv-bot linux-riscv-bot deleted the pw1072898 branch April 3, 2026 00:06
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