Virtuozzo QEMU development (svt-core@virtuozzo.com)
 help / color / mirror / Atom feed
* [PATCH 0/2] UefiCpuPkg/MpInitLib: recover from a lost Start-up IPI #VSTOR-146639
@ 2026-09-21 15:44 Denis V. Lunev
  2026-09-21 15:44 ` [PATCH 1/2] UefiCpuPkg: add SendStartupIpi to LocalApicLib #VSTOR-146639 Denis V. Lunev
                   ` (2 more replies)
  0 siblings, 3 replies; 7+ messages in thread
From: Denis V. Lunev @ 2026-09-21 15:44 UTC (permalink / raw)
  To: svt-core; +Cc: andrey.drobyshev, Denis V. Lunev

WaitApWakeup() spins until an AP clears its wakeup signal, with no timeout
and no way out. A hypervisor can lose the Start-up IPI: KVM latches INIT
while the target vCPU is in SMM but discards the SIPI outright. The AP is
left in wait-for-SIPI, the BSP spins forever, and the guest never boots.

Analysis of the live hung guest is in the bug.

Patch 1 exports SendStartupIpi() from LocalApicLib, so one AP can be poked
without an INIT that would reset an AP already running the procedure.
Patch 2 makes WaitApWakeup() resend rather than spin.

Verified by dropping Start-up IPIs in KVM with a kprobe on
kvm_apic_send_ipi(); both firmware binaries are unmodified. Killing one
INIT-SIPI-SIPI sequence hangs the current firmware at all 8 drop points
tried, leaving the APs at CR0=0x00000010. The patched firmware boots at
all 8, issuing exactly one directed Start-up IPI per stranded AP. Without
injection, 80 boots patched against stock show no regression.

Submitted upstream as https://github.com/tianocore/edk2/pull/13164

Denis V. Lunev (2):
  UefiCpuPkg: add SendStartupIpi to LocalApicLib #VSTOR-146639
  UefiCpuPkg/MpInitLib: resend the Start-up IPI when an AP misses it
    #VSTOR-146639

 UefiCpuPkg/Include/Library/LocalApicLib.h     | 19 +++++
 .../Library/BaseXApicLib/BaseXApicLib.c       | 32 +++++--
 .../BaseXApicX2ApicLib/BaseXApicX2ApicLib.c   | 32 +++++--
 UefiCpuPkg/Library/MpInitLib/MpLib.c          | 85 +++++++++++++++++--
 UefiCpuPkg/Library/MpInitLib/MpLib.h          |  2 +
 5 files changed, 153 insertions(+), 17 deletions(-)

-- 
2.53.0


^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2026-09-23 13:30 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-09-21 15:44 [PATCH 0/2] UefiCpuPkg/MpInitLib: recover from a lost Start-up IPI #VSTOR-146639 Denis V. Lunev
2026-09-21 15:44 ` [PATCH 1/2] UefiCpuPkg: add SendStartupIpi to LocalApicLib #VSTOR-146639 Denis V. Lunev
2026-09-23 13:30   ` Andrey Drobyshev
2026-09-21 15:44 ` [PATCH 2/2] UefiCpuPkg/MpInitLib: resend the Start-up IPI when an AP misses it #VSTOR-146639 Denis V. Lunev
2026-09-23 13:30   ` Andrey Drobyshev
2026-09-23 13:30 ` [PATCH 0/2] UefiCpuPkg/MpInitLib: recover from a lost Start-up IPI #VSTOR-146639 Andrey Drobyshev
2026-09-23 13:30   ` Denis V. Lunev

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox