Skip to content

[PW_SID:1127847] KVM: riscv: Fix Spectre-v1 in vector register access#2287

Open
linux-riscv-bot wants to merge 3 commits into
workflow__riscv__fixesfrom
pw1127847
Open

[PW_SID:1127847] KVM: riscv: Fix Spectre-v1 in vector register access#2287
linux-riscv-bot wants to merge 3 commits into
workflow__riscv__fixesfrom
pw1127847

Conversation

@linux-riscv-bot

Copy link
Copy Markdown

PR for series 1127847 applied to workflow__riscv__fixes

Name: KVM: riscv: Fix Spectre-v1 in vector register access
URL: https://patchwork.kernel.org/project/linux-riscv/list/?series=1127847
Version: 1

Paul Sherman and others added 3 commits July 14, 2026 19:39
setup_smp() calls set_cpu_possible() for CPUs 1..nr_cpu_ids-1 but
never for CPU 0 (the boot CPU). x86 handles this via
init_cpu_possible(cpumask_of(0)); RISC-V has no equivalent.

Without CPU 0 in cpu_possible_mask, rcu_init_one()'s
for_each_possible_cpu() loop skips it, leaving rdp->mynode=NULL.
rcutree_prepare_cpu() then dereferences NULL and hangs.

Exposed on Sophgo SG2042 (64-hart, 4-NUMA) with Linux 7.2-rc3.

Cc: stable@vger.kernel.org
Fixes: a4166ae ("riscv: Deduplicate code in setup_smp()")
Signed-off-by: Paul Sherman <shermanpauldylan@gmail.com>
Link: https://patch.msgid.link/20260714223301.5265-1-shermanpauldylan@gmail.com
Signed-off-by: Paul Walmsley <pjw@kernel.org>
User-controlled register indices from the ONE_REG ioctl are used to
index into the vector register buffer (v0..v31). Sanitize the calculated
offset with array_index_nospec() to prevent speculative out-of-bounds
access.

Signed-off-by: Zongmin Zhou <zhouzongmin@kylinos.cn>
Signed-off-by: Linux RISC-V bot <linux.riscv.bot@gmail.com>
@linux-riscv-bot

Copy link
Copy Markdown
Author

Patch 1: "KVM: riscv: Fix Spectre-v1 in vector register access"
build-rv32-defconfig
Desc: Builds riscv32 defconfig
Duration: 142.57 seconds
Result: PASS

@linux-riscv-bot

Copy link
Copy Markdown
Author

Patch 1: "KVM: riscv: Fix Spectre-v1 in vector register access"
build-rv64-clang-allmodconfig
Desc: Builds riscv64 allmodconfig with Clang, and checks for errors and added warnings
Duration: 1128.62 seconds
Result: PASS

@linux-riscv-bot

Copy link
Copy Markdown
Author

Patch 1: "KVM: riscv: Fix Spectre-v1 in vector register access"
build-rv64-gcc-allmodconfig
Desc: Builds riscv64 allmodconfig with GCC, and checks for errors and added warnings
Duration: 1448.02 seconds
Result: PASS

@linux-riscv-bot

Copy link
Copy Markdown
Author

Patch 1: "KVM: riscv: Fix Spectre-v1 in vector register access"
build-rv64-nommu-k210-defconfig
Desc: Builds riscv64 defconfig with NOMMU for K210
Duration: 26.67 seconds
Result: PASS

@linux-riscv-bot

Copy link
Copy Markdown
Author

Patch 1: "KVM: riscv: Fix Spectre-v1 in vector register access"
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 1: "KVM: riscv: Fix Spectre-v1 in vector register access"
checkpatch
Desc: Runs checkpatch.pl on the patch
Duration: 1.66 seconds
Result: WARNING
Output:

CHECK: Lines should not end with a '('
#46: FILE: arch/riscv/kvm/vcpu_vector.c:144:
+		reg_offset = array_index_nospec(

total: 0 errors, 0 warnings, 1 checks, 29 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 a89a6ff949fb ("KVM: riscv: Fix Spectre-v1 in vector register access") 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, 0 warnings, 1 checks, 29 lines checked
CHECK: Lines should not end with a '('


@linux-riscv-bot

Copy link
Copy Markdown
Author

Patch 1: "KVM: riscv: Fix Spectre-v1 in vector register access"
dtb-warn-rv64
Desc: Checks for Device Tree warnings/errors
Duration: 87.37 seconds
Result: PASS

@linux-riscv-bot

Copy link
Copy Markdown
Author

Patch 1: "KVM: riscv: Fix Spectre-v1 in vector register access"
header-inline
Desc: Detects static functions without inline keyword in header files
Duration: 4.72 seconds
Result: PASS

@linux-riscv-bot

Copy link
Copy Markdown
Author

Patch 1: "KVM: riscv: Fix Spectre-v1 in vector register access"
kdoc
Desc: Detects for kdoc errors
Duration: 1.32 seconds
Result: PASS

@linux-riscv-bot

Copy link
Copy Markdown
Author

Patch 1: "KVM: riscv: Fix Spectre-v1 in vector register access"
module-param
Desc: Detect module_param changes
Duration: 0.48 seconds
Result: PASS

@linux-riscv-bot

Copy link
Copy Markdown
Author

Patch 1: "KVM: riscv: Fix Spectre-v1 in vector register access"
verify-fixes
Desc: Verifies that the Fixes: tags exist
Duration: 0.30 seconds
Result: PASS

@linux-riscv-bot

Copy link
Copy Markdown
Author

Patch 1: "KVM: riscv: Fix Spectre-v1 in vector register access"
verify-signedoff
Desc: Verifies that Signed-off-by: tags are correct
Duration: 0.31 seconds
Result: PASS

@linux-riscv-bot
linux-riscv-bot force-pushed the workflow__riscv__fixes branch 4 times, most recently from 60e0882 to 36eafdd Compare July 21, 2026 01:54
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