linux-riscv.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
* [PATCH -fixes v2 0/4] riscv: cbo.zero fixes
@ 2024-02-13  3:37 Samuel Holland
  2024-02-13  3:37 ` [PATCH -fixes v2 1/4] riscv: Fix enabling cbo.zero when running in M-mode Samuel Holland
                   ` (3 more replies)
  0 siblings, 4 replies; 25+ messages in thread
From: Samuel Holland @ 2024-02-13  3:37 UTC (permalink / raw)
  To: Palmer Dabbelt
  Cc: Andrew Jones, linux-riscv, linux-kernel, Stefan O'Rear,
	Samuel Holland

This series fixes a couple issues related to using the cbo.zero
instruction in userspace. The first patches 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 (or without ss1p12 in the devicetree):
  $ 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 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 (4):
  riscv: Fix enabling cbo.zero when running in M-mode
  dt-bindings: riscv: Add ratified privileged ISA versions
  riscv: Add ISA extension parsing for Sm and Ss
  riscv: Save/restore envcfg CSR during CPU suspend

 .../devicetree/bindings/riscv/extensions.yaml | 20 +++++++++
 arch/riscv/include/asm/cpufeature.h           |  1 +
 arch/riscv/include/asm/csr.h                  |  2 +
 arch/riscv/include/asm/hwcap.h                |  8 ++++
 arch/riscv/include/asm/suspend.h              |  1 +
 arch/riscv/kernel/cpu.c                       |  5 +++
 arch/riscv/kernel/cpufeature.c                | 44 ++++++++++++++++---
 arch/riscv/kernel/suspend.c                   |  4 ++
 8 files changed, 79 insertions(+), 6 deletions(-)

-- 
2.43.0


_______________________________________________
linux-riscv mailing list
linux-riscv@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-riscv

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

end of thread, other threads:[~2024-02-18 17:03 UTC | newest]

Thread overview: 25+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-02-13  3:37 [PATCH -fixes v2 0/4] riscv: cbo.zero fixes Samuel Holland
2024-02-13  3:37 ` [PATCH -fixes v2 1/4] riscv: Fix enabling cbo.zero when running in M-mode Samuel Holland
2024-02-13  3:37 ` [PATCH -fixes v2 2/4] dt-bindings: riscv: Add ratified privileged ISA versions Samuel Holland
2024-02-13  8:50   ` Krzysztof Kozlowski
2024-02-13 14:25   ` Andrew Jones
2024-02-15 13:14     ` Conor Dooley
2024-02-16 15:41       ` Stefan O'Rear
2024-02-13 17:03   ` Conor Dooley
2024-02-13 17:07     ` Conor Dooley
2024-02-13 17:42     ` Stefan O'Rear
2024-02-13 18:00       ` Samuel Holland
2024-02-13  3:37 ` [PATCH -fixes v2 3/4] riscv: Add ISA extension parsing for Sm and Ss Samuel Holland
2024-02-13 15:14   ` Andrew Jones
2024-02-13 17:52     ` Stefan O'Rear
2024-02-13 18:18       ` Samuel Holland
2024-02-13 18:07   ` Conor Dooley
2024-02-13 20:22     ` Samuel Holland
2024-02-13 20:43       ` Stefan O'Rear
2024-02-13 23:15         ` Conor Dooley
2024-02-18 15:00           ` Samuel Holland
2024-02-18 17:02             ` Conor Dooley
2024-02-13  3:37 ` [PATCH -fixes v2 4/4] riscv: Save/restore envcfg CSR during CPU suspend Samuel Holland
2024-02-13 14:49   ` Andrew Jones
2024-02-13 17:53     ` Stefan O'Rear
2024-02-18 14:09       ` Samuel Holland

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).