vsatp
Virtual supervisor address translation and protection
- Address
0x280- Group
- Hypervisor and VS CSRs
- Privilege
HRW(privileged spec CSR listing, Virtual Supervisor Registers)- Access
- read/write; lowest privilege H (hypervisor, including VS CSRs)
- Address range
- Standard read/write
- Name in riscv-unified-db
- Virtual Supervisor Address Translation and Protection
Privileged spec: Virtual supervisor address translation and protection
Description
The vsatp register is a VSXLEN-bit read/write register that is VS-mode's version of supervisor
register satp.
When V=1, vsatp substitutes for the usual satp, so instructions that normally read or modify
satp actually access vsatp instead.
vsatp controls VS-stage address translation, the first stage of two-stage translation for
guest virtual addresses.
The vsatp register is considered active for the purposes of the address-translation algorithm
unless the effective privilege mode is U and hstatus.HU=0.
However, even when vsatp is active, VS-stage page-table entries' A bits must not be set as a
result of speculative execution, unless the effective privilege mode is VS or VU.
Note: In particular, virtual-machine load/store (hlv, 'hlvx', or 'hsv') instructions that are
misspeculatively executed must not cause VS-stage A bits to be set.
When V=0, a write to vsatp with an unsupported MODE value is either ignored as it is for
satp, or the fields of vsatp are treated as WARL in the normal way.
However, when V=1, a write to satp with an unsupported MODE value is ignored and no write to
vsatp is effected.
From riscv-unified-db, reformatted.
Fields
| Field | Bits | Type | Description | |||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
MODE | RV32 31 / RV64 63-60 | RW-R | Translation Mode Controls the current translation mode in VS-mode according to the table below.
Any other value shall be ignored on a write. | |||||||||||||||
ASID | RV32 30-22 / RV64 59-44 | RW-R | Address Space ID | |||||||||||||||
PPN | RV32 21-0 / RV64 43-0 | RW-R | Physical Page Number The physical address of the active root page table is PPN << 12. Can only hold values that correspond to a valid page table base, which will be implementation-dependent. |
Fields from riscv-unified-db; field types computed by IDL functions there are not shown.
Specification and related pages
- The RISC-V Instruction Set Manual, Volume II: CSR listing (src/priv/csrs.adoc)
- riscv-opcodes csrs.csv
- riscv-unified-db: spec/std/isa/csr/H/vsatp.yaml
- csrrw, csrrs, csrrc (Zicsr instructions that access CSRs)