public inbox for linux-coco@lists.linux.dev
 help / color / mirror / Atom feed
* 6.18 CVM guest kernel boot issues with non-UEFI bootloader
@ 2026-01-29  3:57 Kevin Hui
  2026-01-30 18:49 ` Tom Lendacky
  0 siblings, 1 reply; 5+ messages in thread
From: Kevin Hui @ 2026-01-29  3:57 UTC (permalink / raw)
  To: linux-coco
  Cc: thomas.lendacky, youngjaelee, hvolkmer, chrisboltz, tzn,
	andrisaar, grobler

Hello,

We’ve been using a non-UEFI bootloader to launch SEV-SNP CVMs and noticed that
there’s an issue with booting the newest 6.18 guest kernel with
the stage0 bootloader (https://github.com/project-oak/oak/tree/main/stage0_bin).
The guest kernel boots successfully with 6.17 and below, but fails with 6.18. We
were able to reproduce this with host kernels 6.13.2 and 6.18.3 on Milan/Genoa
hosts.

We traced the commit that started causing boot issues to
68a501d7fd82454525797971c6a0005ceeb93153 and noticed that for some reason the
variable snp_vmpl was non-zero, even though our stack doesn’t run SVSM. This
triggers the sev_es_terminate() call and subsequently crashes the CVM. We
noticed that the commit removes a supposedly redundant rmpadjust() check, but
from our observations it seems that the failed rmpadjust() short-circuited the
check and avoided the underlying issue.

I was chatting with Tom about this, and taking a deeper look at the issue, we
suspect that the BSS is cleared after the sev_enable() call in
arch/x86/boot/compressed/head_64.S, and that because of this snp_vmpl contains
random junk and is not zeroed. When coming through UEFI, it seems that the BSS
is cleared via drivers/firmware/efi/libstub/x86-stub.c, but in a non-UEFI
bootloader there is no call to startup_64 and so this path is never invoked,
leaving whatever random data was in bss to remain.

Perhaps the proper fix for this is to put the variables that are set as part of
sev_enable() into .data so that both non-UEFI and UEFI bootloaders will have the
same treatment from the kernel, but I would love to hear everyone’s thoughts on
this.

Thanks,
Kevin

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

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

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-01-29  3:57 6.18 CVM guest kernel boot issues with non-UEFI bootloader Kevin Hui
2026-01-30 18:49 ` Tom Lendacky
2026-01-30 20:49   ` Ard Biesheuvel
2026-01-30 22:05     ` Tom Lendacky
2026-01-30 22:12       ` Ard Biesheuvel

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