-
Epic
-
Resolution: Unresolved
-
Normal
-
None
-
rhel-10.1
-
None
-
Viomem: Windows hybrid shutdown occasionally hangs during hot-unplugging memory
-
Important
-
Bug
-
rhel-virt-windows
-
None
-
False
-
False
-
-
None
-
None
-
None
-
None
-
Unspecified
-
Unspecified
-
Unspecified
-
-
x86_64
*Describe the bug*
We have observed that when performing a memory hot-unplug operation using the viomem driver, if the system is subsequently shut down while the Windows "Fast Startup" (Hybrid Shutdown) feature is enabled, there is a probability that Windows will hang during the shutdown process.
Our further root-cause analysis has identified a specific deadlock condition. The system consistently deadlocks when the following sequence occurs:
1. The device receives a power event, specifically EvtDeviceD0ExitPreInterruptsDisabled.
2. Within the context of this callback, our driver attempts to hot-remove memory by calling MmAllocateNodePagesForMdlEx with the MM_ALLOCATE_AND_HOT_REMOVE flag.
*To Reproduce*
Reproduction Steps:
1. Introduce a 5-second delay in the driver code immediately before the call to MmAllocateNodePagesForMdlEx. This increases the probability that the EvtDeviceD0ExitPreInterruptsDisabled power event will be received before the memory hot-removal operation is executed.
2. Trigger the memory hot-unplug by sending a QMP command to modify the virtio-mem device configuration.
3. Immediately after issuing the QMP command, initiate a Windows Hybrid Shutdown.
Expected Result: The system will consistently hang (deadlock) during the shutdown process with a high probability, requiring a hard reset.
*Expected behavior*
The system must successfully complete a Hybrid Shutdown without hanging, even when a memory hot-unplug operation via viomem is performed concurrently
*VM:*
- Windows version: Win11 24H2
- Which driver has a problem: Viomem
- Driver version or commit hash that was used to build the driver:30003ed7e5c226076bd512a3d14db6d4d0190e19