indicogniBuild a VMM

Lab

System registers and SMCCC IDs

Used in chapter 08.

Take two 32-bit numbers apart field by field: build or decode an SMCCC function ID and see what macvmm answers, and decode an mrs or msr word (or its trap syndrome) into a register name and macvmm's policy for it.

Runs in browser
Two numbers, taken apart by field Top: the SMCCC function ID 0x8400_0008 split into its fields. Bit 31 is 1, a fast call; bit 30 is 0, the 32-bit convention; bits 29 to 24 are 4, the owner "standard secure service calls"; bits 23 to 16 are zero, as they must be; bits 15 to 0 are 8. Owner 4, function 8 is PSCI SYSTEM_OFF, and macvmm powers the VM off with exit code 0. Bottom: the instruction word 0xD53B_9C00 split into its fields: L is 1 (mrs), op0 3, op1 3, CRn 9, CRm 12, op2 0, Rt 0. The coordinates (3, 3, 9, 12, 0) name PMCR_EL0, so the word is mrs x0, PMCR_EL0; if it traps, its syndrome is 0x6230_E419 and macvmm injects UNDEF, because the guest was told it has no performance monitor. SMCCC function ID 0x8400_0008 bit 31 bit 30 29..24 23..16 15..0 1 0 4 0x00 0x0008 fast 32-bit owner zero function owner 4, function 8 = PSCI_SYSTEM_OFF: the VM powers off, exit code 0 Instruction word 0xD53B_9C00 L op0 op1 CRn CRm op2 Rt 1 3 3 9 12 0 0 (3, 3, 9, 12, 0) = PMCR_EL0: mrs x0, PMCR_EL0 trap syndrome 0x6230_E419; macvmm injects UNDEF (no PMU)

All labs