Skip to content

qemu: fix Windows installs stalling on USB storage timeouts - #7971

Merged
osy merged 1 commit into
mainfrom
fix/usb-storage-csw-stall
Oct 16, 2026
Merged

osy merged 1 commit into
mainfrom
fix/usb-storage-csw-stall

Conversation

@osy

@osy osy commented Oct 16, 2026

Copy link
Copy Markdown
Contributor

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:

Build Copy phase
5.0.6 165 s
5.0.7 ~1230 s
5.0.7 with -machine kernel-irqchip=off 160 s
5.0.7 + this fix ~135 s

Resolves #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.

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
@osy osy added this to the v5.0 milestone Oct 16, 2026
@osy
osy merged commit ba92cf3 into main Oct 16, 2026
36 of 47 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

UTM 5.0.7 Install Windows 11 very slowly

1 participant