Merge patch series "riscv: cbo.zero fixes"
authorPalmer Dabbelt <palmer@rivosinc.com>
Thu, 29 Feb 2024 18:20:19 +0000 (10:20 -0800)
committerPalmer Dabbelt <palmer@rivosinc.com>
Thu, 29 Feb 2024 18:20:19 +0000 (10:20 -0800)
commite2b6bc28ec45e2670da4f0c719f9de101bf22bc6
tree4ac63cfd919ab913dda065b8e20f47435bbf6c84
parent34b567868777e9fd39ec5333969728a7f0cf179c
parent05ab803d1ad8ac505ade77c6bd3f86b1b4ea0dc4
Merge patch series "riscv: cbo.zero fixes"

Samuel Holland <samuel.holland@sifive.com> says:

This series fixes a couple of issues related to using the cbo.zero
instruction in userspace. The first patch fixes a bug where the wrong
enable bit gets set if the kernel is running in M-mode. The remaining
patches fix a bug where the enable bit gets reset to its default value
after a nonretentive idle state. I have hardware which reproduces this:

Before this series:
  $ tools/testing/selftests/riscv/hwprobe/cbo
  TAP version 13
  1..3
  ok 1 Zicboz block size
  # Zicboz block size: 64
  Illegal instruction

After applying this series:
  $ tools/testing/selftests/riscv/hwprobe/cbo
  TAP version 13
  1..3
  ok 1 Zicboz block size
  # Zicboz block size: 64
  ok 2 cbo.zero
  ok 3 cbo.zero check
  # Totals: pass:3 fail:0 xfail:0 xpass:0 skip:0 error:0

* b4-shazam-merge:
  riscv: Save/restore envcfg CSR during CPU suspend
  riscv: Add a custom ISA extension for the [ms]envcfg CSR
  riscv: Fix enabling cbo.zero when running in M-mode

Link: https://lore.kernel.org/r/20240228065559.3434837-1-samuel.holland@sifive.com
Signed-off-by: Palmer Dabbelt <palmer@rivosinc.com>
arch/riscv/kernel/cpufeature.c