[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Firmware-enabled split-lock detection causes later crashes in HVM domU


  • To: xen-devel <xen-devel@xxxxxxxxxxxxxxxxxxxx>
  • From: Marek Marczykowski-Górecki <marmarek@xxxxxxxxxxxxxxxxxxxxxx>
  • Date: Fri, 27 Nov 2026 15:00:48 +0100
  • Authentication-results: eu.smtp.expurgate.cloud; dkim=pass header.s=fm3 header.d=invisiblethingslab.com header.i="@invisiblethingslab.com" header.h="Content-Type:Date:From:Message-ID:MIME-Version:Subject:To"; dkim=pass header.s=fm3 header.d=messagingengine.com header.i="@messagingengine.com" header.h="Content-Type:Date:Feedback-ID:From:Message-ID:MIME-Version:Subject:To:X-ME-Proxy:X-ME-Sender"
  • Delivery-date: Fri, 27 Nov 2026 14:01:11 +0000
  • Dkim2-signature: i=1; m=1; t=1795788051; d=invisiblethingslab.com; mf=PG1hcm1hcmVrQGludmlzaWJsZXRoaW5nc2xhYi5jb20+; rt=PHhlbi1kZXZlbEBsaXN0cy54ZW5wcm9qZWN0Lm9yZz4=; s=fm3:rsa-sha256:iuPta0JwtYN8ouqPJ/vpXM/jJX1zuEz+M40Mq19r/pTN5Ec f36z/tY/hgQ6TfXM5cXJtMTB1HtXcih1GasP9XyBUagp44KTBiuMGAEHuK6rIvck HyGE1qadEXALYoWTwrnouInT8NBJ1lygNDOJngIOE+SIpT1tYtu/I+xNxPeMtT1C 2w3NKUw22QjBTSsNW32p4YwbGGg+/ifgZ3F8Uki9QpJ/xNS712bblG4oyXlDZM8c zdzWF4KdpgwjIXdIBUNYvO+4cRxGuJUviEVGHd+TZzNc+/5EyIatZZ2468Nehdst QleAcfrJUCRSVJ28UYPo6S9CkfHaqTNKYG2ySUQ==;
  • Feedback-id: i1568416f:Fastmail
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>
  • Message-instance: m=1; h=sha256:1nze9qCrLMzOr73h71KmcXZVIBmQYxeXWK40WG9BcW0=:KD4nxzrTwFZc/QouoX0LSpETIBhJmTU5upUErTkKWJw=;

Hi,

I'm forwarding analysis I've got in qubes issues. Looks like something
that either Xen should turn off, or handle better (as KVM and VirtualBox
supposedly do).

----- Forwarded message -----

hippalectryon-0 left a comment (QubesOS/qubes-issues#11300)

@loftlifter31 Thanks for the logs. This is probably not memory corruption. The 
three crashes with parameters (dump2, dump3 and the one in hypervisor.log) all 
fail at the same instruction with the same second parameter across separate 
boots, and dump2 and dump3 show `nt!KiAlignmentFault` (the alignment fault 
handler) on the stack. dump1 has the same fault code, in `KiInsertQueueDpc` 
(its stack is cut short). On x86, normal alignment checks only apply to user 
mode, so an alignment fault in kernel mode points to split-lock detection: the 
CPU traps a locked access that crosses a cache line. Xen passes that trap into 
the guest, and Windows crashes. KVM (in its default mode) handles it on the 
host instead, and VirtualBox seems to as well, which would explain why Windows 
runs fine in VirtualBox on Debian.

Xen never turns split-lock detection off, so whatever turned it on before Xen 
started stays in effect. My guess is Heads: it boots Linux first, then kexecs 
into Xen. Linux turns split-lock detection on by default on Tiger Lake, Alder 
Lake and Raptor Lake, and doesn't turn it off before kexec. The 
`split_lock_detect=off` you added goes to the dom0 kernel, which can't change 
this setting under Xen. This would fit the forum reports (Alder/Raptor Lake on 
Dasharo+Heads), though one of them says Dasharo UEFI crashed too, so Heads may 
not be the only way it gets turned on.

Could you try, in order:

1. In any Linux qube (no reboot needed), run:
```
timeout 10 python3 -c 'import mmap,ctypes as c
m=mmap.mmap(-1,4096,prot=7);m.write(bytes.fromhex("f0480fba2f00c3"))
f=c.CFUNCTYPE(None,c.c_void_p)(c.addressof(c.c_char.from_buffer(m)))
b=c.create_string_buffer(256);f((c.addressof(b)+63)//64*64+60);print("no 
split-lock #AC")'; echo "exit: $?"
```
It does one locked write across a cache line. If it prints `no split-lock #AC`, 
split-lock detection is likely off and my theory is likely wrong. If it hangs 
until the timeout (exit 124) or dies with a bus error, it is on; `sudo dmesg | 
grep -i split_lock` in that qube should then show a `took a split_lock trap` 
line.
2. In the Heads recovery shell, `dmesg | grep -i split` and paste whatever it 
prints. This shows whether Heads' Linux turned it on.
3. If you can rebuild Heads, add `split_lock_detect=off` to the Heads kernel 
command line (`CONFIG_LINUX_COMMAND_LINE` in your board's coreboot config), 
reflash, and see if the BSODs stop.

If this is confirmed, the imo fix probably belongs in Xen (turn split-lock 
detection off at boot), not in Heads. The microcode difference (0xbe under Xen, 
0xb8 under Debian) is probably unrelated. `xl dmesg` confirms Xen is started 
via kexec from Heads.

-- 
Reply to this email directly or view it on GitHub:
https://github.com/QubesOS/qubes-issues/issues/11300#issuecomment-7207667716
You are receiving this because you are subscribed to this thread.

Message ID: <QubesOS/qubes-issues/issues/11300/7207667716@xxxxxxxxxx>

----- End forwarded message -----

-- 
Best Regards,
Marek Marczykowski-Górecki
Invisible Things Lab

Attachment: signature.asc
Description: PGP signature


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.