mbox series

[0/2] target/riscv: Fix mstatus.MPP related support

Message ID 20230330135818.68417-1-liweiwei@iscas.ac.cn (mailing list archive)
Headers show
Series target/riscv: Fix mstatus.MPP related support | expand

Message

Weiwei Li March 30, 2023, 1:58 p.m. UTC
This patchset tries to fix some problems in current implementation for mstatus.MPP.
- set to the least-privileged supported mode (U if U-mode is implemented, else M) after executing mret
- legalize mpp when write to mstatus

The port is available here:
https://github.com/plctlab/plct-qemu/tree/plct-mpp-fix

Weiwei Li (2):
  target/riscv: Fix the mstatus.MPP value after executing MRET
  target/riscv: Legalize MPP value in write_mstatus

 target/riscv/cpu_helper.c |  5 +----
 target/riscv/csr.c        | 14 ++++++++++++++
 target/riscv/op_helper.c  |  3 ++-
 3 files changed, 17 insertions(+), 5 deletions(-)