qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v4 0/3] RISC-V: Populate mtval and stval
@ 2021-12-20  6:49 Alistair Francis
  2021-12-20  6:49 ` [PATCH v4 1/3] target/riscv: Set the opcode in DisasContext Alistair Francis
                   ` (3 more replies)
  0 siblings, 4 replies; 12+ messages in thread
From: Alistair Francis @ 2021-12-20  6:49 UTC (permalink / raw)
  To: qemu-riscv, qemu-devel
  Cc: Alistair Francis, Palmer Dabbelt, bmeng.cn, alistair23, Bin Meng

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

Populate mtval and stval when taking an illegal instruction exception.

The RISC-V spec states that "The stval register can optionally also be
used to return the faulting instruction bits on an illegal instruction
exception...". In this case we are always writing the value on an
illegal instruction.

This doesn't match all CPUs (some CPUs won't write the data), but in
QEMU let's just populate the value on illegal instructions. This won't
break any guest software, but will provide more information to guests.

Alistair Francis (3):
  target/riscv: Set the opcode in DisasContext
  target/riscv: Fixup setting GVA
  target/riscv: Implement the stval/mtval illegal instruction

 target/riscv/cpu.h        |  2 ++
 target/riscv/cpu_helper.c | 24 +++++++++---------------
 target/riscv/translate.c  |  5 +++++
 3 files changed, 16 insertions(+), 15 deletions(-)

-- 
2.31.1



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

end of thread, other threads:[~2022-01-07  3:35 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2021-12-20  6:49 [PATCH v4 0/3] RISC-V: Populate mtval and stval Alistair Francis
2021-12-20  6:49 ` [PATCH v4 1/3] target/riscv: Set the opcode in DisasContext Alistair Francis
2021-12-21  7:08   ` Bin Meng
2021-12-20  6:49 ` [PATCH v4 2/3] target/riscv: Fixup setting GVA Alistair Francis
2021-12-20 19:38   ` Richard Henderson
2021-12-21  7:30   ` Bin Meng
2022-01-06  4:04     ` Alistair Francis
2022-01-07  2:07       ` Bin Meng
2021-12-20  6:49 ` [PATCH v4 3/3] target/riscv: Implement the stval/mtval illegal instruction Alistair Francis
2021-12-20 19:39   ` Richard Henderson
2021-12-21  7:46   ` Bin Meng
2022-01-07  3:33 ` [PATCH v4 0/3] RISC-V: Populate mtval and stval Alistair Francis

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