First proposal for H-extension support for RISC-V Worlds.#19
First proposal for H-extension support for RISC-V Worlds.#19ruuddw wants to merge 1 commit intoriscv:mainfrom
Conversation
Signed-off-by: Ruud Derwig <Ruud.Derwig@synopsys.com>
andrewdellow
left a comment
There was a problem hiding this comment.
I was wondering why you added hlwid and vslwid - I was expecting just the addition of hlwid, such that
S (no H extension) or HS (with H extension) transactions are tagged with mlwid,
When H is supported and V = 1, VS transactions tagged with hlwid
U/VU transactions tagged with slwid
I then suppose that when H is enabled, mwiddeleg then applies to hlwid, instead of slwid, and we need another CSR set from HS :– hwiddeleg that applies to slwid ?
|
Right, the vslwid is a bit special. It's like other "vs" registers introduced by the H extension:
Rationale for it is in the PoW, probably a note should be added in this spec to explain as well. This is the relevant PoW rationale bullet:
If the hypervisor could always reprogram the WID to be used for VU (also when the hypervisor itself needs to access the VU memory with the VU WID, not the S or U WID) we could do without vslwid (with some extra WID switching software). But for hstatus.HU=1, it needs to be done by the hardware. |
| * The *Shwdeleg/Svswid* extensions add another delegation level to match the additional | ||
| level of privilege hierarchy that the H extension introduces. Two HS-mode | ||
| registers (that are not visible to VS) are added, called `hlwid` and `hwiddeleg`. | ||
| Another HS-mode register called `vslwid` is added, which is also accessed |
There was a problem hiding this comment.
vslwid is the replica CSR of the S-mode slwid CSR ?
And behavior similar to what is described in Priv spec, section 21.2:
When V=1, the VS CSRs substitute for the corresponding supervisor CSRs, taking over all functions of the usual supervisor CSRs except as specified otherwise. Instructions that normally read or modify a supervisor CSR shall instead access the corresponding VS CSR. When V=1, an attempt to read or write a VS CSR directly by its own separate CSR address causes a virtual-instruction exception. (Attempts from U-mode cause an illegal-instruction exception as usual.) The VS CSRs can be accessed as themselves only from M-mode or HS-mode.
| | `XLEN` | `hlwid` | WARL for HS | `???` | WID value used for lower privilege | ||
| modes than HS-mode with the optional Svswid extension (i.e., VS/VU-mode). | ||
| `Ceil(Log~2~NWorlds)` LSBs are used, others are zero. | ||
| | `XLEN` | `vslwid` | WARL for HS | `???` | With the Svswid extension, this CSR |
| modes than HS-mode with the optional Svswid extension (i.e., VS/VU-mode). | ||
| `Ceil(Log~2~NWorlds)` LSBs are used, others are zero. | ||
| | `XLEN` | `vslwid` | WARL for HS | `???` | With the Svswid extension, this CSR | ||
| is the virtualization shadow register of the slwid register. In HS-mode this |
There was a problem hiding this comment.
is the replica register of the slwid register
| modes than HS-mode with the optional Svswid extension (i.e., VS/VU-mode). | ||
| `Ceil(Log~2~NWorlds)` LSBs are used, others are zero. | ||
| | `XLEN` | `vslwid` | WARL for HS | `???` | With the Svswid extension, this CSR | ||
| is the virtualization shadow register of the slwid register. In HS-mode this |
| VS-mode on a hart is platform-specific. | ||
|
|
||
| `hwiddeleg` is always a subset of `mwiddeleg`. Attempts to authorize a WID in | ||
| `mwiddeleg` that is not authorized in `mwiddeleg` will fail - the |
| will be implicitly de-authorized in `hwiddeleg` also. | ||
|
|
||
| If `hwiddeleg` is zero (which may happen even if non-zero values are written to | ||
| it, see the previous paragraph), the Svswid extension is disabled, in which case |
There was a problem hiding this comment.
I don't understand why Svswid extension is disabled if hwiddeleg is empty, as Svswid extension is claimed to add the hlwid CSR.
It should be possible anyway to assign a WID to VS and VU (the same one) using the hlwid CSR, as it is written 2 lines after.
| to determine the actual configuration retained by the implementation. | ||
|
|
||
| The Svswid extension adds the HS-mode read-write `hlwid` CSR, which | ||
| sets the WID used for VS-mode and if not further delegated for VU-mode. The `hlwid` |
There was a problem hiding this comment.
So Svswid extension is used to have a VS and VU WID (set by hlwid) distinct from the HS WID (set by mlwid), whether hwiddeleg is empty/enabled or not
| `hwiddeleg` register represents a set of WIDs as a bit vector with | ||
| WID _i_ represented by bit _i_ of the register. The `hwiddeleg` CSR | ||
| is a WARL register where each bit that can be set indicates a WID that | ||
| is delegated to VS-mode. The set of worlds that can be delegated to |
There was a problem hiding this comment.
indicates a WID that can be set for VU mode by VS mode
| sets the WID used for VS-mode and if not further delegated for VU-mode. The `hlwid` | ||
| field is WARL that can contain Ceil(Log~2~NWorlds)-1:0 writable bits. | ||
|
|
||
| If an unauthorized WID (per the `hwiddeleg` list) is written to `hlwid`, then |
There was a problem hiding this comment.
hwiddeleg constrains the values in vslwid, not in hlwid (these ones are constrained by mwiddeleg)
| To allow for a hypervisor to set or context switch the VS-mode `slwid` CSR, | ||
| the `vslwid` shadow register is defined. In HS-mode this register can be | ||
| programmed to set the effective WID of VU mode. In VS-mode it is accessed via | ||
| the `slwid` CSR address. |
There was a problem hiding this comment.
this paragraph is redundant with description made above
|
Seems to be some confusion about the Svswid extension which is claimed to add the |
First proposal for the newly proposed Fast-Track to add support for virtualization (H-extension).
The Shwdeleg/Svswid extensions add another delegation level to match the additional level of privilege hierarchy that the H extension introduces. Two HS-mode registers (that are not visible to VS) are added, called hlwid and hwiddeleg. Another HS-mode register called vslwid is added, which is also accessed via the slwid CSR addres in VS-mode.