QEMU/KVM guests log 'unexpected NMI' and suffer network stalls after host resume with nested KVM enabled
Environment
Host: Debian 12, kernel 6.1, QEMU 7.1, KVM enabled, nested virtualization (intel_iommu + nested=1), guests: multiple Linux VMs with virtio-net, suspended (system suspend) then resumed; nested guests run lightweight workloads
Symptoms
After resuming the host from suspend, affected guests produce kernel logs with 'unexpected NMI' and 'watchdog: hpet' warnings; guest network stalls (incoming packets halted but vNICs remain up), some guests require libvirt restart to restore network I/O. Problem appears only when nested KVM was in use prior to suspend.
Observations
Host dmesg shows VT‑x reinitialization messages; IOMMU mappings present before suspend but not restored identically; QEMU processes still running; restarting libvirtd or restarting the single guest recovers networking. No hardware errors logged. Disabling nested KVM before suspend prevented the issue in tests.
Already attempted
Updated kernel and QEMU, applied latest microcode, toggled SR‑IOV off, tested different sleep states (s2idle vs deep), tried 'virsh managedsave' and restore instead of host suspend (works), captured kernel and libvirt logs around suspend/resume.
Question
What host resume interactions with nested virtualization can cause unexpected NMIs and vNIC stalls inside guests, and what safe configuration changes restore reliable resume without disabling suspend?
Verified community troubleshooting
This commonly comes from VMX/IOMMU state not being restored across host suspend. Easiest safe mitigation: don't suspend the host while nested VMs are active — shut down or migrate them first. For a test workaround, after resume try unloading and reloading the kvm_intel module (sudo modprobe -r kvm_intel && sudo modprobe kvm_intel) — that often reinitializes VMX state and can clear NMIs without rebooting. To verify, resume host, run the unload/reload and watch guest networking; if it recovers, script the module reload on resume and gather logs to report upstream. Beware: unloading kvm while guests are running will fail; shut down guests before module reload.
Incident analysis
Most likely causes
Summary
Suggested Fixes
Continue troubleshooting
Related troubles
Matched from the title, description and tags
- Virtualization25% match
KVM guests suffer one‑way UDP audio loss after nf_conntrack_udp timeout lowered on Linux NAT host
Open1 answer - Linux25% match
Ubuntu 22.04 host suspend/resume breaks LXD container veth interfaces — containers lose external network
Open0 answers - Virtualization24% match
KVM guests' clocks jump forward minutes after host suspend/resume when host uses TSC as RTC and guests use kvmclock
Open0 answers - Virtualization23% match
ESXi guest VM stops receiving external TCP traffic after host kernel hotpatch — vmxnet3 RX stalls while interface stays up
Open0 answers - Virtualization23% match
VM suspended on NFS datastore fails to resume with 'file handle not found' after upgrading ESXi hosts
Open0 answers