Skip to content

mstatus MPRV misbehavior when mret with MPP<M MPRV=1 #760

@HaoyuanLiuHZPH

Description

@HaoyuanLiuHZPH

Describe the bug
When MRET with mstatus MPP<M and MPRV=1, in this case, MPP=U: "An MRET or SRET instruction that changes the privilege mode to a mode less privileged than M also sets MPRV=0."- 3.1. Machine-Level CSRs | Page 35 The RISC-V Instruction Set Manual, Volume II

Image Image Therefore, in gem5 bit 17(MPRV) of mstatus should be 0 instead of 1.

To Reproduce
Try bin file /nfs/home/liuhaoyuan/GEM5/img_file/seeds_998_.img

Expected behavior
Difftest fail

Necessary information on versions

  • XS-GEM5 version: [fix-mstatus]
  • NEMU version used as reference design: [newest ]

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions