From: Borislav Petkov <bp@alien8.de>
To: Changyuan Lyu <changyuanl@google.com>, thomas.lendacky@amd.com
Cc: ardb@kernel.org, dave.hansen@linux.intel.com, kevinhui@meta.com,
linux-kernel@vger.kernel.org, mingo@redhat.com,
stable@vger.kernel.org, tglx@linutronix.de, x86@kernel.org
Subject: Re: [PATCH] x86/boot/sev: Move SEV decompressor variables into the .data section
Date: Thu, 26 Feb 2026 19:22:25 +0000 [thread overview]
Message-ID: <19F7B76A-8DC7-4CA9-9646-90931AF78CD7@alien8.de> (raw)
In-Reply-To: <20260226191612.1962381-1-changyuanl@google.com>
On February 26, 2026 7:16:11 PM UTC, Changyuan Lyu <changyuanl@google.com> wrote:
>On Wed, 4 Feb 2026 09:01:00 -0600, Tom Lendacky <thomas.lendacky@amd.com> wrote
>> As part of the work to remove the dependency on calling into the
>> decompressor code (startup_64()) for a UEFI boot, a call to rmpadjust()
>> was removed from sev_enable() in favor of checking the value of the
>> snp_vmpl variable. When booting through a non-UEFI path and calling
>> startup_64(), the call to sev_enable() is performed before the BSS section
>> is zeroed. With the removal of the rmpadjust() call and the corresponding
>> check of the return code, the snp_vmpl variable is checked. Since the
>> kernel is running at VMPL0, the snp_vmpl variable will not have been set
>> and should be the default value of 0. However, since the call occurs
>> before the BSS is zeroed, the snp_vmpl variable may not actually be zero,
>> which will cause the guest boot to fail.
>>
>> Since the decompressor relocates itself, the BSS would need to be cleared
>> both before and after the relocation, but this would, in effect, cause all
>> of the changes to BSS variables before relocation to be lost after
>> relocation.
>>
>> Instead, move the snp_vmpl variable into the .data section so that it is
>> initialized and the value made safe during relocation. As a pre-caution
>> against future changes, move other SEV-related decompressor variables into
>> the .data section, too.
>>
>> Fixes: 68a501d7fd82 ("x86/boot: Drop redundant RMPADJUST in SEV SVSM presence check")
>> Cc: stable@vger.kernel.org
>> Cc: Ard Biesheuvel <ardb@kernel.org>
>> Tested-by: Kevin Hui <kevinhui@meta.com>
>> Signed-off-by: Tom Lendacky <thomas.lendacky@amd.com>
>
>Reviewed-by: Changyuan Lyu <changyuanl@google.com>
>
>> [...]
Did you test it too to make sure it fixes your issue?
--
Small device. Typos and formatting crap
next prev parent reply other threads:[~2026-02-26 19:22 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-02-04 15:01 Tom Lendacky
2026-02-04 15:54 ` Ard Biesheuvel
2026-02-26 19:16 ` Changyuan Lyu
2026-02-26 19:22 ` Borislav Petkov [this message]
2026-02-26 19:29 ` Changyuan Lyu
2026-02-26 19:38 ` Borislav Petkov
2026-02-27 20:55 ` Borislav Petkov
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=19F7B76A-8DC7-4CA9-9646-90931AF78CD7@alien8.de \
--to=bp@alien8.de \
--cc=ardb@kernel.org \
--cc=changyuanl@google.com \
--cc=dave.hansen@linux.intel.com \
--cc=kevinhui@meta.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@redhat.com \
--cc=stable@vger.kernel.org \
--cc=tglx@linutronix.de \
--cc=thomas.lendacky@amd.com \
--cc=x86@kernel.org \
/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
all inboxes | Powered by JetHome®