← Home

hinval.gvma

Invalidate cached address translations

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

Assembly format

hinval.gvma xs1, xs2

Encoding

313029282726252423222120191817161514131211109876543210
0110011xs2xs1000000001110011

Decode variables

VariableBitsWidth
xs2[24:20]5
xs1[19:15]5

Execution

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
}

Defined by

Svinval and H

Access

SUVSVU
SometimesNeverNeverNever

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.