From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 27FC83AEF49; Wed, 4 Feb 2026 15:58:25 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1770220706; cv=none; b=Q1Fp2loNF+wiIUny6s4pUHG0QAPY8jtczxdql3606JRedE9dYndJdfyvXpGMRFHMj0D7/3irqwmY/UrpZ92AQKgVuetyBfLzOZL5McFi1xQlm87+5euTaWP6lcyADPG9a6OEihA0mxKWhjIThKcHzSeEQp6l7I8ALPR9mMpu7kI= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1770220706; c=relaxed/simple; bh=Qvn7LhXHvLpz9p3S9/cddZZzHsxs6pA4On1GbrqXLcA=; h=MIME-Version:Date:From:To:Cc:Message-Id:In-Reply-To:References: Subject:Content-Type; b=d3t/AWnQiGxsnPXUcsZMeAK1GwOMwzivzfpNsn0zgwTx6gAzuogR/pbs9ZTHxVWyuNzsm0KUgndeu1PVUGijlUmbZfxeSNV6zRZ026+YXH672OPHiraJVILupKUoIODdVujc6zYY+Kz8aNHaKRAv5QmcjYbK9WZoj8ruJxlYY2Y= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=SsTPAZsi; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="SsTPAZsi" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 49F94C19423; Wed, 4 Feb 2026 15:58:25 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1770220705; bh=Qvn7LhXHvLpz9p3S9/cddZZzHsxs6pA4On1GbrqXLcA=; h=Date:From:To:Cc:In-Reply-To:References:Subject:From; b=SsTPAZsiTRKFKTgu7oC4LDQrhun9Jk74R0BVEaO+G6LyaDNP+3+uhvqx+l5Orz8E2 bnvNvArohIr3K97ql+8Ik3UH4WDWZOFMC+o+x1s/iucr3pZ3PESApD6YmbI1L16BmV 2T7+DfGBvkIqPPqjhDiYXZnjp0Gifv6QnTa3YEyLVT8hDzPwUdiOjdY78VGWIIf2ga LwpfbflQV22TmoyYge+mu+m73j58bDDbdnsi6F+K3BW4SYkIIMyT3qUOsrYu1r69Pp YT/FMGsA+MbcZlIgqHZ5ybRsfzRDyuVBeLBYHfy/SPSgzOAWG7WTG19/QMIPK/Nd3t A8UDZVFbAcnog== Received: from phl-compute-01.internal (phl-compute-01.internal [10.202.2.41]) by mailfauth.phl.internal (Postfix) with ESMTP id 4D96DF4006A; Wed, 4 Feb 2026 10:58:24 -0500 (EST) Received: from phl-imap-02 ([10.202.2.81]) by phl-compute-01.internal (MEProxy); Wed, 04 Feb 2026 10:58:24 -0500 X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeefgedrtddtgddukedvkeeiucetufdoteggodetrf dotffvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfurfetoffkrfgpnffqhgenuceu rghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmnecujf gurhepofggfffhvfevkfgjfhfutgfgsehtjeertdertddtnecuhfhrohhmpedftehrugcu uehivghshhgvuhhvvghlfdcuoegrrhgusgeskhgvrhhnvghlrdhorhhgqeenucggtffrrg htthgvrhhnpedvueehiedtvedtleekuddutefgffdtleetfeetveejveejieehfefhjeei jeefudenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepmhgrihhlfhhrohhmpe grrhguodhmvghsmhhtphgruhhthhhpvghrshhonhgrlhhithihqdduieejtdehtddtjeel qdeffedvudeigeduhedqrghruggspeepkhgvrhhnvghlrdhorhhgseifohhrkhhofhgrrh gurdgtohhmpdhnsggprhgtphhtthhopeelpdhmohguvgepshhmthhpohhuthdprhgtphht thhopegsphesrghlihgvnhekrdguvgdprhgtphhtthhopehthhhomhgrshdrlhgvnhgurg gtkhihsegrmhgurdgtohhmpdhrtghpthhtohepgiekieeskhgvrhhnvghlrdhorhhgpdhr tghpthhtohepthhglhigsehlihhnuhhtrhhonhhigidruggvpdhrtghpthhtohepuggrvh gvrdhhrghnshgvnheslhhinhhugidrihhnthgvlhdrtghomhdprhgtphhtthhopehkvghv ihhnhhhuihesmhgvthgrrdgtohhmpdhrtghpthhtohepmhhinhhgohesrhgvughhrghtrd gtohhmpdhrtghpthhtoheplhhinhhugidqkhgvrhhnvghlsehvghgvrhdrkhgvrhhnvghl rdhorhhgpdhrtghpthhtohepshhtrggslhgvsehvghgvrhdrkhgvrhhnvghlrdhorhhg X-ME-Proxy: Feedback-ID: ice86485a:Fastmail Received: by mailuser.phl.internal (Postfix, from userid 501) id 291F1700065; Wed, 4 Feb 2026 10:58:24 -0500 (EST) X-Mailer: MessagingEngine.com Webmail Interface Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Date: Wed, 04 Feb 2026 16:54:23 +0100 From: "Ard Biesheuvel" To: "Tom Lendacky" , linux-kernel@vger.kernel.org, x86@kernel.org Cc: "Thomas Gleixner" , "Ingo Molnar" , "Borislav Petkov" , "Dave Hansen" , stable@vger.kernel.org, "Kevin Hui" Message-Id: <4dfe2339-7899-4469-8957-646d8195b4a4@app.fastmail.com> In-Reply-To: <5648b7de5b0a5d0dfef3785f9582b718678c6448.1770217260.git.thomas.lendacky@amd.com> References: <5648b7de5b0a5d0dfef3785f9582b718678c6448.1770217260.git.thomas.lendacky@amd.com> Subject: Re: [PATCH] x86/boot/sev: Move SEV decompressor variables into the .data section Content-Type: text/plain Content-Transfer-Encoding: 7bit On Wed, 4 Feb 2026, at 16:01, Tom Lendacky 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 > Tested-by: Kevin Hui > Signed-off-by: Tom Lendacky Reviewed-by: Ard Biesheuvel