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=1796402472; b=Z/7I4J+/MpdDitIrFJHfdWcoRD+Mfq0ZpqJ0XI7d2L6URwZ/ssfh2nwKlzvko8ISBwqx QISXnnmf24CdNClyLlzuTmrT1ro5wokESHLUSdYuf2RPfJ0heUuYdTj5ciFu2MP7PivI+ ROmeBOy9YBhfWtLoTy19ZlUyPYy4P43PPoNdsFcKMyrsi69/CVSIex5KC/OG0f5H0lAB4 /jJhBIx28MbeHN6R8z/z8Za7gn50sdZaCJfaX94A1Dz9SO6tNNmjI9ZbKSROc+Zb5ZYZU EpjsSTLQ0J3Hwb6ZSPZrmaZq3L2Z7gIFm1QOnabko/ODuI6lHueM4IAu5WYkhEcpF/g== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796402472; h=Received:DKIM-Signature:Message-ID:From:Subject:Reply-To:To:Cc: In-Reply-To:References:Content-Type:Content-Transfer-Encoding:Date; bh=ixrOY7KEqavIraFkolPPA3EmTtw6kCim0RnqfEQ4nTU=; b=ppxPJvOdkCQPdUwUCKFEVM+8hIrrog1E825SBxc6NsEF+kvdh0RgY+W6j7byESyikYJs zfO/+xKupBJzSA0wX+jLCVSy/6lp3kFh5o2SqlIixHNmWK7H0gZzTbF47tWkgYKvB3gLU LofEizoFn/TG9OfdsVtUmXBfiSzUKB6R/e/iDkPva4bKMaJs5ZjomE+aK2A6bxS8qSNlg 9QlqaSep766vHghb9pbErnx9CB+bby/TiJ+ZmJJW6E6/rUREm8nXlQF128dlJ2TUmjmTt 4cH1hu6o6FGXD7tEajGiwPGFfv905WwDDpibhN3kuOXLQvlQQVJsSJ63Bfhb6gAZdug== 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=AVgkoavf; 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 2F71A606A322 for ; Fri, 4 Dec 2026 16:41:12 +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=AVgkoavf Received: by smtp.kernel.org (Postfix) with ESMTPSA id CF8AC1F0092C; Fri, 4 Dec 2026 16:41:11 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1796402472; bh=ixrOY7KEqavIraFkolPPA3EmTtw6kCim0RnqfEQ4nTU=; h=From:Subject:Reply-To:To:Cc:In-Reply-To:References:Date; b=AVgkoavfo2oqkAESrfM0eMybW+Gp5CcioWHOcFKmFyK8RmKBQWPjUP2iQtt8P2kYi 9e66xxSal4r+iWhvQP/3ZIIBi4zNNGIXaQTdSe15/Ejq7H60SJpQ5JfVf3TZkq9x7F XaD3M2Yq5RtmjGS8wjwiXCs5xk+6+mbRDVMjCrOJxnB+TJrYtzJqi45SRG12MbRl9y r5Ppl04zCK+hZJMo4Q/GHSASlBkRpecqMGiX0Eu+/uAwbGFl24wbqkM8LsklYWj4l+ Uzkl29+dd0xWszyf1CsNrWsm+iBeW5hnSYBt7qimIZGaxdpIvu62GC5YKuIWbXW0ZR 0KXj+48X1eG0Q== Message-ID: From: sashiko-bot@kernel.org Subject: Re: [PATCH v2 2/3] x86/sev: Check for SVSM GHCB event support in svsm_setup_ca() 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-7-ardb+git@google.com> References: <20261204154842.414894-5-ardb+git@google.com> <20261204154842.414894-7-ardb+git@google.com> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Date: Fri, 04 Dec 2026 16:41:11 +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: - [Low] x86/sev: wrong termination reason in svsm_setup_ca() on protocol failure -- commit 639cfa984764f41b3b4fc2ff75b221d418a19a04 Author: Ard Biesheuvel x86/sev: Check for SVSM GHCB event support in svsm_setup_ca() This commit moves the GHCB_HV_FT_SNP_MULTI_VMPL hypervisor feature check from the decompressor's sev_enable() into the shared svsm_setup_ca() helper, and moves sev_es_negotiate_protocol() into the shared startup code so it can be called beforehand. > diff --git a/arch/x86/boot/startup/sev-shared.c b/arch/x86/boot/startup/s= ev-shared.c > index d9ac3a929d335..c6648501433e7 100644 > --- a/arch/x86/boot/startup/sev-shared.c > +++ b/arch/x86/boot/startup/sev-shared.c [ ... ] > @@ -722,6 +743,17 @@ static bool __init svsm_setup_ca(const struct cc_blo= b_sev_info *cc_info, > if (!rmpadjust((unsigned long)page, RMP_PG_SIZE_4K, 1)) > return false; > =20 > + /* > + * Running at VMPL0 is required unless an SVSM is present and the > + * hypervisor supports the required SVSM GHCB events. The hypervisor > + * features are only available from GHCB version 2 onward, and this > + * code may run before the GHCB protocol version has been negotiated, > + * so take care of that first. > + */ > + if (!sev_es_negotiate_protocol() || > + !(get_hv_features() & GHCB_HV_FT_SNP_MULTI_VMPL)) > + sev_es_terminate(SEV_TERM_SET_LINUX, GHCB_TERM_NOT_VMPL0); [Severity: Low] Should a sev_es_negotiate_protocol() failure terminate with SEV_TERM_SET_GEN / GHCB_SEV_ES_PROT_UNSUPPORTED instead of GHCB_TERM_NOT_VMPL0? svsm_setup_ca() runs before sev_enable() negotiates the protocol, so a failed negotiation on a non-VMPL0 guest now reports the Linux-specific GHCB_TERM_NOT_VMPL0 reason instead of the standard GHCB code, misleading host diagnostics. Checking !sev_es_negotiate_protocol() separately would preserve the previous termination reason. --=20 Sashiko AI review =C2=B7 https://sashiko.dev/#/patchset/20261204154842.4148= 94-5-ardb+git@google.com?part=3D2