riscv: Enable generic CPU vulnerabilites support
authorJinjie Ruan <ruanjinjie@huawei.com>
Wed, 3 Jul 2024 02:27:32 +0000 (10:27 +0800)
committerPalmer Dabbelt <palmer@rivosinc.com>
Thu, 15 Aug 2024 00:44:34 +0000 (17:44 -0700)
commit0e3f3649d44bf1b388a7613ade14c29cbdedf075
treecd5bc8fddb6ec66a6aa96edd492550a9404049c3
parentc6ebf2c528470a09be77d0d9df2c6617ea037ac5
riscv: Enable generic CPU vulnerabilites support

Currently x86, ARM and ARM64 support generic CPU vulnerabilites, but
RISC-V not, such as:

# cd /sys/devices/system/cpu/vulnerabilities/
x86:
# cat spec_store_bypass
Mitigation: Speculative Store Bypass disabled via prctl and seccomp
# cat meltdown
Not affected

ARM64:

# cat spec_store_bypass
Mitigation: Speculative Store Bypass disabled via prctl and seccomp
# cat meltdown
Mitigation: PTI

RISC-V:

# cat /sys/devices/system/cpu/vulnerabilities
# ... No such file or directory

As SiFive RISC-V Core IP offerings are not affected by Meltdown and
Spectre, it can use the default weak function as below:

# cat spec_store_bypass
Not affected
# cat meltdown
Not affected

Link: https://www.sifive.cn/blog/sifive-statement-on-meltdown-and-spectre
Signed-off-by: Jinjie Ruan <ruanjinjie@huawei.com>
Link: https://lore.kernel.org/r/20240703022732.2068316-1-ruanjinjie@huawei.com
Signed-off-by: Palmer Dabbelt <palmer@rivosinc.com>
arch/riscv/Kconfig