Invalidate cached address translations
`hinval.vvma` has the same semantics as `sinval.vma` except that it combines with `sfence.w.inval` and `sfence.inval.ir` to replace `hfence.vvma`.
hinval.vvma xs1, xs2
| 31 | 30 | 29 | 28 | 27 | 26 | 25 | 24 | 23 | 22 | 21 | 20 | 19 | 18 | 17 | 16 | 15 | 14 | 13 | 12 | 11 | 10 | 9 | 8 | 7 | 6 | 5 | 4 | 3 | 2 | 1 | 0 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 00 | 1 | 00 | 11 | xs2 | xs1 | 00000000 | 111 | 00 | 11 | ||||||||||||||||||||||
| Variable | Bits | Width |
|---|---|---|
xs2 | [24:20] | 5 |
xs1 | [19:15] | 5 |
XReg vaddr = X[xs1];
Bits<ASID_WIDTH> asid = X[xs2][ASID_WIDTH-1:0];
Bits<VMID_WIDTH> vmid = CSR[hgatp].VMID;
if (mode() == PrivilegeMode::U) {
raise (ExceptionCode::IllegalInstruction, mode(), $encoding);
}
if ((CSR[misa].H == 1) &&
(mode() == PrivilegeMode::VS || mode() == PrivilegeMode::VU)) {
raise (ExceptionCode::VirtualInstruction, mode(), $encoding);
}
# note: this will default to "all"
VmaOrderType vma_type;
vma_type.vsmode = true;
vma_type.single_vmid = true;
vma_type.vmid = vmid;
if ((xs1 == 0) && (xs2 == 0)) {
# invalidate all translations, from all addresses and all ASIDs
# includes global mappings
vma_type.global = true;
invalidate_translations(vma_type);
} else if ((xs1 == 0) && (xs2 != 0)) {
# invalidates all translations from ASID 'asid'
# does not affect global mappings
vma_type.single_asid = true;
vma_type.asid = asid;
invalidate_translations(vma_type);
} else if ((xs1 != 0) && (xs2 == 0)) {
# invalidate all translations from leaf page tables containing 'vaddr'
# does not affect global mappings
if (canonical_vaddr?(vaddr)) {
vma_type.single_vaddr = true;
vma_type.vaddr = vaddr;
invalidate_translations(vma_type);
}
# else, silently do nothing
} else {
# invalidate all translations from leaf page tables for address space 'asid' containing 'vaddr'
# does not affect global mappings
if (canonical_vaddr?(vaddr)) {
vma_type.single_asid = true;
vma_type.asid = asid;
vma_type.single_vaddr = true;
vma_type.vaddr = vaddr;
invalidate_translations(vma_type);
}
# else, silently do nothing
}
Svinval and H
| S | U | VS | VU |
|---|---|---|---|
| Always | Never | Never | Never |
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.