riscv / riscv-j-extension

Working Draft of the RISC-V J Extension Specification
https://jira.riscv.org/browse/RVG-128
Creative Commons Attribution 4.0 International
161 stars 18 forks source link

Questions about hstatus.HUPMM #81

Open sealman-Kuo opened 3 weeks ago

sealman-Kuo commented 3 weeks ago

Hi, I have some questions about hstatus.HUPMM.

The spec states, "The hypervisor should copy the value written to senvcfg.PMM by the guest to the hstatus.HUPMM field prior to invoking HLV. or HSV. instructions in U-mode."

Is this a mandatory requirement, or just a recommendation? If it is mandatory, then senvcfg.PMM and hstatus.HUPMM would always be equal. Why does VU mode access for HLV and HSV. in U mode require adding the hstatus.HUPMM field, but VS mode access for these instructions in U mode can directly use the henvcfg.PMM setting?

martinmaas commented 1 week ago

This is only a recommendation how software may manage these registers. A hypervisor is free to ignore this recommendation, but it is unclear how HLV. and HSV. instructions would be used in this case.