From: Connor Kuehl <ckuehl@redhat.com>
To: Tom Lendacky <thomas.lendacky@amd.com>,
qemu-devel@nongnu.org, kvm@vger.kernel.org
Cc: Eduardo Habkost <ehabkost@redhat.com>,
"Michael S . Tsirkin" <mst@redhat.com>,
Marcelo Tosatti <mtosatti@redhat.com>,
Paolo Bonzini <pbonzini@redhat.com>, Jiri Slaby <jslaby@suse.cz>,
Richard Henderson <rth@twiddle.net>
Subject: Re: [PATCH 4/4] sev/i386: Enable an SEV-ES guest based on SEV policy
Date: Wed, 26 Aug 2020 14:07:51 -0500 [thread overview]
Message-ID: <bb74c9ef-4d50-0e81-3444-0643947b4240@redhat.com> (raw)
In-Reply-To: <8390c20d2f7e638d166f7b771c3e11363a7852f6.1598382343.git.thomas.lendacky@amd.com>
On 8/25/20 2:05 PM, Tom Lendacky wrote:
> From: Tom Lendacky <thomas.lendacky@amd.com>
>
> Update the sev_es_enabled() function return value to be based on the SEV
> policy that has been specified. SEV-ES is enabled if SEV is enabled and
> the SEV-ES policy bit is set in the policy object.
>
> Signed-off-by: Tom Lendacky <thomas.lendacky@amd.com>
> ---
> target/i386/sev.c | 4 +++-
> 1 file changed, 3 insertions(+), 1 deletion(-)
>
> diff --git a/target/i386/sev.c b/target/i386/sev.c
> index 5146b788fb..153c2cba2c 100644
> --- a/target/i386/sev.c
> +++ b/target/i386/sev.c
> @@ -70,6 +70,8 @@ struct SevGuestState {
> #define DEFAULT_GUEST_POLICY 0x1 /* disable debug */
> #define DEFAULT_SEV_DEVICE "/dev/sev"
>
> +#define GUEST_POLICY_SEV_ES_BIT (1 << 2)
> +
> /* SEV Information Block GUID = 00f771de-1a7e-4fcb-890e-68c77e2fb44e */
> #define SEV_INFO_BLOCK_GUID "\xde\x71\xf7\x00\x7e\x1a\xcb\x4f\x89\x0e\x68\xc7\x7e\x2f\xb4\x4e"
>
> @@ -374,7 +376,7 @@ sev_enabled(void)
> bool
> sev_es_enabled(void)
> {
> - return false;
> + return (sev_enabled() && (sev_guest->policy & GUEST_POLICY_SEV_ES_BIT));
checkpatch wants these outer parentheses removed :-)
> }
>
> uint64_t
>
next prev parent reply other threads:[~2020-08-26 19:08 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-08-25 19:05 [PATCH 0/4] SEV-ES guest support Tom Lendacky
2020-08-25 19:05 ` [PATCH 1/4] sev/i386: Add initial support for SEV-ES Tom Lendacky
2020-08-26 19:07 ` Connor Kuehl
2020-08-26 19:24 ` Tom Lendacky
2020-08-25 19:05 ` [PATCH 2/4] sev/i386: Allow AP booting under SEV-ES Tom Lendacky
2020-08-26 19:07 ` Connor Kuehl
2020-08-26 19:25 ` Tom Lendacky
2020-08-25 19:05 ` [PATCH 3/4] sev/i386: Don't allow a system reset under an SEV-ES guest Tom Lendacky
2020-08-26 19:07 ` Connor Kuehl
2020-08-25 19:05 ` [PATCH 4/4] sev/i386: Enable an SEV-ES guest based on SEV policy Tom Lendacky
2020-08-26 19:07 ` Connor Kuehl [this message]
2020-08-27 15:53 ` [PATCH 0/4] SEV-ES guest support Tom Lendacky
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=bb74c9ef-4d50-0e81-3444-0643947b4240@redhat.com \
--to=ckuehl@redhat.com \
--cc=ehabkost@redhat.com \
--cc=jslaby@suse.cz \
--cc=kvm@vger.kernel.org \
--cc=mst@redhat.com \
--cc=mtosatti@redhat.com \
--cc=pbonzini@redhat.com \
--cc=qemu-devel@nongnu.org \
--cc=rth@twiddle.net \
--cc=thomas.lendacky@amd.com \
/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;
as well as URLs for NNTP newsgroup(s).