qemu-riscv.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v3 0/4] target/riscv: Add Smrnmi support.
@ 2023-05-22 13:11 Tommy Wu
  2023-05-22 13:11 ` [PATCH v3 1/4] target/riscv: Add Smrnmi cpu extension Tommy Wu
                   ` (3 more replies)
  0 siblings, 4 replies; 10+ messages in thread
From: Tommy Wu @ 2023-05-22 13:11 UTC (permalink / raw)
  To: qemu-devel, qemu-riscv
  Cc: frank.chang, palmer, alistair.francis, bin.meng, liweiwei,
	dbarboza, zhiwei_liu, richard.henderson, Tommy Wu

This patchset added support for Smrnmi Extension in RISC-V.

There are four new CSRs and one new instruction added to allow NMI to be
resumable in RISC-V, which are:

=============================================================
  * mnscratch (0x740)
  * mnepc     (0x741)
  * mncause   (0x742)
  * mnstatus  (0x744)
=============================================================
  * mnret: To return from RNMI interrupt/exception handler.
=============================================================

RNMI also has higher priority than any other interrupts or exceptions
and cannot be disabled by software.

RNMI may be used to route to other devices such as Bus Error Unit or
Watchdog Timer in the future.

The interrupt/exception trap handler addresses of RNMI are
implementation defined.

Changelog:

v3
  * Update to the newest version of Smrnmi extension specification.

v2
  * split up the series into more commits for convenience of review.
  * add missing rnmi_irqvec and rnmi_excpvec properties to riscv_harts.

Tommy Wu (4):
  target/riscv: Add Smrnmi cpu extension.
  target/riscv: Add Smrnmi CSRs.
  target/riscv: Handle Smrnmi interrupt and exception.
  target/riscv: Add Smrnmi mnret instruction.

 hw/riscv/riscv_hart.c                         | 21 +++++
 include/hw/riscv/riscv_hart.h                 |  4 +
 target/riscv/cpu.c                            | 19 +++++
 target/riscv/cpu.h                            | 11 +++
 target/riscv/cpu_bits.h                       | 23 +++++
 target/riscv/cpu_helper.c                     | 84 +++++++++++++++++--
 target/riscv/csr.c                            | 82 ++++++++++++++++++
 target/riscv/helper.h                         |  1 +
 target/riscv/insn32.decode                    |  3 +
 .../riscv/insn_trans/trans_privileged.c.inc   | 12 +++
 target/riscv/op_helper.c                      | 51 +++++++++++
 11 files changed, 306 insertions(+), 5 deletions(-)

-- 
2.31.1



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

end of thread, other threads:[~2023-06-08  7:13 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-05-22 13:11 [PATCH v3 0/4] target/riscv: Add Smrnmi support Tommy Wu
2023-05-22 13:11 ` [PATCH v3 1/4] target/riscv: Add Smrnmi cpu extension Tommy Wu
2023-05-25 12:29   ` Daniel Henrique Barboza
2023-06-08  7:12     ` Tommy Wu
2023-05-22 13:11 ` [PATCH v3 2/4] target/riscv: Add Smrnmi CSRs Tommy Wu
2023-05-25 12:30   ` Daniel Henrique Barboza
2023-05-22 13:11 ` [PATCH v3 3/4] target/riscv: Handle Smrnmi interrupt and exception Tommy Wu
2023-05-25 12:41   ` Daniel Henrique Barboza
2023-05-22 13:11 ` [PATCH v3 4/4] target/riscv: Add Smrnmi mnret instruction Tommy Wu
2023-05-25 12:50   ` Daniel Henrique Barboza

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).