← Home

sfence.inval.ir

Order implicit page table reads after invalidation

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.

Assembly format

sfence.inval.ir

Encoding

313029282726252423222120191817161514131211109876543210
00011000000100000000000001110011

Execution

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);

Defined by

Svinval

Access

SUVSVU
SometimesNeverSometimesNever

Version 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.