|
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] Firmware-enabled split-lock detection causes later crashes in HVM domU
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
|
![]() |
Lists.xenproject.org is hosted with RackSpace, monitoring our |