Closed AyoubJalali closed 1 week ago
Hmm, I am responsible for this behavior. The MPP field is supposed to hold the previous privilege mode before a trap. So to me it felt clear that without the RVH extension, the core cannot support the H privilege mode. After double checking, the H privilege mode is specified as reserved in the risc-v spec.
Maybe I misunderstood something but it seems as if MPP should not accept PRIV_LEVEL_HS if the hypervisor mode is not enabled, which is the current behavior in the RTL.
Oh I understand the issue now. There are a few parts to this:
mstatus_d.mpp
should not be set to user mode, but rather to the previous MPP value mstatus_q.mpp
. Hello @Moschn, the bug is still there, you fix a part of it, because the code shown still there, you'll find it in here this also need fix
@AyoubJalali I am preparing a fix, to be reviewed by both of you
@AyoubJalali you are correct. I tried to fix it in #2284.
@JeanRochCoulon Oh, I saw your message too late. Feel free to close my PR and use yours.
2285 should fix the issue. @AyoubJalali ?
LGTM
Is there an existing CVA6 bug for this?
Bug Description
Hello, This is a RTL issue related to mstatus's field mpp, according to the CV32A65X Spec, mpp flied is a WARL that can hold only the value 3'h11 (PRIV_LVL_M), after debugging the RTL Code coverage I have a coverage condition that should not be covered in our configuration :
that means that the mpp hold the value 3'h10 (PRIV_LVL_HS), that's a bug in the cv32a65x, also the hole code
seems weird, how can test if mpp == PRIV_LVL_HS if we don't support Hypervisor mode.
this code was added by the PR #2035