[PATCH v2 0/4] KVM: riscv: Fix Spectre-v1 vulnerabilities in register access
Anup Patel
anup at brainfault.org
Wed Mar 4 03:08:29 PST 2026
On Tue, Mar 3, 2026 at 7:49 PM Lukas Gerlach <lukas.gerlach at cispa.de> wrote:
>
> This series adds array_index_nospec() to RISC-V KVM to prevent
> speculative out-of-bounds access to kernel memory.
>
> Similar fixes exist for x86 (ioapic, lapic, PMU) and arm64 (vgic).
>
> Signed-off-by: Lukas Gerlach <lukas.gerlach at cispa.de>
> ---
> Changes in v2:
> Add array_index_nospec() to four additional sites in vcpu_pmu.c
> (Radim Krčmář)
>
> ---
> Lukas Gerlach (4):
> KVM: riscv: Fix Spectre-v1 in ONE_REG register access
> KVM: riscv: Fix Spectre-v1 in AIA CSR access
> KVM: riscv: Fix Spectre-v1 in floating-point register access
> KVM: riscv: Fix Spectre-v1 in PMU counter access
>
> arch/riscv/kvm/aia.c | 11 +++++++++--
> arch/riscv/kvm/vcpu_fp.c | 17 +++++++++++++----
> arch/riscv/kvm/vcpu_onereg.c | 36 ++++++++++++++++++++++++++++--------
> arch/riscv/kvm/vcpu_pmu.c | 14 +++++++++++---
> 4 files changed, 61 insertions(+), 17 deletions(-)
Queued these patches as fixes for Linux-7.0-rcX
Thanks,
Anup
More information about the linux-riscv
mailing list