Hardware Updating of PTE A/D Bits
Type: privileged
Sm (>= 1.12) and (Sv32 or Sv39)
| Version | State | Ratified |
|---|---|---|
| 1.0.0 | ratified | 2023-11 |
The Svadu extension adds support and CSR controls for hardware updating of PTE A/D bits. The A and D bits are managed by these extensions as follows:
* When a virtual page is accessed and the A bit is clear, the PTE is updated to set the A bit. When the virtual page is written and the D bit is clear, the PTE is updated to set the D bit. When G-stage address translation is in use and is not Bare, the G-stage virtual pages may be accessed or written by implicit accesses to VS-level memory management data structures, such as page tables.
* When two-stage address translation is in use, an explicit access may cause both VS-stage and G-stage PTEs to be updated. The following rules apply to all PTE updates caused by an explicit or an implicit memory accesses. + + The PTE update must be atomic with respect to other accesses to the PTE, and must atomically perform all tablewalk checks for that leaf PTE as part of, and before, conditionally updating the PTE value. Updates of the A bit may be performed as a result of speculation, even if the associated memory access ultimately is not performed architecturally. However, updates to the D bit, resulting from an explicit store, must be exact (i.e., non-speculative), and observed in program order by the local hart. When two-stage address translation is active, updates of the D bit in G-stage PTEs may be performed as a result of speculative updates of the A bit in VS-stage PTEs. + + The PTE update must appear in the global memory order before the memory access that caused the PTE update and before any subsequent explicit memory access to that virtual page by the local hart. The ordering on loads and stores provided by FENCE instructions and the acquire/release bits on atomic instructions also orders the PTE updates associated with those loads and stores as observed by remote harts. + + The PTE update is not required to be atomic with respect to the memory access that caused the update and a trap may occur between the PTE update and the memory access that caused the PTE update. If a trap occurs then the A and/or D bit may be updated but the memory access that caused the PTE update might not occur. The hart must not perform the memory access that caused the PTE update before the PTE update is globally visible.
Note: The PTE updates due to memory accesses ordered-after a FENCE are not themselves ordered by the FENCE.
Simpler implementations that cannot precisely order the PTE update before subsequent explicit memory accesses to the associated virtual page by the local hart may simply order the PTE update before all subsequent explicit memory accesses to any virtual page by the local hart.
Svadu extension requires the page tables to be located in memory with hardware page-table write access and _RsrvEventual_ PMA.
<<<
The translation of virtual addresses (or guest physical addresses) to physical (or guest physical) addresses is accomplished with the same algorithm as specified in the Supervisor-Level ISA extension (section "Virtual Address Translation Process") and as modified by the hypervisor extension (section "Two-stage Address Translation"), except that step 7 of the translation process, instead of causing a page-fault exception due to A and/or D bits being 0 when required to be 1, continues as follows:
. If `pte.a = 0`, or if the original memory access is a store and `pte.d = 0`: .. If a store to `pte` would violate a PMA or PMP check, raise an access-fault exception corresponding to the original access type. .. Perform the following steps atomically: ... Compare `pte` to the value of the PTE at address `a + va.vpn[i] * PTESIZE`. ... If the values match, set `pte.a` to 1 and, if the original memory access is a store, also set `pte.d` to 1. ... If the comparison fails, return to step 2
The Svadu extension adds the `ADUE` bit (bit 61) to `menvcfg`. When `menvcfg.ADUE` is 1, hardware updating of PTE A/D bits is enabled during single-stage address translation. When the hypervisor extension is implemented, if `menvcfg.ADUE` is 1, hardware updating of PTE A/D bits is enabled during G-stage address translation. When `menvcfg.ADUE` is zero, the implementation behaves as though Svadu were not implemented. If Svadu is not implemented, `menvcfg.ADUE` is read-only zero. Furthermore, for implementations with the hypervisor extension, `henvcfg.ADUE` is read-only zero if `menvcfg.ADUE` is zero.
When the hypervisor extension is implemented, the Svadu extension adds the `ADUE` bit (bit 61) to `henvcfg`. When `henvcfg.ADUE` is 1, hardware updating of PTE A/D bits is enabled during VS-stage address translation. When `henvcfg.ADUE` is zero, the implementation behaves as though Svadu were not implemented for VS-stage address translation.
mret — Machine-mode Return from Trapsfence.vma — Supervisor memory-management fencesret — Supervisor Mode Return from Trapwfi — Wait for interrupthenvcfg — Hypervisor Environment Configurationhenvcfgh — most-significant 32 bits of Hypervisor Environment Configurationmarchid — Machine Architecture IDmcause — Machine Causemconfigptr — Machine Configuration Pointermcountinhibit — Machine Counter Inhibitmcycle — Machine Cycle Countermcycleh — High-half machine Cycle Countermedeleg — Machine Exception Delegationmedelegh — Machine Exception Delegation, High bitsmenvcfg — Machine Environment Configurationmenvcfgh — Machine Environment Configurationmepc — Machine Exception Program Countermhartid — Machine Hart IDmhpmcounter10 — Machine Hardware Performance Counter 10mhpmcounter10h — Machine Hardware Performance Counter 10, Upper halfmhpmcounter11 — Machine Hardware Performance Counter 11mhpmcounter11h — Machine Hardware Performance Counter 11, Upper halfmhpmcounter12 — Machine Hardware Performance Counter 12mhpmcounter12h — Machine Hardware Performance Counter 12, Upper halfmhpmcounter13 — Machine Hardware Performance Counter 13mhpmcounter13h — Machine Hardware Performance Counter 13, Upper halfmhpmcounter14 — Machine Hardware Performance Counter 14mhpmcounter14h — Machine Hardware Performance Counter 14, Upper halfmhpmcounter15 — Machine Hardware Performance Counter 15mhpmcounter15h — Machine Hardware Performance Counter 15, Upper halfmhpmcounter16 — Machine Hardware Performance Counter 16mhpmcounter16h — Machine Hardware Performance Counter 16, Upper halfmhpmcounter17 — Machine Hardware Performance Counter 17mhpmcounter17h — Machine Hardware Performance Counter 17, Upper halfmhpmcounter18 — Machine Hardware Performance Counter 18mhpmcounter18h — Machine Hardware Performance Counter 18, Upper halfmhpmcounter19 — Machine Hardware Performance Counter 19mhpmcounter19h — Machine Hardware Performance Counter 19, Upper halfmhpmcounter20 — Machine Hardware Performance Counter 20mhpmcounter20h — Machine Hardware Performance Counter 20, Upper halfmhpmcounter21 — Machine Hardware Performance Counter 21mhpmcounter21h — Machine Hardware Performance Counter 21, Upper halfmhpmcounter22 — Machine Hardware Performance Counter 22mhpmcounter22h — Machine Hardware Performance Counter 22, Upper halfmhpmcounter23 — Machine Hardware Performance Counter 23mhpmcounter23h — Machine Hardware Performance Counter 23, Upper halfmhpmcounter24 — Machine Hardware Performance Counter 24mhpmcounter24h — Machine Hardware Performance Counter 24, Upper halfmhpmcounter25 — Machine Hardware Performance Counter 25mhpmcounter25h — Machine Hardware Performance Counter 25, Upper halfmhpmcounter26 — Machine Hardware Performance Counter 26mhpmcounter26h — Machine Hardware Performance Counter 26, Upper halfmhpmcounter27 — Machine Hardware Performance Counter 27mhpmcounter27h — Machine Hardware Performance Counter 27, Upper halfmhpmcounter28 — Machine Hardware Performance Counter 28mhpmcounter28h — Machine Hardware Performance Counter 28, Upper halfmhpmcounter29 — Machine Hardware Performance Counter 29mhpmcounter29h — Machine Hardware Performance Counter 29, Upper halfmhpmcounter3 — Machine Hardware Performance Counter 3mhpmcounter30 — Machine Hardware Performance Counter 30mhpmcounter30h — Machine Hardware Performance Counter 30, Upper halfmhpmcounter31 — Machine Hardware Performance Counter 31mhpmcounter31h — Machine Hardware Performance Counter 31, Upper halfmhpmcounter3h — Machine Hardware Performance Counter 3, Upper halfmhpmcounter4 — Machine Hardware Performance Counter 4mhpmcounter4h — Machine Hardware Performance Counter 4, Upper halfmhpmcounter5 — Machine Hardware Performance Counter 5mhpmcounter5h — Machine Hardware Performance Counter 5, Upper halfmhpmcounter6 — Machine Hardware Performance Counter 6mhpmcounter6h — Machine Hardware Performance Counter 6, Upper halfmhpmcounter7 — Machine Hardware Performance Counter 7mhpmcounter7h — Machine Hardware Performance Counter 7, Upper halfmhpmcounter8 — Machine Hardware Performance Counter 8mhpmcounter8h — Machine Hardware Performance Counter 8, Upper halfmhpmcounter9 — Machine Hardware Performance Counter 9mhpmcounter9h — Machine Hardware Performance Counter 9, Upper halfmhpmevent10 — Machine Hardware Performance Counter 10 Controlmhpmevent10h — Machine Hardware Performance Counter 10 Control, High halfmhpmevent11 — Machine Hardware Performance Counter 11 Controlmhpmevent11h — Machine Hardware Performance Counter 11 Control, High halfmhpmevent12 — Machine Hardware Performance Counter 12 Controlmhpmevent12h — Machine Hardware Performance Counter 12 Control, High halfmhpmevent13 — Machine Hardware Performance Counter 13 Controlmhpmevent13h — Machine Hardware Performance Counter 13 Control, High halfmhpmevent14 — Machine Hardware Performance Counter 14 Controlmhpmevent14h — Machine Hardware Performance Counter 14 Control, High halfmhpmevent15 — Machine Hardware Performance Counter 15 Controlmhpmevent15h — Machine Hardware Performance Counter 15 Control, High halfmhpmevent16 — Machine Hardware Performance Counter 16 Controlmhpmevent16h — Machine Hardware Performance Counter 16 Control, High halfmhpmevent17 — Machine Hardware Performance Counter 17 Controlmhpmevent17h — Machine Hardware Performance Counter 17 Control, High halfmhpmevent18 — Machine Hardware Performance Counter 18 Controlmhpmevent18h — Machine Hardware Performance Counter 18 Control, High halfmhpmevent19 — Machine Hardware Performance Counter 19 Controlmhpmevent19h — Machine Hardware Performance Counter 19 Control, High halfmhpmevent20 — Machine Hardware Performance Counter 20 Controlmhpmevent20h — Machine Hardware Performance Counter 20 Control, High halfmhpmevent21 — Machine Hardware Performance Counter 21 Controlmhpmevent21h — Machine Hardware Performance Counter 21 Control, High halfmhpmevent22 — Machine Hardware Performance Counter 22 Controlmhpmevent22h — Machine Hardware Performance Counter 22 Control, High halfmhpmevent23 — Machine Hardware Performance Counter 23 Controlmhpmevent23h — Machine Hardware Performance Counter 23 Control, High halfmhpmevent24 — Machine Hardware Performance Counter 24 Controlmhpmevent24h — Machine Hardware Performance Counter 24 Control, High halfmhpmevent25 — Machine Hardware Performance Counter 25 Controlmhpmevent25h — Machine Hardware Performance Counter 25 Control, High halfmhpmevent26 — Machine Hardware Performance Counter 26 Controlmhpmevent26h — Machine Hardware Performance Counter 26 Control, High halfmhpmevent27 — Machine Hardware Performance Counter 27 Controlmhpmevent27h — Machine Hardware Performance Counter 27 Control, High halfmhpmevent28 — Machine Hardware Performance Counter 28 Controlmhpmevent28h — Machine Hardware Performance Counter 28 Control, High halfmhpmevent29 — Machine Hardware Performance Counter 29 Controlmhpmevent29h — Machine Hardware Performance Counter 29 Control, High halfmhpmevent3 — Machine Hardware Performance Counter 3 Controlmhpmevent30 — Machine Hardware Performance Counter 30 Controlmhpmevent30h — Machine Hardware Performance Counter 30 Control, High halfmhpmevent31 — Machine Hardware Performance Counter 31 Controlmhpmevent31h — Machine Hardware Performance Counter 31 Control, High halfmhpmevent3h — Machine Hardware Performance Counter 3 Control, High halfmhpmevent4 — Machine Hardware Performance Counter 4 Controlmhpmevent4h — Machine Hardware Performance Counter 4 Control, High halfmhpmevent5 — Machine Hardware Performance Counter 5 Controlmhpmevent5h — Machine Hardware Performance Counter 5 Control, High halfmhpmevent6 — Machine Hardware Performance Counter 6 Controlmhpmevent6h — Machine Hardware Performance Counter 6 Control, High halfmhpmevent7 — Machine Hardware Performance Counter 7 Controlmhpmevent7h — Machine Hardware Performance Counter 7 Control, High halfmhpmevent8 — Machine Hardware Performance Counter 8 Controlmhpmevent8h — Machine Hardware Performance Counter 8 Control, High halfmhpmevent9 — Machine Hardware Performance Counter 9 Controlmhpmevent9h — Machine Hardware Performance Counter 9 Control, High halfmideleg — Machine Interrupt Delegationmie — Machine Interrupt Enablemimpid — Machine Implementation IDminstret — Machine Instructions Retired Counterminstreth — Machine Instructions Retired Countermip — Machine Interrupt Pendingmisa — Machine ISA Controlmscontext — Machine Supervisor Contextmscratch — Machine Scratch Registermseccfg — Machine Security Configurationmseccfgh — Most significant 32 bits of Machine Security Configurationmstatus — Machine Statusmstatush — Machine Status Highmtval — Machine Trap Valuemtvec — Machine Trap Vector Controlmvendorid — Machine Vendor IDpmpaddr0 — PMP Address 0pmpaddr1 — PMP Address 1pmpaddr10 — PMP Address 10pmpaddr11 — PMP Address 11pmpaddr12 — PMP Address 12pmpaddr13 — PMP Address 13pmpaddr14 — PMP Address 14pmpaddr15 — PMP Address 15pmpaddr16 — PMP Address 16pmpaddr17 — PMP Address 17pmpaddr18 — PMP Address 18pmpaddr19 — PMP Address 19pmpaddr2 — PMP Address 2pmpaddr20 — PMP Address 20pmpaddr21 — PMP Address 21pmpaddr22 — PMP Address 22pmpaddr23 — PMP Address 23pmpaddr24 — PMP Address 24pmpaddr25 — PMP Address 25pmpaddr26 — PMP Address 26pmpaddr27 — PMP Address 27pmpaddr28 — PMP Address 28pmpaddr29 — PMP Address 29pmpaddr3 — PMP Address 3pmpaddr30 — PMP Address 30pmpaddr31 — PMP Address 31pmpaddr32 — PMP Address 32pmpaddr33 — PMP Address 33pmpaddr34 — PMP Address 34pmpaddr35 — PMP Address 35pmpaddr36 — PMP Address 36pmpaddr37 — PMP Address 37pmpaddr38 — PMP Address 38pmpaddr39 — PMP Address 39pmpaddr4 — PMP Address 4pmpaddr40 — PMP Address 40pmpaddr41 — PMP Address 41pmpaddr42 — PMP Address 42pmpaddr43 — PMP Address 43pmpaddr44 — PMP Address 44pmpaddr45 — PMP Address 45pmpaddr46 — PMP Address 46pmpaddr47 — PMP Address 47pmpaddr48 — PMP Address 48pmpaddr49 — PMP Address 49pmpaddr5 — PMP Address 5pmpaddr50 — PMP Address 50pmpaddr51 — PMP Address 51pmpaddr52 — PMP Address 52pmpaddr53 — PMP Address 53pmpaddr54 — PMP Address 54pmpaddr55 — PMP Address 55pmpaddr56 — PMP Address 56pmpaddr57 — PMP Address 57pmpaddr58 — PMP Address 58pmpaddr59 — PMP Address 59pmpaddr6 — PMP Address 6pmpaddr60 — PMP Address 60pmpaddr61 — PMP Address 61pmpaddr62 — PMP Address 62pmpaddr63 — PMP Address 63pmpaddr7 — PMP Address 7pmpaddr8 — PMP Address 8pmpaddr9 — PMP Address 9pmpcfg0 — PMP Configuration Register 0pmpcfg1 — PMP Configuration Register 1pmpcfg10 — PMP Configuration Register 10pmpcfg11 — PMP Configuration Register 11pmpcfg12 — PMP Configuration Register 12pmpcfg13 — PMP Configuration Register 13pmpcfg14 — PMP Configuration Register 14pmpcfg15 — PMP Configuration Register 15pmpcfg2 — PMP Configuration Register 2pmpcfg3 — PMP Configuration Register 3pmpcfg4 — PMP Configuration Register 4pmpcfg5 — PMP Configuration Register 5pmpcfg6 — PMP Configuration Register 6pmpcfg7 — PMP Configuration Register 7pmpcfg8 — PMP Configuration Register 8pmpcfg9 — PMP Configuration Register 9satp — Supervisor Address Translation and Protectionscause — Supervisor Causescontext — Supervisor Contextscounteren — Supervisor Counter Enablesenvcfg — Supervisor Environment Configurationsepc — Supervisor Exception Program Countersie — Supervisor interrupt-enable registersip — Supervisor Interrupt Pendingsscratch — Supervisor Scratch Registersstatus — Supervisor Statusstval — Supervisor Trap Valuestvec — Supervisor Trap VectorVersion af3eaf9+cheriot.f635218
Data from the RISC-V Unified Database, copyright RISC-V International and contributors.
CHERIoT extensions from the CHERIoT specification and Sail model, copyright Microsoft and the CHERIoT Platform contributors.
This site is provided as a community resource and is NOT affiliated with nor endorsed by RISC-V International.