From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=100.103.45.18 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1796404265; b=oDjYAMo3TN/eDdHMeAq5iZjSadbt7fucl3UhHb0icAgJJkAEcFdaAacDIaSh+XrgWkfp 3Kg4FPQtQay0lX732hq0PrYhi1dfIUUFlqKCglVDZcti8J696i02s0zU1+zUdTyYGof3M Hsp4vy5Lgw1upXToUgF6+UhiLWp1NuH8BZFk8Z/cKuW8gL0W3FL9pFS3MDUdw5d2ug2qm D6wXGVomjUMMdpvEwd0Ns3zxy2b5Vo6UmKfiWal7BHgADPaFmKVI3G3wzPXlgODWCUeYu eYAcW1UTfY9dh1VNNwGt7AHxeS+vzdBF9MBgklC1R6ZKtMiHHhv6LrGFaxtejM7HFkA== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796404265; h=Received:DKIM-Signature:Message-ID:From:Subject:Reply-To:To:Cc: In-Reply-To:References:Content-Type:Content-Transfer-Encoding:Date; bh=1Vo7LWpbxMtaUq4EnWJj3LuFEZVGd+a8pG+S8eU0Z+w=; b=kNlMJmFM+DmLUUSWLofwPv+fHOG44ytxZVfkdPShgxWSsWkjC/xk6PGDb0G3/oXrZSMX kMF+/yLYUe2oHPdiT7S32ezsomQjMrxRN/GG9XUu/DsQoS19TaeZaC8TP62cmd6BNoh8J js3UwwoBz0btLrAEVOVPahDJgAU/o7BFwW+/roLy/vT/sgiFeYLkZ5KtJZZY6lyoqtDOD H68+B32muKDs9Z83J4fk43hMA9i1rDrDSvAf/pBtG7Zo1WQWnqtNZzZs10/H+PoL+ELOU azmaxEE7sjRFEvi/C9MBkafr5Qdvh7HudQdpTJG1mqQ3Ne/Qtax9pHHiqLgBcE9cluw== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=DMttyHJH; arc=none smtp.remote-ip=100.103.45.18 Received: from smtp.kernel.org (quasi.space.kernel.org [100.103.45.18]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id E9921606A681 for ; Fri, 4 Dec 2026 17:11:04 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=DMttyHJH Received: by smtp.kernel.org (Postfix) with ESMTPSA id 794571F00A2C; Fri, 4 Dec 2026 17:11:04 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1796404264; bh=1Vo7LWpbxMtaUq4EnWJj3LuFEZVGd+a8pG+S8eU0Z+w=; h=From:Subject:Reply-To:To:Cc:In-Reply-To:References:Date; b=DMttyHJH3J5zTmPrwnxbZKoRo1wUhoq1yCk0ySkr+A+utF+9V9iXaNqf3aI9mRKnU ld26ygtnewobvCu32EWoEwSmrmbReuMMEHj7lf9EA1Ml0n6Y074S07EI5v95FoNZjz IvryQ3fHaIWUZx5diVRveLm8UwPA3F6gUfM84YcXpQa5pcPHb8FQRC2CUag904YjXm OSwZWp7TiQAjKv58szjThtkLCn3Tqixr9QrFNkpp9ktLNPOIoCqqIaR1t3b3hgdzDO OVMJY7pW2RD+9tvhROl0i0LkzfnKWzHg1M6xldSSxPHiLshkxO2qt0Fuf9NJqfI3Iw 9Ry/dsyo5Oj7g== Message-ID: From: sashiko-bot@kernel.org Subject: Re: [PATCH v2 3/3] x86/efistub: Don't bother enabling SEV in the EFI stub Reply-To: sashiko-reviews@lists.linux.dev To: "Ard Biesheuvel" , linux-efi@vger.kernel.org Cc: "Ard Biesheuvel" , "Borislav Petkov" , "Tom Lendacky" , "Ashish Kalra" In-Reply-To: <20261204154842.414894-8-ardb+git@google.com> References: <20261204154842.414894-5-ardb+git@google.com> <20261204154842.414894-8-ardb+git@google.com> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Date: Fri, 04 Dec 2026 17:11:04 +0000 X-Mailing-List: linux-efi@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list Thank you for your contribution! Sashiko AI review found 1 potential issue to consider: - [High] x86/efistub: zero sme_me_mask breaks CR3 masking in efi_5level_switch() -- commit 6ed7d1eff8de535daf26e44568a238a0ae556e41 Author: Ard Biesheuvel x86/efistub: Don't bother enabling SEV in the EFI stub This patch removes the sev_enable() call from efi_stub_entry() and its declarations in asm/sev.h, relying on the core kernel's sme_enable() to initialize SEV instead. > diff --git a/drivers/firmware/efi/libstub/x86-stub.c b/drivers/firmware/e= fi/libstub/x86-stub.c > index ebed96c03fa71..3ccc4670b2e12 100644 > --- a/drivers/firmware/efi/libstub/x86-stub.c > +++ b/drivers/firmware/efi/libstub/x86-stub.c > @@ -1047,12 +1047,6 @@ void __noreturn efi_stub_entry(efi_handle_t handle, > goto fail; > } > =20 > - /* > - * Call the SEV init code while still running with the firmware's > - * GDT/IDT, so #VC exceptions will be handled by EFI. > - */ > - sev_enable(boot_params); > - > efi_5level_switch(); [Severity: High] Does removing sev_enable() break CR3 masking in efi_5level_switch() on AMD SEV guests? efi_5level_switch() calls native_read_cr3_pa(), which relies on CR3_ADDR_MASK (__sme_clr(PHYSICAL_PAGE_MASK)) to strip the C-bit from CR3. Without sev_enable(), sme_me_mask stays 0 and physical_mask keeps all 52 bits set since initialize_identity_maps() never runs in the stub. When booting an SEV guest from 5-level UEFI firmware with no5lvl, efi_5level_switch() will dereference cr3[0] with the C-bit still set, causing a fatal page fault during boot. --=20 Sashiko AI review =C2=B7 https://sashiko.dev/#/patchset/20261204154842.4148= 94-5-ardb+git@google.com?part=3D3