hinval.gvma
Invalidate cached address translations
Encoding
| 3125 | 2420 | 1915 | 1412 | 117 | 62 | 10 | |||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 0110011 | rs2 | rs1 | 000 | 00000 | 11100 | 11 | |||||||||||||||||||||||||
Match 0x66000073, mask 0xfe007fff. Source: hinval.gvma 11..7=0 rs1 rs2 31..25=0x33 14..12=0 6..2=0x1C 1..0=3 in riscv-opcodes/extensions/rv_svinval_h.
| Field | Bits | riscv-opcodes name |
|---|---|---|
| rs2 | 24:20 | rs2 |
| rs1 | 19:15 | rs1 |
Description
hinval.gvma has the same semantics as sinval.vma except that it combines with
sfence.w.inval and sfence.inval.ir to replace hfence.gvma and uses VMID instead of ASID.
Description from riscv-unified-db, reformatted.
Operation
XReg gpa = X[xs1];
Bits<VMID_WIDTH> vmid = X[xs2][VMID_WIDTH-1:0];
if (mode() == PrivilegeMode::U) {
raise (ExceptionCode::IllegalInstruction, mode(), $encoding);
}
if (CSR[mstatus].TVM == 1 && mode() == PrivilegeMode::S) {
raise (ExceptionCode::IllegalInstruction, mode(), $encoding);
}
if ((mode() == PrivilegeMode::VS) || (mode() == PrivilegeMode::VU)) {
raise (ExceptionCode::VirtualInstruction, mode(), $encoding);
}
# note: this will default to "all"
VmaOrderType vma_type;
vma_type.gstage = true;
if ((xs1 == 0) && (xs2 == 0)) {
# invalidate all G-stage translations, from all addresses and all VMIDs
# includes global mappings
vma_type.global = true;
invalidate_translations(vma_type);
} else if ((xs1 == 0) && (xs2 != 0)) {
# invalidates all G-stage translations from VMID 'vmid'
# does not affect global mappings
vma_type.single_vmid = true;
vma_type.vmid = vmid;
invalidate_translations(vma_type);
} else if ((xs1 != 0) && (xs2 == 0)) {
# invalidate all G-stage translations from leaf page tables containing 'vaddr'
# does not affect global mappings
if (canonical_gpaddr?(gpa)) {
vma_type.single_gpaddr = true;
vma_type.gpaddr = gpa;
invalidate_translations(vma_type);
}
# else, silently do nothing
} else {
# invalidate all G-stage translations from leaf page tables for virtual machine 'vmid' containing 'vaddr'
# does not affect global mappings
if (canonical_gpaddr?(gpa)) {
vma_type.single_vmid = true;
vma_type.vmid = vmid;
vma_type.single_gpaddr = true;
vma_type.gpaddr = gpa;
invalidate_translations(vma_type);
}
# else, silently do nothing
}Pseudocode in riscv-unified-db’s IDL, quoted unchanged.