HVC

Hypervisor call

This instruction causes an exception to EL2. Software executing at EL1 can use this instruction to call the hypervisor to request a service.

The HVC instruction is UNDEFINED:

  • When EL3 is implemented and SCR_EL3.HCE is set to 0.
  • When EL3 is not implemented and HCR_EL2.HCD is set to 1.
  • When EL2 is not implemented.
  • At EL1 if EL2 is not enabled in the current Security state.
  • At EL0.
  • On executing an HVC instruction, the PE records the exception as a Hypervisor Call exception in ESR_ELx, using the EC syndrome value 0x16, and the value of the immediate argument.

    Encoding: System

    313029282726252423222120191817161514131211109876543210
    1101010000000010
    opcimm16op2LL

    HVC #<imm>

    Decoding algorithm

    if !HaveEL(EL2) then EndOfDecode(Decode_UNDEF);
    constant bits(16) imm = imm16;

    Operation

    if PSTATE.EL == EL0 then UNDEFINED;
    if PSTATE.EL == EL1 && !EL2Enabled() then UNDEFINED;
    if !HaveEL(EL3) && HCR_EL2.HCD == '1' then UNDEFINED;
    if HaveEL(EL3) && SCR_EL3.HCE == '0' then UNDEFINED;
    
    AArch64.CallHypervisor(imm);

    Explanations

    <imm>: Is a 16-bit unsigned immediate, in the range 0 to 65535, encoded in the "imm16" field.