[PW_SID:964831] riscv: hwprobe: Fix stale vDSO data for late-initialized keys at boot#428
[PW_SID:964831] riscv: hwprobe: Fix stale vDSO data for late-initialized keys at boot#428linux-riscv-bot wants to merge 1 commit into
Conversation
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>
|
Patch 1: "riscv: hwprobe: Fix stale vDSO data for late-initialized keys at boot" |
|
Patch 1: "riscv: hwprobe: Fix stale vDSO data for late-initialized keys at boot" |
|
Patch 1: "riscv: hwprobe: Fix stale vDSO data for late-initialized keys at boot" |
|
Patch 1: "riscv: hwprobe: Fix stale vDSO data for late-initialized keys at boot" |
|
Patch 1: "riscv: hwprobe: Fix stale vDSO data for late-initialized keys at boot" |
|
Patch 1: "riscv: hwprobe: Fix stale vDSO data for late-initialized keys at boot" |
|
Patch 1: "riscv: hwprobe: Fix stale vDSO data for late-initialized keys at boot" |
|
Patch 1: "riscv: hwprobe: Fix stale vDSO data for late-initialized keys at boot" |
|
Patch 1: "riscv: hwprobe: Fix stale vDSO data for late-initialized keys at boot" |
|
Patch 1: "riscv: hwprobe: Fix stale vDSO data for late-initialized keys at boot" |
|
Patch 1: "riscv: hwprobe: Fix stale vDSO data for late-initialized keys at boot" |
|
Patch 1: "riscv: hwprobe: Fix stale vDSO data for late-initialized keys at boot" |
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