public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH -fixes v4 0/3] riscv: cbo.zero fixes
@ 2024-02-28  6:55 Samuel Holland
  2024-02-28  6:55 ` [PATCH -fixes v4 1/3] riscv: Fix enabling cbo.zero when running in M-mode Samuel Holland
                   ` (3 more replies)
  0 siblings, 4 replies; 13+ messages in thread
From: Samuel Holland @ 2024-02-28  6:55 UTC (permalink / raw)
  To: Palmer Dabbelt
  Cc: Andrew Jones, linux-kernel, Conor Dooley, Alexandre Ghiti,
	linux-riscv, Stefan O'Rear, Samuel Holland

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

Changes in v4:
 - Add a patch defining and setting the Xlinuxenvcfg ISA extension bit
 - Check for Xlinuxenvcfg instead of Zicboz

Changes in v3:
 - Drop patches added in v2
 - Check for Zicboz instead of the privileged ISA version

Changes in v2:
 - Add patches to allow parsing the privileged ISA version from the DT
 - Check for privileged ISA v1.12 instead of the specific CSR
 - Use riscv_has_extension_likely() instead of new ALTERNATIVE()s

Samuel Holland (3):
  riscv: Fix enabling cbo.zero when running in M-mode
  riscv: Add a custom ISA extension for the [ms]envcfg CSR
  riscv: Save/restore envcfg CSR during CPU suspend

 arch/riscv/include/asm/csr.h     |  2 ++
 arch/riscv/include/asm/hwcap.h   |  2 ++
 arch/riscv/include/asm/suspend.h |  1 +
 arch/riscv/kernel/cpufeature.c   | 16 +++++++++++++---
 arch/riscv/kernel/suspend.c      |  4 ++++
 5 files changed, 22 insertions(+), 3 deletions(-)

-- 
2.43.1


^ permalink raw reply	[flat|nested] 13+ messages in thread

end of thread, other threads:[~2024-02-29 23:40 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-02-28  6:55 [PATCH -fixes v4 0/3] riscv: cbo.zero fixes Samuel Holland
2024-02-28  6:55 ` [PATCH -fixes v4 1/3] riscv: Fix enabling cbo.zero when running in M-mode Samuel Holland
2024-02-28 10:13   ` Conor Dooley
2024-02-28  6:55 ` [PATCH -fixes v4 2/3] riscv: Add a custom ISA extension for the [ms]envcfg CSR Samuel Holland
2024-02-28 10:12   ` Conor Dooley
2024-02-29 18:23     ` Palmer Dabbelt
2024-02-29 18:30       ` Conor Dooley
2024-02-29 23:40         ` Palmer Dabbelt
2024-02-28 13:23   ` Andrew Jones
2024-02-28  6:55 ` [PATCH -fixes v4 3/3] riscv: Save/restore envcfg CSR during CPU suspend Samuel Holland
2024-02-28 10:14   ` Conor Dooley
2024-02-28 13:27   ` Andrew Jones
2024-02-29 22:10 ` [PATCH -fixes v4 0/3] riscv: cbo.zero fixes patchwork-bot+linux-riscv

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox