Skip to content

RISC-V: Populate mtval and stval

Alistair Francis qemu-devel qemu-riscv 3 versions – Applied

Status from this message: Applied to riscv-to-apply.next

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v4 Latest3 patches 8 repliesApplied
  2. v23 patches 8 repliesSuperseded
  3. v12 patches 4 repliesSuperseded

Patches in v4 Applied

#Subject and filesSizeRepliesApplied
1/3target/riscv: Set the opcode in DisasContexttarget/riscv/translate.c+2 -01 reply
2/3target/riscv: Fixup setting GVAtarget/riscv/cpu_helper.c+6 -154 replies
3/3target/riscv: Implement the stval/mtval illegal instructiontarget/riscv/cpu.h target/riscv/cpu_helper.c target/riscv/translate.c+8 -02 replies

Reviews trailers per patch

All 3 patches have a Reviewed-by or Acked-by.

PatchRichard HendersonBin Meng
1/3R-b R-b
2/3R-b R-b
3/3R-b R-b

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v4 thread

Cover letter [PATCH v4 0/3] RISC-V: Populate mtval and stval

From: Alistair Francis <[email protected]>

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(-)
Signature · 1 line
2.31.1