Repository navigation
qemu: fix Windows installs stalling on USB storage timeouts - #7971
Merged
Merged
Conversation
QEMU's usb-storage could park a status (CSW) request that arrived while a command was completing and never answer it, so the guest timed out the transfer after 10 s, reset the device and retried. The window is narrow, but with the HVF in-kernel GICv3 from 5.0.7 Windows queues the CSW fast enough to hit it on nearly every burst of reads: installing from the default USB CD copied its files in ~1230 s instead of ~160 s. Pick up the fix from the UTM QEMU fork (ae92cdc41f), which releases the SCSI request before completing the packet. The install now copies its files in ~135 s with the in-kernel GIC. Resolves #7970 Assisted-by: Claude:claude-opus-5-5
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
5.0.7 enabled the Hypervisor.framework in-kernel GICv3 for QEMU VMs. That exposed a latent race in QEMU's usb-storage: when a command completed, the guest's already-queued status (CSW) request could be handled re-entrantly while the request was still marked in flight. It was then parked and never answered. Windows times out USB storage transfers after 10 s, so an install from the default USB CD stalled ~10 s after every burst of reads (endpoint stop, device reset, retry). The emulated GIC was slow enough to dodge the window most of the time; the in-kernel GIC hits it on nearly every burst.
This picks up the fix from the UTM QEMU fork (utmapp/qemu@ae92cdc41f), which releases the SCSI request before completing the packet.
Measured on the "Installing Windows" copy phase of a Windows 11 24H2 ARM64 install from a USB CD:
-machine kernel-irqchip=offResolves #7970
Testing: Tested by a human on macOS 27.0, Apple M3. The author acknowledges that this change has been tested and/or reviewed by a human in accordance with UTM's AI contribution guidelines.