sfence.inval.ir
Order implicit page table reads after invalidation
- Extension
- Svinval
- XLEN
- RV32 and RV64
- Assembly (riscv-unified-db)
sfence.inval.ir- Length
- 32-bit
Encoding
| 3125 | 2420 | 1915 | 1412 | 117 | 62 | 10 | |||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 0001100 | 00001 | 00000 | 000 | 00000 | 11100 | 11 | |||||||||||||||||||||||||
Match 0x18100073, mask 0xffffffff. Source: sfence.inval.ir 11..7=0 19..15=0x0 24..20=0x1 31..25=0x0c 14..12=0 6..2=0x1C 1..0=3 in riscv-opcodes/extensions/rv_svinval.
Description
The sfence.inval.ir instruction guarantees that any previous sinval.vma
instructions executed by the current hart are ordered before subsequent implicit references by
that hart to the memory-management data structures.
Description from riscv-unified-db, reformatted.
Operation
if (mode() == PrivilegeMode::U) {
raise (ExceptionCode::IllegalInstruction, mode(), $encoding);
}
if (CSR[misa].H == 1 && mode() == PrivilegeMode::VU) {
raise (ExceptionCode::VirtualInstruction, mode(), $encoding);
}
# order all subsequent (implicit) loads after an sfence/hfence invalidation
# Unlike SFENCE.VMA/HFENCE.[GV]VMA, SFENCE.W.INVAL is indiscriminate;
# it orders all reads after all page tables
VmaOrderType vma_type;
vma_type.global = true;
vma_type.smode = true;
if (CSR[misa].H == 1) {
vma_type.vsmode = true;
vma_type.gstage = true;
}
order_pgtbl_reads_after_vmafence(vma_type);Pseudocode in riscv-unified-db’s IDL, quoted unchanged.