All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v1 0/2] target/riscv: Write zero into mtinst/htinst for Zicfiss instructions
@ 2026-11-17 13:26 ` Alvin Chang via qemu development
  0 siblings, 0 replies; 8+ messages in thread
From: Alvin Chang via @ 2026-11-17 13:26 UTC (permalink / raw)
  To: qemu-riscv, qemu-devel
  Cc: alistair.francis, liwei1518, daniel.barboza, zhiwei_liu, chao.liu,
	Alvin Chang

On any trap into M-mode or HS-mode, a zero, or a transformed instruction may be
written automatically into the appropriate trap instruction CSR, mtinst or
htinst. The privileged spec section "Transformed Instruction or
Pseudoinstruction for mtinst or htinst" lists the instructions that may
automatically write a value into mtinst/htinst CSR, and the section also says:
"If a synchronous trap occurs for a standard instruction for which no
transformation has been defined, the trap instruction register shall be written
with zero".

The instructions (SSAMOSWAP, SSPUSH and SSPOPCHK) defined in the Zicfiss
extension are not listed in that section of the privileged spec. Thus, the
mtinst/htinst shall be written with zero for these three instructions.

Alvin Chang (2):
  target/riscv: Write zero into mtinst/htinst for SSAMOSWAP faults
  target/riscv: Write zero into mtinst/htinst for SSPUSH/SSPOPCHK faults

 target/riscv/instmap.h        | 17 ++++++++++++++++-
 target/riscv/tcg/cpu_helper.c | 23 +++++++++++++++++++----
 2 files changed, 35 insertions(+), 5 deletions(-)


base-commit: e9fa1f66f0d47c74b6766e1b8b87ad7c2a9394d5
-- 
2.43.0



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

end of thread, other threads:[~2026-11-20  0:02 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-11-17 13:26 [PATCH v1 0/2] target/riscv: Write zero into mtinst/htinst for Zicfiss instructions Alvin Chang via
2026-11-17 13:26 ` Alvin Chang via qemu development
2026-11-17 13:26 ` [PATCH v1 1/2] target/riscv: Write zero into mtinst/htinst for SSAMOSWAP faults Alvin Chang via
2026-11-17 13:26   ` Alvin Chang via qemu development
2026-11-19 23:53   ` alistair23
2026-11-17 13:26 ` [PATCH v1 2/2] target/riscv: Write zero into mtinst/htinst for SSPUSH/SSPOPCHK faults Alvin Chang via
2026-11-17 13:26   ` Alvin Chang via qemu development
2026-11-20  0:02   ` alistair23

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.