mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Borislav Petkov <bp@alien8.de>
To: "Nikunj A. Dadhania" <nikunj@amd.com>
Cc: David Rientjes <rientjes@google.com>,
	linux-kernel@vger.kernel.org, x86@kernel.org,
	kvm@vger.kernel.org, mingo@redhat.com, tglx@linutronix.de,
	dave.hansen@linux.intel.com, seanjc@google.com,
	pbonzini@redhat.com, thomas.lendacky@amd.com,
	michael.roth@amd.com, stable@kernel.org
Subject: Re: [PATCH v3] x86/sev: Add SEV-SNP guest feature negotiation support
Date: Mon, 2 Jan 2023 21:02:11 +0100	[thread overview]
Message-ID: <Y7M4IzNYBtfEJe6Z@zn.tnic> (raw)
In-Reply-To: <45487a87-764a-7ff3-292b-4a55fe29f7ba@amd.com>

On Mon, Jan 02, 2023 at 08:50:23PM +0530, Nikunj A. Dadhania wrote:
> >> +		/*
> >> +		 * Terminate the boot if hypervisor has enabled any feature
> >> +		 * lacking guest side implementation.
> >> +		 */
> >> +		if (sev_status & SNP_FEATURES_IMPL_REQ & ~SNP_FEATURES_PRESENT)
> >> +			sev_es_terminate(SEV_TERM_SET_GEN, GHCB_SNP_FEAT_NOT_IMPLEMENTED);
> > 
> > We can't help out by specifying which feature(s)?
> 
> The purpose of SNP_FEATURES_PRESENT is just that, at present no features that need guest 
> implementation is part of the kernel. For e.g. I will be posting patches with SecureTSC 
> enabled, that will make the following change.

I think what David means is, can we have sev_es_terminate() say exactly which
feature wasn't implemented instead of users having to dig out which one exactly
wasn't by trying to find out what their SNP_FEATURES_IMPL_REQ and
SNP_FEATURES_PRESENT masks are.

Looking at the GHCB protocol, where GHCB_SNP_FEAT_NOT_IMPLEMENTED reason code
goes is GHCBData[23:16] which is not enough... And the VMSA has SEV_FEATURES but
that's guest-only.

I guess we need a way to communicate those masks in a more user-friendly way so
that it is exactly clear because of which missing feature(s) has the guest
terminated.

Hmm.

-- 
Regards/Gruss,
    Boris.

https://people.kernel.org/tglx/notes-about-netiquette

  parent reply	other threads:[~2023-01-02 20:02 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-01-02  8:38 Nikunj A Dadhania
2023-01-02 11:23 ` David Rientjes
2023-01-02 15:20   ` Nikunj A. Dadhania
2023-01-02 19:42     ` Borislav Petkov
2023-01-03  3:25       ` Nikunj A. Dadhania
2023-01-02 20:02     ` Borislav Petkov [this message]
2023-01-03  3:37       ` Nikunj A. Dadhania
2023-01-03 11:29         ` Borislav Petkov
2023-01-03 23:25           ` David Rientjes
2023-01-03 13:40 ` Borislav Petkov
2023-01-04  4:26   ` Nikunj A. Dadhania

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=Y7M4IzNYBtfEJe6Z@zn.tnic \
    --to=bp@alien8.de \
    --cc=dave.hansen@linux.intel.com \
    --cc=kvm@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=michael.roth@amd.com \
    --cc=mingo@redhat.com \
    --cc=nikunj@amd.com \
    --cc=pbonzini@redhat.com \
    --cc=rientjes@google.com \
    --cc=seanjc@google.com \
    --cc=stable@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®