AMD nested virtualization: Windows Hyper-V guests cannot use hardware acceleration (SVM/NPT not exposed to WSL2)
## Host environment - Operating system: Fedora 43 - OS/kernel version: 6.18.4-200.fc43.x86_64 - Architecture: x86_64 - QEMU flavor: qemu-system-x86_64 - QEMU version: qemu-10.1.3-1.fc43 - QEMU command line: ``` /usr/bin/qemu-system-x86_64 \ -name guest=win11,debug-threads=on \ -S \ -object '{"qom-type":"secret","id":"masterKey0","format":"raw","file":"/var/lib/libvirt/qemu/domain-1-win11/master-key.aes"}' \ -blockdev '{"driver":"file","filename":"/usr/share/edk2/ovmf/OVMF_CODE_4M.secboot.qcow2","node-name":"libvirt-pflash0-storage","auto-read-only":true,"discard":"unmap"}' \ -blockdev '{"node-name":"libvirt-pflash0-format","read-only":true,"driver":"qcow2","file":"libvirt-pflash0-storage","backing":null}' \ -blockdev '{"driver":"file","filename":"/var/lib/libvirt/qemu/nvram/win11_VARS.qcow2","node-name":"libvirt-pflash1-storage","auto-read-only":true,"discard":"unmap"}' \ -blockdev '{"node-name":"libvirt-pflash1-format","read-only":false,"driver":"qcow2","file":"libvirt-pflash1-storage","backing":null}' \ -machine pc-q35-10.1,usb=off,vmport=off,smm=on,dump-guest-core=off,memory-backend=pc.ram,pflash0=libvirt-pflash0-format,pflash1=libvirt-pflash1-format,hpet=off,acpi=on \ -accel kvm \ -cpu 'host,migratable=off,topoext=on,monitor=off,perfctr-core=off,svm=on,npt=on,hv-time=on,hv-relaxed=on,hv-vapic=on,hv-spinlocks=0xfff,hv-vendor-id=Microsoft Lv,kvm=off,host-cache-info=on,l3-cache=off' \ -global driver=cfi.pflash01,property=secure,value=on ``` ## Emulated/Virtualized environment - Operating system: Windows 11 25H2 - OS/kernel version: Version 10.0.26200 Build 26200 - Architecture: x86_x64 ## Description of problem On AMD Zen 4 (Ryzen 9 7950X), QEMU 10.1.3 fails to expose the necessary architectural features to allow a Windows 11 guest to use nested virtualization. ![image.png](/uploads/b2de2db7571ef48e196d10cc54b8775b/image.png){width="852" height="600"} ## Steps to reproduce 1. Download the latest Windows 11 ISO and create a Windows 11 VM 2. Install WSL 3. Install the default distro (should work with any) 4. Reboot 5. Launch WSL 6. You'll get a message saying Nested virtualization is not supported (screenshot above). ## Additional information ### From WSL inside Windows on KVM on Fedora 43 `tester@DESKTOP-5E949KG:~$ cat /proc/cpuinfo processor : 0 vendor_id : AuthenticAMD cpu family : 25 model : 97 model name : AMD Ryzen 9 7950X 16-Core Processor stepping : 2 microcode : 0xffffffff cpu MHz : 4491.531 cache size : 512 KB physical id : 0 siblings : 32 core id : 0 cpu cores : 32 apicid : 0 initial apicid : 0 fpu : yes fpu_exception : yes cpuid level : 13 wp : yes flags : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush mmx fxsr sse sse2 ht syscall nx mmxext fxsr_opt pdpe1gb rdtscp lm rep_good nopl cpuid extd_apicid tsc_known_freq pni pclmulqdq ssse3 fma cx16 sse4_1 sse4_2 movbe popcnt aes xsave avx f16c rdrand hypervisor lahf_lm cmp_legacy cr8_legacy abm sse4a misalignsse 3dnowprefetch osvw topoext perfctr_core ssbd ibrs ibpb stibp vmmcall fsgsbase bmi1 avx2 smep bmi2 erms avx512f avx512dq rdseed adx smap avx512ifma clflushopt clwb avx512cd sha_ni avx512bw avx512vl xsaveopt xsavec xgetbv1 xsaves avx512_bf16 clzero xsaveerptr arat avx512vbmi umip avx512_vbmi2 gfni vaes vpclmulqdq avx512_vnni avx512_bitalg avx512_vpopcntdq rdpid fsrm bugs : sysret_ss_attrs null_seg spectre_v1 spectre_v2 spec_store_bypass srso ibpb_no_ret bogomips : 8983.06 TLB size : 1024 4K pages clflush size : 64 cache_alignment : 64 address sizes : 48 bits physical, 48 bits virtual power management:` ### From WSL inside Windows on Hyper-V with Windows Host `cat /proc/cpuinfo processor : 0 vendor_id : AuthenticAMD cpu family : 25 model : 97 model name : AMD Ryzen 9 7950X 16-Core Processor stepping : 2 microcode : 0xffffffff cpu MHz : 4491.448 cache size : 1024 KB physical id : 0 siblings : 16 core id : 0 cpu cores : 8 apicid : 0 initial apicid : 0 fpu : yes fpu_exception : yes cpuid level : 13 wp : yes flags : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush mmx fxsr sse sse2 ht syscall nx mmxext fxsr_opt pdpe1gb rdtscp lm rep_good nopl cpuid extd_apicid tsc_known_freq pni pclmulqdq ssse3 fma cx16 sse4_1 sse4_2 movbe popcnt aes xsave avx f16c rdrand hypervisor lahf_lm cmp_legacy svm cr8_legacy abm sse4a misalignsse 3dnowprefetch osvw topoext ssbd ibrs ibpb stibp vmmcall fsgsbase bmi1 avx2 smep bmi2 erms invpcid avx512f avx512dq rdseed adx smap avx512ifma clflushopt clwb avx512cd sha_ni avx512bw avx512vl xsaveopt xsavec xgetbv1 xsaves avx512_bf16 clzero xsaveerptr arat npt nrip_save vmcb_clean flushbyasid decodeassists pausefilter pfthreshold v_vmsave_vmload avx512vbmi umip avx512_vbmi2 gfni vaes vpclmulqdq avx512_vnni avx512_bitalg avx512_vpopcntdq rdpid fsrm bugs : sysret_ss_attrs null_seg spectre_v1 spectre_v2 spec_store_bypass srso bogomips : 8982.89 TLB size : 3584 4K pages clflush size : 64 cache_alignment : 64 address sizes : 48 bits physical, 48 bits virtual power management:` **Logs:** [kvm_log.txt](/uploads/624f5f5760808a13f5ed2826d5738f24/kvm_log.txt) [libvirt_xml.txt](/uploads/98533384dceb7ec8da19a438ff9b0b6d/libvirt_xml.txt) [qemu_log.txt](/uploads/ff879b1ea4be8edebf650c4a641871fd/qemu_log.txt) [qemu_additional_logs_gemini.txt](/uploads/e4b23363eddd1181db93f0309afbcffa/qemu_additional_logs_gemini.txt) **Possibly related (hope not):** * https://bugzilla.redhat.com/show_bug.cgi?id=2184282 | https://issues.redhat.com/browse/RHEL-10090 * https://bugzilla.kernel.org/show_bug.cgi?id=219009 | https://www.phoronix.com/news/Linux-Clear-VMLOAD-VMSAVE-Zen4 <!--The line below ensures that proper tags are added to the issue. Please do not remove it.-->
issue