From 07a2c6db3e94c894fe20bd8b7ffe7fb683307a67 Mon Sep 17 00:00:00 2001 From: Guofang Date: Thu, 29 Oct 2026 13:33:06 +0800 Subject: [PATCH] Skip kernel-irqchip=off when installing with --install-from-img Move the setting from qemu/windows11-darwin-arm64.ini to a -machine option that run-windows11.py adds on macOS arm64 unless --install-from-img is given. The workaround is only needed for usb-storage, which the NVMe install disk does not use, and Setup hangs with the emulated interrupt controller. Co-Authored-By: Claude Sonnet 5.5 --- qemu/windows11-darwin-arm64.ini | 7 ++----- run-windows11.py | 8 ++++++++ windows11-arm64-install-speed.md | 2 +- 3 files changed, 11 insertions(+), 6 deletions(-) diff --git a/qemu/windows11-darwin-arm64.ini b/qemu/windows11-darwin-arm64.ini index 24a69a2..70fa6bf 100644 --- a/qemu/windows11-darwin-arm64.ini +++ b/qemu/windows11-darwin-arm64.ini @@ -7,13 +7,10 @@ [accel] accel = "tcg" -# With the HVF in-kernel GICv3, QEMU's usb-storage races on the status packet -# and Windows Setup stalls 10 s after every burst of reads (utmapp/UTM#7970), -# so use the emulated interrupt controller; upstream QEMU only gets the fix -# from the UTM fork. +# run-windows11.py adds kernel-irqchip=off unless installing with +# --install-from-img (see there). [machine] type = "virt" - kernel-irqchip = "off" # The "virt" machine has no IDE. NVMe and USB mass storage (used by the # installation media of --install-from-iso) both have inbox Windows drivers. diff --git a/run-windows11.py b/run-windows11.py index 7daabd1..ff61a2a 100755 --- a/run-windows11.py +++ b/run-windows11.py @@ -461,6 +461,14 @@ qemu_args += [ "-display", display_backend, # "-display", "none", "-spice", "port=5900,addr=127.0.0.1,disable-ticketing=on,agent-mouse=off", "-device", "virtio-vga", ] +if host_os == "darwin" and host_arch == "arm64" and not install_from_img: + # With the HVF in-kernel GICv3, QEMU's usb-storage races on the status + # packet and Windows Setup stalls 10 s after every burst of reads + # (utmapp/UTM#7970), so use the emulated interrupt controller; upstream + # QEMU only gets the fix from the UTM fork. The NVMe install disk of + # --install-from-img does not use usb-storage, and hangs with the emulated + # controller. + qemu_args += ["-machine", "kernel-irqchip=off"] if installing_from_iso: # q35 has IDE for the installation media; "virt" does not, so use USB. for media_id, media_file, boot_index, ide_bus in ( diff --git a/windows11-arm64-install-speed.md b/windows11-arm64-install-speed.md index fed43fd..2f0ae06 100644 --- a/windows11-arm64-install-speed.md +++ b/windows11-arm64-install-speed.md @@ -6,7 +6,7 @@ ## 结论 - **根因(第五节)**:HVF 的内核态 GICv3 与 QEMU 的 `usb-storage` 有竞态,Windows Setup 每读一批数据就卡约 10 秒。 - 在 `[machine]` 里加 `kernel-irqchip = "off"`(已写入 `qemu/windows11-darwin-arm64.ini`)后, + 由 `run-windows11.py` 加 `-machine kernel-irqchip=off`(`--install-from-img` 时不加)后, **同样走 USB 光驱的 `--install-from-iso` 也变快了**,和 UTM 的速度一致。 - 下面第一到五节是更早的分析:当时把慢归因于"模拟 USB 光驱吞吐低"(平均约 4 MB/s), 这个归因不准确,真实原因是上面的 10 秒停顿;那时测到的低吞吐就是停顿拉低的平均值。