mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Tom Lendacky <thomas.lendacky@amd.com>
To: Joerg Roedel <jroedel@suse.de>
Cc: linux-kernel@vger.kernel.org, x86@kernel.org,
	Thomas Gleixner <tglx@linutronix.de>,
	Ingo Molnar <mingo@redhat.com>, Borislav Petkov <bp@alien8.de>,
	Paolo Bonzini <pbonzini@redhat.com>,
	Jim Mattson <jmattson@google.com>,
	Sean Christopherson <seanjc@google.com>,
	Vitaly Kuznetsov <vkuznets@redhat.com>,
	Wanpeng Li <wanpengli@tencent.com>,
	Brijesh Singh <brijesh.singh@amd.com>
Subject: Re: [PATCH] x86/sev-es: Invalidate the GHCB after completing VMGEXIT
Date: Mon, 17 May 2021 10:05:14 -0500	[thread overview]
Message-ID: <41e721f6-aeef-d334-a5ff-79530d87e4c1@amd.com> (raw)
In-Reply-To: <YKJio9XDepU+CR28@suse.de>

On 5/17/21 7:33 AM, Joerg Roedel wrote:
> Hi Tom,
> 
> On Fri, May 14, 2021 at 02:12:33PM -0500, Tom Lendacky wrote:
>>  arch/x86/kernel/sev-shared.c |  1 +
>>  arch/x86/kernel/sev.c        | 37 ++++++++++++++++++------------------
>>  2 files changed, 20 insertions(+), 18 deletions(-)
> 
> Having this change in one patch is okay. No need to split it up.
> 
>> +static __always_inline void sev_es_put_ghcb(struct ghcb_state *state)
>> +{
>> +	struct sev_es_runtime_data *data;
>> +	struct ghcb *ghcb;
>> +
>> +	data = this_cpu_read(runtime_data);
>> +	ghcb = &data->ghcb_page;
>> +
>> +	if (state->ghcb) {
>> +		/* Restore GHCB from Backup */
>> +		*ghcb = *state->ghcb;
>> +		data->backup_ghcb_active = false;
>> +		state->ghcb = NULL;
>> +	} else {
>> +		vc_ghcb_invalidate(ghcb);
> 
> A comment would be good to explain why the invalidate here is
> necessary.

Ah, good point. I'll add that and send a v2, but I'll wait for further
feedback before sending the next version.

Thanks,
Tom

> 
> Regards,
> 
> 	Joerg
> 

      reply	other threads:[~2021-05-17 15:15 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-05-14 19:12 Tom Lendacky
2021-05-14 19:15 ` Tom Lendacky
2021-05-17 12:33 ` Joerg Roedel
2021-05-17 15:05   ` Tom Lendacky [this message]

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=41e721f6-aeef-d334-a5ff-79530d87e4c1@amd.com \
    --to=thomas.lendacky@amd.com \
    --cc=bp@alien8.de \
    --cc=brijesh.singh@amd.com \
    --cc=jmattson@google.com \
    --cc=jroedel@suse.de \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@redhat.com \
    --cc=pbonzini@redhat.com \
    --cc=seanjc@google.com \
    --cc=tglx@linutronix.de \
    --cc=vkuznets@redhat.com \
    --cc=wanpengli@tencent.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

Powered by JetHome