indicogniBuild a VMM

Lab

MMIO trap emulator

Used in chapter 07.

Step real guest loads and stores through chapter 07's path: the exit, the syndrome decode, the bus, the device, then PC + 4; then break it on purpose.

Runs in browser
One trapped load, step by step The guest runs ldrsh x3, [x9] at 0x40081264 with x9 = 0x0b00_0028. That address is not RAM, so the CPU exits to the VMM with ESR_EL2 0x93638006 and IPA 0x0b00_0028. The VMM decodes the syndrome: ISV 1, SAS 1 (2 bytes), SSE 1 (sign-extend), SRT 3, SF 1 (64-bit register), WnR 0 (a load). The bus finds the test device at offset 0x28, which returns 0x8001. Sign-extended to 64 bits that is 0xffff_ffff_ffff_8001, written to x3. The VMM adds 4 to the PC, 0x40081268, and resumes the guest. guest 0x40081264 ldrsh x3, [x9] x9 = 0x0b00_0028 (not RAM) 1 exit ESR_EL2 0x93638006 IPA 0x0b00_0028 2 decode ISV=1 SAS=1 (2 bytes) SSE=1 SRT=3 SF=1 WnR=0 3 find the device testdev, offset 0x28 4 do the access reads 0x8001 x3 = 0xffff_ffff_ffff_8001 5 resume PC + 4 = 0x40081268

All labs