Hypervisor Extension, Version 0.4を読んだ
The hypervisor extension is enabled by setting bit 7 in the misa CSR,
misa CSRの7bitめで有効にできるよ
5.2 Hypervisor CSRs
VS-mode guestのmanageとtwo-level address transitionにこれらが使われます
hstatus
mstatusににやたつです. exception の振る舞いについてcontrolとtrackするよ
hstatus register provides facilities analogous to the mstatus register that track and control the exception behavior of a VS-mode guest.
SPRV
SP2V
ネスト用?
SP2P
ネスト用?
STL
SPV
trap前のvirtualization modeを表す( supervisor previous virtualization-mode)
VTVM
VTW
VTSR
hedeleg
hideleg
hgatp.
HS-mode用のCSRはそれぞれついかされる
background CSRがforeground CSRからコピーされる
When transitioning between virtualization modes (V=0 to V=1, or vice-versa), the implementation swaps the background supervisor CSRs with their foreground counterparts.
virtualization modeの以降のタイミングで、foregroundとbackgroudがswapする
V = 0のときの, backgroundが, VS-mode. forgourndがHS-mode
V = 1のときの, backgroundが, HS-mode. forgourndがVS-mode
V = 1 のときに、Two-level transitionするよ
The virtualization mode also indicates whether two level address translation is active (V=1) or inactive (V=0).