Skip to content

Commit 4e54026

Browse files
authored
Specify synchronization requirements when changing xenvcfg.ADUE (#2400)
1 parent 98ea4b5 commit 4e54026

File tree

3 files changed

+13
-7
lines changed

3 files changed

+13
-7
lines changed

src/hypervisor.adoc

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1845,21 +1845,21 @@ address-translation cache entries that have cached PMP settings
18451845
corresponding to the final translated supervisor physical address. An
18461846
HFENCE.VVMA instruction is not required.
18471847

1848-
Similarly, if the setting of the PBMTE bit in `menvcfg` is changed, an
1848+
Similarly, if the setting of the PBMTE or ADUE bits in `menvcfg` are changed, an
18491849
HFENCE.GVMA instruction with _rs1_=`x0` and _rs2_=`x0` suffices to synchronize
18501850
with respect to the altered interpretation of G-stage and VS-stage PTEs' PBMT
1851-
fields.
1851+
and A/D bit fields, respectively.
18521852

1853-
By contrast, if the PBMTE bit in `henvcfg` is changed, executing an
1853+
By contrast, if the PBMTE or ADUE bits in `henvcfg` are changed, executing an
18541854
HFENCE.VVMA with _rs1_=`x0` and _rs2_=`x0` suffices to synchronize with
1855-
respect to the altered interpretation of VS-stage PTEs' PBMT fields for the
1856-
currently active VMID.
1855+
respect to the altered interpretation of VS-stage PTEs' PBMT and A/D bit fields
1856+
for the currently active VMID.
18571857

18581858
NOTE: No mechanism is provided to atomically change `vsatp` and `hgatp`
18591859
together. Hence, to prevent speculative execution causing one guest's
18601860
VS-stage translations to be cached under another guest's VMID, world-switch
18611861
code should zero `vsatp`, then swap `hgatp`, then finally write the new
1862-
`vsatp` value. Similarly, if `henvcfg`.PBMTE need be world-switched, it
1862+
`vsatp` value. Similarly, if `henvcfg`.PBMTE/ADUE need be world-switched, they
18631863
should be switched after zeroing `vsatp` but before writing the new `vsatp`
18641864
value, obviating the need to execute an HFENCE.VVMA instruction.
18651865

src/machine.adoc

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2203,6 +2203,12 @@ If Svadu is not implemented, ADUE is read-only zero.
22032203
Furthermore, for implementations with the hypervisor extension, `henvcfg`.ADUE
22042204
is read-only zero if `menvcfg`.ADUE is zero.
22052205

2206+
After changing `menvcfg`.ADUE, executing an SFENCE.VMA instruction with
2207+
_rs1_=`x0` and _rs2_=`x0` suffices to synchronize address-translation caches
2208+
with respect to the altered interpretation of page-table entries' A/D bits.
2209+
See <<hyp-mm-fences>> for additional synchronization requirements when the
2210+
hypervisor extension is implemented.
2211+
22062212
NOTE: The Svade extension requires page-fault exceptions be raised when PTE
22072213
A/D bits need be set, hence Svade is implemented when ADUE=0.
22082214

src/priv-preface.adoc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -347,7 +347,7 @@ implemented.
347347
extension.
348348
* Allocated interrupt 13 for Sscofpmf LCOFI interrupt.
349349
* Defined hardware-error and software-check exception codes.
350-
* Specified synchronization requirements when changing the PBMTE fields
350+
* Specified synchronization requirements when changing the PBMTE and ADUE fields
351351
in `menvcfg` and `henvcfg`.
352352
* Exposed count-overflow interrupts to VS-mode via the Shlcofideleg extension.
353353
* Relaxed behavior of some HINTs when MXLEN > XLEN.

0 commit comments

Comments
 (0)