CSR Bit Fields

RISC-V hgatp CSR Register

Address 0x680Privilege HypervisorAccess HRW / HSXLENHypervisor and virtualization CSRs

hgatp is the G-stage translation root CSR holding mode, VMID, and the guest-physical root page-table PPN.

Field Map

Understand hgatp By Bit Fields

3 key fields
63:60

MODE

RW

G-stage address translation mode encoding; when Bare, the remaining fields must be zero.

MODE (bits 63:60) — G-stage address translation mode encoding; when Bare, the remaining fields must be zero.

What This Field Controls

  • - G-stage address translation mode encoding; when Bare, the remaining fields must be zero.

Common Values

RV64 hgatp.MODE
0Bare

No G-stage paged address translation; when Bare is selected, the remaining fields must be written as zero.

1-7Reserved

Reserved encodings for RV64 hgatp.MODE; portable software must not write or depend on them.

8Sv39x4

Enables Sv39x4 G-stage paged address translation.

9Sv48x4

Enables Sv48x4 G-stage paged address translation.

10Sv57x4

Enables Sv57x4 G-stage paged address translation.

11-15Reserved

Reserved encodings for RV64 hgatp.MODE; portable software must not write or depend on them.

Open Official Manual
57:44

VMID

RW

Virtual machine identifier for tagging address-translation caches per VM.

VMID (bits 57:44) — Virtual machine identifier for tagging address-translation caches per VM.

What This Field Controls

  • - Virtual machine identifier for tagging address-translation caches per VM.

Common Values

This field is better understood together with surrounding context than as a fixed memorized enumeration.

Open Official Manual
43:0

PPN

RW

Physical page number of the guest-physical root page table.

PPN (bits 43:0) — Physical page number of the guest-physical root page table.

What This Field Controls

  • - Physical page number of the guest-physical root page table.

Common Values

This field is better understood together with surrounding context than as a fixed memorized enumeration.

Open Official Manual
Official Basis & Search Notes

hgatp is a G-stage address-translation CSR. It is HS/M-side hypervisor state, not a VS supervisor CSR copy; guest access is governed by the H extension and relevant state-enable, AIA, Sstc, or Smcsrind rules.

hgatp address, access class, and width are checked against the official CSR tables: 0x680, HRW, HSXLEN.
MODE selects the G-stage address-translation mode; when Bare, the remaining fields must be zero.
VMID tags address-translation caches by virtual machine; PPN holds the physical page number of the guest-physical root page table.
When writing, modify only officially defined fields; handle WARL, WLRL, WPRI, and reserved fields according to the official specification and implementation behavior.

What To Check First When Reading This CSR

  • - hgatp is a Hypervisor-level CSR; its separate address is in the official HRW access class.
  • - Guest/VS software does not reach this H-level CSR through a supervisor CSR alias; access is controlled by the H extension and relevant optional-extension rules.

Risk Checks Before Writing

  • - When writing hgatp, modify only officially defined target fields and preserve WPRI, reserved, and unchanged fields.

Put It Back Into A Real Flow

1

Confirm the current software is in an M/HS context that may access Hypervisor CSRs.

2

Confirm that the H, AIA, Sstc, Smstateen, Smcsrind, or other defining extension is implemented.

3

Read or write only official fields; whether guest-related access succeeds or traps is controlled by the corresponding extension rules and state-enable state.

FAQ

Can hgatp be accessed through a supervisor CSR alias?

Do not treat hgatp as a VS CSR copy. It is an H-level CSR; whether guest/VS access to related functionality traps is defined by the H extension and the relevant optional extension.

What matters when hgatp is Bare?

The official rule requires the remaining fields to be zero when the mode is Bare.