]> www.infradead.org Git - users/jedix/linux-maple.git/commit
riscv: Add ghostwrite vulnerability
authorCharlie Jenkins <charlie@rivosinc.com>
Thu, 14 Nov 2024 02:21:20 +0000 (18:21 -0800)
committerPalmer Dabbelt <palmer@rivosinc.com>
Sat, 18 Jan 2025 20:33:39 +0000 (12:33 -0800)
commit4bf97069239bcfca9840936313c7ac35a6e04488
tree32084ed1af940bb069b25c8bb58c855212cff94c
parentc384c5d4a2aed5b6a10de1fcc2f5b46ad4aeeea8
riscv: Add ghostwrite vulnerability

Follow the patterns of the other architectures that use
GENERIC_CPU_VULNERABILITIES for riscv to introduce the ghostwrite
vulnerability and mitigation. The mitigation is to disable all vector
which is accomplished by clearing the bit from the cpufeature field.

Ghostwrite only affects thead c9xx CPUs that impelment xtheadvector, so
the vulerability will only be mitigated on these CPUs.

Signed-off-by: Charlie Jenkins <charlie@rivosinc.com>
Tested-by: Yangyu Chen <cyy@cyyself.name>
Link: https://lore.kernel.org/r/20241113-xtheadvector-v11-14-236c22791ef9@rivosinc.com
Signed-off-by: Palmer Dabbelt <palmer@rivosinc.com>
arch/riscv/Kconfig.errata
arch/riscv/errata/thead/errata.c
arch/riscv/include/asm/bugs.h [new file with mode: 0644]
arch/riscv/include/asm/errata_list.h
arch/riscv/kernel/Makefile
arch/riscv/kernel/bugs.c [new file with mode: 0644]
arch/riscv/kernel/cpufeature.c
drivers/base/cpu.c
include/linux/cpu.h