[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <41e721f6-aeef-d334-a5ff-79530d87e4c1@amd.com>
Date: Mon, 17 May 2021 10:05:14 -0500
From: Tom Lendacky <thomas.lendacky@....com>
To: Joerg Roedel <jroedel@...e.de>
Cc: linux-kernel@...r.kernel.org, x86@...nel.org,
Thomas Gleixner <tglx@...utronix.de>,
Ingo Molnar <mingo@...hat.com>, Borislav Petkov <bp@...en8.de>,
Paolo Bonzini <pbonzini@...hat.com>,
Jim Mattson <jmattson@...gle.com>,
Sean Christopherson <seanjc@...gle.com>,
Vitaly Kuznetsov <vkuznets@...hat.com>,
Wanpeng Li <wanpengli@...cent.com>,
Brijesh Singh <brijesh.singh@....com>
Subject: Re: [PATCH] x86/sev-es: Invalidate the GHCB after completing VMGEXIT
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
>
Powered by blists - more mailing lists