hrfid

Hypervisor Return From Interrupt Doubleword

hrfid

Returns from a hypervisor interrupt.

Details

The hrfid instruction is used by a hypervisor to return from an interrupt. It updates the Machine State Register (MSR) and sets the Next Instruction Address (NIA) based on values stored in Hypervisor Save Registers (HSRR).

Pseudocode Operation

MSR48 ← HSRR148 | HSRR149
MSR58 ← (HSRR158 | HSRR149) & ¬(MSR41 & MSR3 & (¬HSRR149))
MSR59 ← (HSRR159 | HSRR149) & ¬(MSR41 & MSR3 & (¬HSRR149))
MSR0:32 37:40 49:57 60:63 ← HSRR10:32 37:40 49:57 60:63
NIA ← iea HSRR00:61 || 0b00

Programming Note

The hrfid instruction is crucial for hypervisors to manage interrupt returns, updating the MSR and setting the NIA based on values from HSRR. Ensure that HSRR registers are correctly populated before executing hrfid to avoid undefined behavior. This instruction operates at supervisor level and may trigger exceptions if executed in an inappropriate context.

Example

hrfid

Encoding

Binary Layout
19
0
/
6
/
11
/
16
274
21
/
31
 
Format XL-form
Opcode 0x4C000224
Extension Privileged
Registers Altered SRR0, SRR1, MSR

Operands