</>EmbeddedInterview

How does hardware virtualization on x86 compare with ARM?

HardVirtualization (QEMU & KVM)

Short answer: Both run the guest kernel natively and trap sensitive operations, but they are structured differently. x86 (Intel VT-x, AMD-V) adds a separate "root" mode with a hardware-managed control structure (VMCS/VMCB) and special VMLAUNCH/VMRESUME/VMEXIT transitions that save and load most state automatically. ARM adds a privilege level (EL2) with its own registers; the hypervisor saves and restores guest state itself, which is more work per switch but gives finer control and is simpler hardware.

Intel VT-x / AMD-V ARMv8 virtualization
Hypervisor mode VMX root mode (all rings exist in both root and non-root) separate exception level EL2
Guest state in the VMCS (Intel) / VMCB (AMD), loaded by hardware on VM entry saved/restored by software in EL2
Enter guest VMLAUNCH/VMRESUME (VMRUN on AMD) ERET from EL2
Exit info exit reason field in VMCS ESR_EL2, FAR_EL2, HPFAR_EL2
Second-stage paging EPT (Intel), NPT (AMD) stage-2 translation, VTTBR_EL2
Interrupts APICv / AVIC, posted interrupts GIC virtual CPU interface, List Registers, GICv4 direct injection
Host kernel in hypervisor mode host runs in root mode ring 0 VHE (ARMv8.1) lets the host kernel run at EL2
I/O MMU VT-d / AMD-Vi SMMU (stage 2)

x86 boot in QEMU, briefly: the pc machine loads SeaBIOS or OVMF (UEFI) at the top of the 4 GB space; the vCPU starts in 16-bit real mode at 0xFFFFFFF0; firmware initialises devices, then loads a bootloader from disk, which loads the kernel. ARM virt can boot the kernel directly or via UEFI.

Why it matters: if you know one architecture, interviewers often check whether you can map the concepts to the other. The common ideas are the same: trap-and-emulate for privileged operations, a second level of address translation, virtual interrupts, and paravirtual I/O.