You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Mar 7, 2024. It is now read-only.
As mentioned in the issue I've posted about the privileged manual: riscv/riscv-isa-manual#832, mstatus.FS and mstatus.VS cannot actually be used to disable supervisor-mode access to floating point and vector state, because the two fields are aliases of sstatus.FS and sstatus.VS, and thus supervisor mode can turn these state on even if they are turned off in mstatus.
This differs from the requirements of mstateenN, which actually disables access in supervisor mode. This presents a problem with emulating the hypervisor extension in machine mode. As mentioned in the Smstateen spec, supporting emulation of the hypervisor extension is a goal of Smstateen:
Recall that the main reason the mstateen CSRs must exist is so machine level can emulate the hypervisor extension. When machine level isn’t emulating the hypervisor extension, it is likely there will be no need to keep any implemented mstateen bits zero.
But since neither mstatus nor mstateen controls supervisor mode FS and VS, in case the hypervisor extension emulated, all states except FS and VS in emulated-VS-mode can be controlled by an emulated-HS-mode hypervisor. The hypervisor extension does however mandate such control with HS-level sstatus.{FS,VS}. Please see linked privileged spec issue for why I think it is not possible to completely emulate the behavior of (HS-level) sstatus.FS and vsstatus.FS, even if machine mode software is aware of FS and VS.
Since that issue had not received any replies at time of writing this issue, I'm not sure if my analysis is correct, but I am pretty confident about it. Is it possible to fix it with Smstateen so at least future implementations allow full emulation of the hypervisor extension?
The text was updated successfully, but these errors were encountered:
dramforever
changed the title
Controlling access to floating point and vector state in machine mode
Controlling access to floating point and vector state from machine mode
Aug 3, 2022
Sign up for freeto subscribe to this conversation on GitHub.
Already have an account?
Sign in.
As mentioned in the issue I've posted about the privileged manual: riscv/riscv-isa-manual#832,
mstatus.FS
andmstatus.VS
cannot actually be used to disable supervisor-mode access to floating point and vector state, because the two fields are aliases ofsstatus.FS
andsstatus.VS
, and thus supervisor mode can turn these state on even if they are turned off inmstatus
.This differs from the requirements of
mstateenN
, which actually disables access in supervisor mode. This presents a problem with emulating the hypervisor extension in machine mode. As mentioned in the Smstateen spec, supporting emulation of the hypervisor extension is a goal of Smstateen:But since neither
mstatus
normstateen
controls supervisor mode FS and VS, in case the hypervisor extension emulated, all states except FS and VS in emulated-VS-mode can be controlled by an emulated-HS-mode hypervisor. The hypervisor extension does however mandate such control with HS-levelsstatus.{FS,VS}
. Please see linked privileged spec issue for why I think it is not possible to completely emulate the behavior of (HS-level)sstatus.FS
andvsstatus.FS
, even if machine mode software is aware of FS and VS.Since that issue had not received any replies at time of writing this issue, I'm not sure if my analysis is correct, but I am pretty confident about it. Is it possible to fix it with Smstateen so at least future implementations allow full emulation of the hypervisor extension?
The text was updated successfully, but these errors were encountered: