riscv: Fix enabling cbo.zero when running in M-mode
authorSamuel Holland <samuel.holland@sifive.com>
Wed, 28 Feb 2024 06:55:33 +0000 (22:55 -0800)
committerPalmer Dabbelt <palmer@rivosinc.com>
Thu, 29 Feb 2024 18:20:16 +0000 (10:20 -0800)
commit3fb3f7164edc467450e650dca51dbe4823315a56
tree0389030fbd3a9d8adf5b9448c55115caa05b6603
parent6613476e225e090cc9aad49be7fa504e290dd33d
riscv: Fix enabling cbo.zero when running in M-mode

When the kernel is running in M-mode, the CBZE bit must be set in the
menvcfg CSR, not in senvcfg.

Cc: <stable@vger.kernel.org>
Fixes: 43c16d51a19b ("RISC-V: Enable cbo.zero in usermode")
Reviewed-by: Andrew Jones <ajones@ventanamicro.com>
Signed-off-by: Samuel Holland <samuel.holland@sifive.com>
Reviewed-by: Conor Dooley <conor.dooley@microchip.com>
Link: https://lore.kernel.org/r/20240228065559.3434837-2-samuel.holland@sifive.com
Signed-off-by: Palmer Dabbelt <palmer@rivosinc.com>
arch/riscv/include/asm/csr.h
arch/riscv/kernel/cpufeature.c