freenode
Kernel & Low-Level

KVM patch series aims to restore Windows 11 VBS boot on Intel

Advertising mode-based execute control to nested guests made Hyper-V turn on CET, which KVM's nested EPT and enlightened VMCS still do not fully support.

Windows 11 guests that run Hyper-V for virtualization-based security stopped booting on Intel hosts after Linux 7.2, landing in Automatic Repair. The breakage hits setups that rely on HVCI, Credential Guard, or WSL2. AMD hosts are not affected: the same guests still boot there with VBS and guest-mode execute trapping.

Dennis Reußwig traces the failure to KVM advertising mode-based execute control (MBEC) to nested guests. Hyper-V appears to enable Control-flow Enforcement Technology only when it is offered MBEC, or the AMD equivalent. Turning MBEC off lets Windows boot again, as does leaving MBEC on but disabling CET shadow stacks and indirect-branch tracking. Proxmox VE already hides MBEC from the outer guest on older machine versions as a workaround.

Once CET is on, Hyper-V needs two things KVM does not give the outer guest. First, supervisor shadow-stack control for nested extended page tables, a capability KVM has never advertised. With that control, a page-table bit lets the CPU treat a page as a supervisor shadow stack and write it even when the ordinary write bit is clear. Second, the VM-entry and VM-exit controls that load CET state. KVM offers those controls in a normal nested VMCS, but strips them when the enlightened VMCS used by Hyper-V is in play, and does not wire the CET fields of that structure. That matches reports that disabling the enlightened VMCS alone does not restore boot.

Reußwig's series, posted to the kernel list, implements the missing nested-EPT behavior and restores the CET controls and fields for enlightened VMCS users. It also moves KVM's own software bookkeeping out of the page-table bit the CPU now interprets as the shadow-stack permission, and treats that bit like a write permission for dirty logging and TLB flushes. The capability is advertised only when the CPU supports it, KVM supports shadow stacks, and advanced VM-exit information is available so supervisor and user shadow-stack accesses can be told apart. The virtual machine monitor must expose the bit as well; QEMU names it separately.

The series includes KVM selftests for nested shadow-stack permissions, MBEC execute checks, and the CET capabilities Hyper-V reads, with and without the enlightened VMCS. Panayotis Katsaloulis reported the boot failure. Paolo Bonzini had suggested passing the shadow-stack bit of EPT violations through to the memory-management code.