From: "Nikunj A. Dadhania" <nikunj@amd.com>
To: Borislav Petkov <bp@alien8.de>, David Rientjes <rientjes@google.com>
Cc: 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: Tue, 3 Jan 2023 09:07:14 +0530 [thread overview]
Message-ID: <02a2e641-6b6d-e1c5-2c43-8815306d92a0@amd.com> (raw)
In-Reply-To: <Y7M4IzNYBtfEJe6Z@zn.tnic>
On 03/01/23 01:32, Borislav Petkov wrote:
> 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.
Currently, GHCBData[24:63] is unused. If we intend to use the bit range(40bits), GHCB spec
will need to be updated. And probably would not be enough.
> 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.
As the termination request is done using GHCB MSR protocol, exit codes cannot be used.
Regards,
Nikunj
next prev parent reply other threads:[~2023-01-03 3:38 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-01-02 8:38 [PATCH v3] x86/sev: Add SEV-SNP guest feature negotiation support 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
2023-01-03 3:37 ` Nikunj A. Dadhania [this message]
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=02a2e641-6b6d-e1c5-2c43-8815306d92a0@amd.com \
--to=nikunj@amd.com \
--cc=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=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