All of lore.kernel.org
 help / color / mirror / Atom feed
From: sashiko-bot@kernel.org
To: "Kim Phillips" <kim.phillips@amd.com>
Cc: kvm@vger.kernel.org
Subject: Re: [PATCH 1/3] x86/sev: Report distinct termination reasons for generic requests
Date: Tue, 17 Nov 2026 22:45:34 +0000	[thread overview]
Message-ID: <sashiko-outbox-219764@kernel.org> (raw)
In-Reply-To: <20261117223257.748178-2-kim.phillips@amd.com>

Thank you for your contribution! Sashiko AI review found 1 potential
issue to consider:
- [Low] x86/sev: redundant GHCB_TERM_NEGOTIATE reason code in
  setup_ghcb()
--

commit 91d9fc8e8c2597bdeaa888f419992440ce36ac9a
Author: Kim Phillips <kim.phillips@amd.com>

x86/sev: Report distinct termination reasons for generic requests

This commit replaces generic (SEV_TERM_SET_GEN, GHCB_SEV_ES_GEN_REQ)
guest termination calls with specific Linux termination reason codes.

[ ... ]

> diff --git a/arch/x86/coco/sev/core.c b/arch/x86/coco/sev/core.c
> index cc292d7c6fd1e..12152f2fe8c9e 100644
> --- a/arch/x86/coco/sev/core.c
> +++ b/arch/x86/coco/sev/core.c
> @@ -1108,7 +1108,7 @@ void setup_ghcb(void)
>  	 * This gets called only in the BSP boot phase.
>  	 */
>  	if (!sev_es_negotiate_protocol())
> -		sev_es_terminate(SEV_TERM_SET_GEN, GHCB_SEV_ES_GEN_REQ);
> +		sev_es_terminate(SEV_TERM_SET_LINUX, GHCB_TERM_NEGOTIATE);
>  
>  	/*
>  	 * Clear the boot_ghcb. The first exception comes in before the bss

[ ... ]

> diff --git a/arch/x86/include/asm/sev-common.h b/arch/x86/include/asm/sev-common.h
> index 01a6e4dbe4235..3717796c46737 100644
> --- a/arch/x86/include/asm/sev-common.h
> +++ b/arch/x86/include/asm/sev-common.h
> @@ -209,6 +209,9 @@ struct snp_psc_desc {
>  #define GHCB_TERM_SECURE_TSC		10	/* Secure TSC initialization failed */
>  #define GHCB_TERM_SVSM_CA_REMAP_FAIL	11	/* SVSM is present but CA could not be remapped */
>  #define GHCB_TERM_SAVIC_FAIL		12	/* Secure AVIC-specific failure */
> +#define GHCB_TERM_VC_FAIL		13	/* #VC exception handling failure */
> +#define GHCB_TERM_GHCB_SETUP		14	/* GHCB setup/mapping failure */
> +#define GHCB_TERM_NEGOTIATE		15	/* HV GHCB protocol negotiation failure */

[Severity: Low]
Should setup_ghcb() use (SEV_TERM_SET_GEN, GHCB_SEV_ES_PROT_UNSUPPORTED)
instead of introducing GHCB_TERM_NEGOTIATE?

Reason set 0 already defines GHCB_SEV_ES_PROT_UNSUPPORTED for GHCB
protocol negotiation failures, and sev_enable() in
arch/x86/boot/compressed/sev.c uses that pair when the same
sev_es_negotiate_protocol() helper fails.  Using GHCB_TERM_NEGOTIATE here
reports two different termination codes for the same protocol negotiation
failure depending on whether it occurs in the decompressor or the core
kernel.

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/20261117223257.748178-1-kim.phillips@amd.com?part=1

  reply	other threads:[~2026-11-17 22:45 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-17 22:32 [PATCH 0/3] x86/sev: Make guest termination reasons identifiable Kim Phillips
2026-11-17 22:32 ` [PATCH 1/3] x86/sev: Report distinct termination reasons for generic requests Kim Phillips
2026-11-17 22:45   ` sashiko-bot [this message]
2026-11-17 22:32 ` [PATCH 2/3] x86/sev: Report distinct termination reasons in do_vc_no_ghcb() Kim Phillips
2026-11-17 22:32 ` [PATCH 3/3] x86/sev: Distinguish CC-blob failures from generic SNP-unsupported Kim Phillips

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=sashiko-outbox-219764@kernel.org \
    --to=sashiko-bot@kernel.org \
    --cc=kim.phillips@amd.com \
    --cc=kvm@vger.kernel.org \
    --cc=sashiko-reviews@lists.linux.dev \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.