riscv-isa-manual icon indicating copy to clipboard operation
riscv-isa-manual copied to clipboard

Unclear dependency relationship between H, S, and U

Open alexrp opened this issue 3 years ago • 4 comments

From a cursory glance through the privileged spec, I gathered that M is required while H, S, and U are optional. What's not clear to me is whether any of the latter 3 modes depend on one another. Intuitively, I would imagine that H depends on S which depends on U, but it isn't explicitly spelled out, so then again, maybe not?

Whatever the case may be, it seems like it might be worth spelling this out explicitly somewhere.

alexrp avatar Oct 02 '22 16:10 alexrp

The legal combinations (which I thought we spelled out are: M MU MUS MUSH

No other combinations are legal as far as I know.

On Sun, Oct 2, 2022 at 9:41 AM Alex Rønne Petersen @.***> wrote:

From a cursory glance through the privileged spec, I gathered that M is required while H, S, and U are optional. What's not clear to me is whether any of the latter 3 modes depend on one another. Intuitively, I would imagine that H depends on S which depends on U, but it isn't explicitly spelled out, so then again, maybe not?

Whatever the case may be, it seems like it might be worth spelling this out explicitly somewhere.

— Reply to this email directly, view it on GitHub https://github.com/riscv/riscv-isa-manual/issues/899, or unsubscribe https://github.com/notifications/unsubscribe-auth/AHPXVJW3562G52V5C6GX4K3WBG3KNANCNFSM6AAAAAAQ27CVWE . You are receiving this because you are subscribed to this thread.Message ID: @.***>

allenjbaum avatar Oct 03 '22 05:10 allenjbaum

There is indeed a table in §1.2 "Privilege Levels" looking similar to that, but there is no mention of how H fits in there. That plus the overall wording in that section led me to believe that the table was only meant as a guideline.

FWIW, I think adding H into the table and renaming the "Supported Modes" column to "Required Modes" (or something to that effect) would make things clearer.

alexrp avatar Oct 03 '22 05:10 alexrp

There is no H mode. There was an old (obsolete) hypervisor spec that had it, but I don't believe anyone ever implemented that.

The current hypervisor spec adds VS and VU modes, and modifies S mode to be HS. This is all explained in the first pages of the hypervisor chapter. Any implementation that supports hypervisor will support all 5 privilege modes. I don't see anything unclear about that.

scottj97 avatar Oct 03 '22 16:10 scottj97

From a cursory glance through the privileged spec

You might want to look at table 1.2 and the text immediately below it, plus the beginning of the hypervisor extension as Scott mentioned.

pdonahue-ventana avatar Oct 03 '22 16:10 pdonahue-ventana

Closing since the information seems to be there and I just missed it.

alexrp avatar Apr 02 '23 15:04 alexrp