Skip to content

[PW_SID:964831] riscv: hwprobe: Fix stale vDSO data for late-initialized keys at boot#428

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

[PW_SID:964831] riscv: hwprobe: Fix stale vDSO data for late-initialized keys at boot#428
linux-riscv-bot wants to merge 1 commit into
workflow__riscv__fixesfrom
pw964831

Conversation

@linux-riscv-bot
Copy link
Copy Markdown

PR for series 964831 applied to workflow__riscv__fixes

Name: riscv: hwprobe: Fix stale vDSO data for late-initialized keys at boot
URL: https://patchwork.kernel.org/project/linux-riscv/list/?series=964831
Version: 1

The riscv_hwprobe vDSO data is populated by init_hwprobe_vdso_data(),
an arch_initcall_sync. However, underlying data for some keys, like
RISCV_HWPROBE_KEY_MISALIGNED_VECTOR_PERF, is determined asynchronously.

Specifically, the per_cpu(vector_misaligned_access, cpu) values are set
by the vec_check_unaligned_access_speed_all_cpus kthread. This kthread
is spawned by an earlier arch_initcall (check_unaligned_access_all_cpus)
and may complete its benchmark *after* init_hwprobe_vdso_data() has
already populated the vDSO with default/stale values.

This patch introduces riscv_hwprobe_vdso_sync(sync_key). This function
is now called by the vec_check_unaligned_access_speed_all_cpus kthread
upon its completion. It re-evaluates the specified key using current kernel
state (including the finalized per-CPU data) via hwprobe_one_pair()
and updates the corresponding entry in vdso_k_arch_data.

This ensures the vDSO accurately reflects the final boot-time values
for keys determined by such asynchronous boot tasks, resolving observed
inconsistencies when userspace starts.

Test by comparing vDSO and syscall results for affected keys
(e.g., MISALIGNED_VECTOR_PERF), which now match their final
boot-time values.

Reported-by: Tsukasa OI <research_trasio@irq.a4lg.com>
Closes: https://lore.kernel.org/linux-riscv/760d637b-b13b-4518-b6bf-883d55d44e7f@irq.a4lg.com/
Signed-off-by: Jingwei Wang <wangjingwei@iscas.ac.cn>
Signed-off-by: Linux RISC-V bot <linux.riscv.bot@gmail.com>
@linux-riscv-bot
Copy link
Copy Markdown
Author

Patch 1: "riscv: hwprobe: Fix stale vDSO data for late-initialized keys at boot"
build-rv32-defconfig
Desc: Builds riscv32 defconfig
Duration: 106.25 seconds
Result: PASS

@linux-riscv-bot
Copy link
Copy Markdown
Author

Patch 1: "riscv: hwprobe: Fix stale vDSO data for late-initialized keys at boot"
build-rv64-clang-allmodconfig
Desc: Builds riscv64 allmodconfig with Clang, and checks for errors and added warnings
Duration: 1020.23 seconds
Result: PASS

@linux-riscv-bot
Copy link
Copy Markdown
Author

Patch 1: "riscv: hwprobe: Fix stale vDSO data for late-initialized keys at boot"
build-rv64-gcc-allmodconfig
Desc: Builds riscv64 allmodconfig with GCC, and checks for errors and added warnings
Duration: 1323.89 seconds
Result: PASS

@linux-riscv-bot
Copy link
Copy Markdown
Author

Patch 1: "riscv: hwprobe: Fix stale vDSO data for late-initialized keys at boot"
build-rv64-nommu-k210-defconfig
Desc: Builds riscv64 defconfig with NOMMU for K210
Duration: 20.55 seconds
Result: PASS

@linux-riscv-bot
Copy link
Copy Markdown
Author

Patch 1: "riscv: hwprobe: Fix stale vDSO data for late-initialized keys at boot"
build-rv64-nommu-k210-virt
Desc: Builds riscv64 defconfig with NOMMU for the virt platform
Duration: 21.64 seconds
Result: PASS

@linux-riscv-bot
Copy link
Copy Markdown
Author

Patch 1: "riscv: hwprobe: Fix stale vDSO data for late-initialized keys at boot"
checkpatch
Desc: Runs checkpatch.pl on the patch
Duration: 1.14 seconds
Result: PASS

@linux-riscv-bot
Copy link
Copy Markdown
Author

Patch 1: "riscv: hwprobe: Fix stale vDSO data for late-initialized keys at boot"
dtb-warn-rv64
Desc: Checks for Device Tree warnings/errors
Duration: 68.01 seconds
Result: PASS

@linux-riscv-bot
Copy link
Copy Markdown
Author

Patch 1: "riscv: hwprobe: Fix stale vDSO data for late-initialized keys at boot"
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 1: "riscv: hwprobe: Fix stale vDSO data for late-initialized keys at boot"
kdoc
Desc: Detects for kdoc errors
Duration: 0.89 seconds
Result: PASS

@linux-riscv-bot
Copy link
Copy Markdown
Author

Patch 1: "riscv: hwprobe: Fix stale vDSO data for late-initialized keys at boot"
module-param
Desc: Detect module_param changes
Duration: 2.42 seconds
Result: PASS

@linux-riscv-bot
Copy link
Copy Markdown
Author

Patch 1: "riscv: hwprobe: Fix stale vDSO data for late-initialized keys at boot"
verify-fixes
Desc: Verifies that the Fixes: tags exist
Duration: 0.23 seconds
Result: PASS

@linux-riscv-bot
Copy link
Copy Markdown
Author

Patch 1: "riscv: hwprobe: Fix stale vDSO data for late-initialized keys at boot"
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 pw964831 branch May 22, 2025 08:23
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