Virtuozzo QEMU development (svt-core@virtuozzo.com)
 help / color / mirror / Atom feed
From: "Denis V. Lunev" <den@openvz.org>
To: svt-core@virtuozzo.com
Cc: andrey.drobyshev@virtuozzo.com, "Denis V. Lunev" <den@openvz.org>
Subject: [PATCH 0/2] UefiCpuPkg/MpInitLib: recover from a lost Start-up IPI #VSTOR-146639
Date: Mon, 21 Sep 2026 17:44:04 +0200	[thread overview]
Message-ID: <20260921154406.1628753-1-den@openvz.org> (raw)

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


             reply	other threads:[~2026-09-21 15:44 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-09-21 15:44 Denis V. Lunev [this message]
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

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=20260921154406.1628753-1-den@openvz.org \
    --to=den@openvz.org \
    --cc=andrey.drobyshev@virtuozzo.com \
    --cc=svt-core@virtuozzo.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