src/arm64/esr.bend checks
raw source on the hub · import 0xab9fd5982a23be6a9b632b364492ce07/src/arm64/esr.bend as Esr
2 imports
import Base import ../lib/u64.bend as U
Types
type Trap source · line 22 · raw
Data
A decoded trap. Sizes are in bytes (1, 2, 4 or 8).
Mmio@ipa:0xab9fd5982a23be6a9b632b364492ce07/src/lib/u64.U64 -> @write:Bool -> @size:U32 -> @srt:U32 -> @value:0xab9fd5982a23be6a9b632b364492ce07/src/lib/u64.U64 -> @sse:Bool -> @sf:Bool -> Trap
A data abort with a valid syndrome (ISV = 1): an MMIO access. value is the store data (xt truncated to size) for writes, zero for reads. srt is the transfer register (31 = XZR); sse asks to sign-extend a load; sf says the register is 64-bit.
MmioNoIsv@ipa:0xab9fd5982a23be6a9b632b364492ce07/src/lib/u64.U64 -> Trap
A data abort without a valid syndrome; the VMM cannot emulate it.
Hvc@imm:U32 -> Trap
Smc@imm:U32 -> Trap
Wfx@wfe:Bool -> Trap
WFI (wfe False) or WFE (wfe True).
SysReg@op0:U32 -> @op1:U32 -> @crn:U32 -> @crm:U32 -> @op2:U32 -> @rt:U32 -> @read:Bool -> Trap
MSR/MRS: op0 op1 crn crm op2 name the register, rt the GPR, read is MRS.
InsnAbort@ipa:0xab9fd5982a23be6a9b632b364492ce07/src/lib/u64.U64 -> Trap
Other@ec:U32 -> Trap
Any other class, with its EC.
Definitions
def Ec.wfx source · line 8 · raw
U32
Exception classes the VMM handles (decimal; hex in comments).
def Ec.hvc64 source · line 10 · raw
U32
def Ec.smc64 source · line 12 · raw
U32
def Ec.sysreg source · line 14 · raw
U32
def Ec.iabt_lower source · line 16 · raw
U32
def Ec.dabt_lower source · line 18 · raw
U32
def Esr.ec source · line 41 · raw
@esr:0xab9fd5982a23be6a9b632b364492ce07/src/lib/u64.U64 -> U32
EC, bits [31:26] of the syndrome.
def Esr.iss source · line 45 · raw
@esr:0xab9fd5982a23be6a9b632b364492ce07/src/lib/u64.U64 -> U32
ISS, bits [24:0] of the syndrome.
def Esr.field source · line 49 · raw
@+x:U32 -> @lo:Nat -> @width:Nat -> U32
Bits [lo, lo+width) of a 32-bit word, with width < 32.
def Esr.bit source · line 53 · raw
@+x:U32 -> @n:Nat -> Bool
Bit n of a 32-bit word.
def Trap.size_mask source · line 57 · raw
@+sas:U32 -> 0xab9fd5982a23be6a9b632b364492ce07/src/lib/u64.U64
The bytes of a register an access of 2^sas bytes moves.
def Trap.store_value source · line 65 · raw
@stores:Bool -> @+sas:U32 -> @xt:0xab9fd5982a23be6a9b632b364492ce07/src/lib/u64.U64 -> 0xab9fd5982a23be6a9b632b364492ce07/src/lib/u64.U64
The store data: xt truncated to the access size. Zero for a read, and for a store from XZR (srt 31), whatever the host reports for xt.
def Trap.dabt source · line 74 · raw
@isv:Bool -> @+iss:U32 -> @ipa:0xab9fd5982a23be6a9b632b364492ce07/src/lib/u64.U64 -> @xt:0xab9fd5982a23be6a9b632b364492ce07/src/lib/u64.U64 -> Trap
A data abort. ISS: ISV [24], SAS [23:22], SSE [21], SRT [20:16], SF [15], WnR [6].
def Trap.sysreg source · line 87 · raw
@+iss:U32 -> Trap
An MSR/MRS trap. ISS: Op0 [21:20], Op2 [19:17], Op1 [16:14], CRn [13:10], Rt [9:5], CRm [4:1], Direction [0] (1 = read, MRS).
def Trap.by_iabt source · line 91 · raw
@hit:Bool -> @+ec:U32 -> @ipa:0xab9fd5982a23be6a9b632b364492ce07/src/lib/u64.U64 -> Trap
The decoders below each test one class and hand the rest to the one above.
def Trap.by_sysreg source · line 98 · raw
@hit:Bool -> @+ec:U32 -> @+iss:U32 -> @ipa:0xab9fd5982a23be6a9b632b364492ce07/src/lib/u64.U64 -> Trap
def Trap.by_smc source · line 106 · raw
@hit:Bool -> @+ec:U32 -> @+iss:U32 -> @ipa:0xab9fd5982a23be6a9b632b364492ce07/src/lib/u64.U64 -> Trap
SMC64 and HVC64: the immediate is ISS[15:0].
def Trap.by_hvc source · line 113 · raw
@hit:Bool -> @+ec:U32 -> @+iss:U32 -> @ipa:0xab9fd5982a23be6a9b632b364492ce07/src/lib/u64.U64 -> Trap
def Trap.by_wfx source · line 121 · raw
@hit:Bool -> @+ec:U32 -> @+iss:U32 -> @ipa:0xab9fd5982a23be6a9b632b364492ce07/src/lib/u64.U64 -> Trap
WFx: TI [1:0] is 0 WFI, 1 WFE, 2 WFIT, 3 WFET; bit 0 tells WFE from WFI.
def Trap.by_dabt source · line 128 · raw
@hit:Bool -> @+ec:U32 -> @+iss:U32 -> @ipa:0xab9fd5982a23be6a9b632b364492ce07/src/lib/u64.U64 -> @xt:0xab9fd5982a23be6a9b632b364492ce07/src/lib/u64.U64 -> Trap
def Trap.decode source · line 137 · raw
@esr:0xab9fd5982a23be6a9b632b364492ce07/src/lib/u64.U64 -> @ipa:0xab9fd5982a23be6a9b632b364492ce07/src/lib/u64.U64 -> @xt:0xab9fd5982a23be6a9b632b364492ce07/src/lib/u64.U64 -> Trap
Decodes an exception exit. ipa is the faulting IPA the host reports and xt the value of the register ISS.SRT names (both as in RawExit).