Kernel KVM virtualization development
 help / color / mirror / Atom feed
From: Jens Neubert <10jens@web.de>
To: kvm@vger.kernel.org
Cc: maz@kernel.org, pbonzini@redhat.com
Subject: Re: Bug Report Linux kvm/qemu: Frequent Boot Issues with Windows 11 ARM64 VMs on NVIDIA DGX Spark due to Potential KVM PMU Migration Issues
Date: Mon, 23 Nov 2026 10:18:58 +0100	[thread overview]
Message-ID: <24b3eb09-e9e1-493e-9b9a-4f7a8090aeb7@web.de> (raw)
In-Reply-To: <af150d64-feff-4ef0-905a-14ab55b074fa@web.de>

Hello,

I am experiencing frequent boot failures when starting Windows 11 ARM64 
VMs on an NVIDIA DGX Spark system with a heterogeneous CPU topology 
(Cortex-A725 and Cortex-X925 clusters).
The failures can consistently be resolved by pinning the vCPU threads to 
a single CPU cluster (using taskset), which points to a PMU migration 
issue between clusters with different PMU types.
I suspect a KVM bug where the PMU state (specifically PMCCNTR) is not 
handled correctly when a vCPU thread migrates between physical CPUs with 
different PMU architecture versions.
My KVM host:
NVIDIA DGX Spark (aarch64)
CPU:
Cluster 0: Cortex-A725 cores (IDs 0–4, 10–14) – PMU type armv8_pmuv3_0
Cluster 1: Cortex-X925 cores (IDs 5–9, 15–19) – PMU type armv8_pmuv3_1

Kernel: 6.17.0-1032-nvidia (Ubuntu 24.04 LTS aarch64)
KVM: Enabled, all relevant performance event and PMU configurations are 
present:

CONFIG_PERF_EVENTS=y
CONFIG_HW_PERF_EVENTS=y
CONFIG_GUEST_PERF_EVENTS=y

Guest VM:

QEMU: 8.2.2 (Debian 1:8.2.2+ds-0ubuntu1.18)
Machine: virt,accel=kvm,gic-version=3,-cpu host
vCPUs: 4 (sockets=1, cores=4, threads=1)
Firmware: EDK2 (latest upstream with LPA2 workarounds)
Operating system: Windows 11 ARM64

During the UEFI boot process, the Windows Boot Manager (bootmgfw.efi) 
calibrates the PMU cycle counter (PMCCNTR).
If a vCPU thread is migrated by the host scheduler from a Cortex-A725 
core to a Cortex-X925 core (or vice versa) while
the guest is accessing the PMU, reading PMCCNTR returns zero. This 
causes the VM to get stuck indefinitely in the
calibration loop (at the TianoCore splash screen).

There is no crash or kernel panic; the guest simply fails to boot.
The issue occurs almost every time (>90% of cold boots), depending on 
the state of the host scheduler.

The same VM boots reliably when the vCPU threads are pinned to cores 
within a single CPU cluster (e.g. taskset -c 5-9,15-19).

Claude suspects (yes, I burned $50 worth of tokens for the analysis) 
that KVM's perf-event context does not survive migration
between CPUs with incompatible PMUs correctly. This could cause the 
virtual PMCCNTR to become inaccessible and return zero
when read.
my QEMU launch command:

swtpm socket --tpm2 --tpmstate dir=$VM/tpm --ctrl 
type=unixio,path=$VM/swtpm-sock --daemon && \
qemu-system-aarch64 \
-name "Windows 11 ARM" \
-machine virt,accel=kvm,gic-version=3 \
-cpu host \
-m 8G \
-smp 4,sockets=1,cores=4,threads=1 \
-drive 
if=pflash,format=raw,readonly=on,file="/usr/share/AAVMF/AAVMF_CODE.ms.fd" \
-drive if=pflash,format=raw,file="$VM/AAVMF_VARS.fd" \
-chardev socket,id=chrtpm,path="$VM/swtpm-sock" \
-tpmdev emulator,id=tpm0,chardev=chrtpm \
-device tpm-tis-device,tpmdev=tpm0 \
-drive 
if=none,id=nvmedisk,format=qcow2,file="$VM/win11-arm.qcow2",cache=writeback,discard=unmap 
\
-device nvme,drive=nvmedisk,serial=WIN11ARM001 \
-device qemu-xhci,id=xhci \
-device usb-tablet \
-device usb-kbd \
-device usb-audio,audiodev=audio0 \
-audiodev pa,id=audio0 \
-netdev 
user,id=net0,hostfwd=tcp:127.0.0.1:3389-:3389,hostfwd=tcp:127.0.0.1:2222-:22,hostfwd=tcp:127.0.0.1:4445-:445 
\
-device virtio-net-pci,netdev=net0 \
-device virtio-serial-pci \
-chardev spicevmc,id=vdagent,name=vdagent \
-device virtserialport,chardev=vdagent,name=com.redhat.spice.0 \
-spice port=5930,addr=127.0.0.1,disable-ticketing=on \
-device virtio-gpu-pci \
-boot order=c \
-qmp unix:/tmp/qmp-win11.sock,server,nowait \
-display gtk,gl=off \
-serial mon:stdio

A725 cores only:
taskset -c 0-4,10-14 qemu-system-aarch64 ...
 > Boots reliably.

X925 cluster only:
taskset -c 5-9,15-19 qemu-system-aarch64 ...
 > Boots reliably.
Without taskset:
qemu-system-aarch64 ...
 > VM usually fails to boot (in more than 90% of cases).

The hang occurs early in the UEFI boot sequence, before the OS loader is 
started.

The issue is independent of firmware patches (LPA2 workarounds). It 
occurs with both original and patched EDK2 builds.

Additionally, I have observed a second, potentially related issue: in 
approximately 20% of cold boots (when launching
with taskset -c ... included), the VM hangs for about 50 seconds after 
the UEFI boot screen with the message "Display
output is not active" and then automatically reboots. Windows boots 
reliably after this unexpected reboot.

I have not investigated this issue in further detail yet.
I can provide serial debug logs, QMP traces, and host-side perf-event 
dumps upon request.


Best regards,
--
Jens Neubert

       reply	other threads:[~2026-11-23  9:19 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <af150d64-feff-4ef0-905a-14ab55b074fa@web.de>
2026-11-23  9:18 ` Jens Neubert [this message]
2026-11-23  9:39 ` Bug Report Linux kvm/qemu: Frequent Boot Issues with Windows 11 ARM64 VMs on NVIDIA DGX Spark due to Potential KVM PMU Migration Issues Marc Zyngier
2026-11-23  9:59   ` Jens Neubert

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=24b3eb09-e9e1-493e-9b9a-4f7a8090aeb7@web.de \
    --to=10jens@web.de \
    --cc=kvm@vger.kernel.org \
    --cc=maz@kernel.org \
    --cc=pbonzini@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox