qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/2] target/riscv: Allow software access to MIP SEIP
@ 2022-03-15  6:40 Alistair Francis
  2022-03-15  6:40 ` [PATCH 1/2] target/riscv: cpu: Fixup indentation Alistair Francis
  2022-03-15  6:40 ` [PATCH 2/2] target/riscv: Allow software access to MIP SEIP Alistair Francis
  0 siblings, 2 replies; 6+ messages in thread
From: Alistair Francis @ 2022-03-15  6:40 UTC (permalink / raw)
  To: qemu-devel, qemu-riscv
  Cc: Palmer Dabbelt, alistair23, Bin Meng, bmeng.cn, Alistair Francis

From: Alistair Francis <alistair.francis@wdc.com>

The RISC-V specification states that:
  "Supervisor-level external interrupts are made pending based on the
  logical-OR of the software-writable SEIP bit and the signal from the
  external interrupt controller."

We currently only allow either the interrupt controller or software to
set the bit, which is incorrect.

This patch removes the miclaim mask when writing MIP to allow M-mode
software to inject interrupts, even with an interrupt controller.

We then also need to keep track of which source is setting MIP_SEIP. The
final value is a OR of both, so we add two bools and use that to keep
track of the current state. This way either source can change without
loosing the correct value.

This fixes: https://gitlab.com/qemu-project/qemu/-/issues/904

Alistair Francis (2):
  target/riscv: cpu: Fixup indentation
  target/riscv: Allow software access to MIP SEIP

 target/riscv/cpu.h |  8 ++++++++
 target/riscv/cpu.c | 16 ++++++++++++----
 target/riscv/csr.c |  8 ++++++--
 3 files changed, 26 insertions(+), 6 deletions(-)

-- 
2.35.1



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

end of thread, other threads:[~2022-03-15 15:02 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-03-15  6:40 [PATCH 0/2] target/riscv: Allow software access to MIP SEIP Alistair Francis
2022-03-15  6:40 ` [PATCH 1/2] target/riscv: cpu: Fixup indentation Alistair Francis
2022-03-15  7:29   ` Bin Meng
2022-03-15 14:59   ` Weiwei Li
2022-03-15  6:40 ` [PATCH 2/2] target/riscv: Allow software access to MIP SEIP Alistair Francis
2022-03-15  8:51   ` Bin Meng

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