riscv: Save/restore envcfg CSR during CPU suspend
authorSamuel Holland <samuel.holland@sifive.com>
Wed, 28 Feb 2024 06:55:35 +0000 (22:55 -0800)
committerPalmer Dabbelt <palmer@rivosinc.com>
Thu, 29 Feb 2024 18:20:18 +0000 (10:20 -0800)
commit05ab803d1ad8ac505ade77c6bd3f86b1b4ea0dc4
treed8b4e6641bbc4ccdcdee992a84b84f0fb46c5293
parent4774848fef6041716a4883217eb75f6b10eb183b
riscv: Save/restore envcfg CSR during CPU suspend

The value of the [ms]envcfg CSR is lost when entering a nonretentive
idle state, so the CSR must be rewritten when resuming the CPU.

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