[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <00946764-7fe0-675f-7b3e-9fb3b8e3eb89@gmail.com>
Date: Fri, 22 Oct 2021 21:39:48 +0800
From: Tianyu Lan <ltykernel@...il.com>
To: Borislav Petkov <bp@...en8.de>
Cc: kys@...rosoft.com, haiyangz@...rosoft.com, sthemmin@...rosoft.com,
wei.liu@...nel.org, decui@...rosoft.com, tglx@...utronix.de,
mingo@...hat.com, x86@...nel.org, hpa@...or.com,
dave.hansen@...ux.intel.com, luto@...nel.org, peterz@...radead.org,
davem@...emloft.net, kuba@...nel.org, gregkh@...uxfoundation.org,
arnd@...db.de, brijesh.singh@....com, jroedel@...e.de,
Tianyu.Lan@...rosoft.com, thomas.lendacky@....com,
rientjes@...gle.com, pgonda@...gle.com, akpm@...ux-foundation.org,
kirill.shutemov@...ux.intel.com, rppt@...nel.org,
saravanand@...com, aneesh.kumar@...ux.ibm.com, hannes@...xchg.org,
tj@...nel.org, michael.h.kelley@...rosoft.com,
linux-arch@...r.kernel.org, linux-hyperv@...r.kernel.org,
linux-kernel@...r.kernel.org, netdev@...r.kernel.org,
vkuznets@...hat.com, konrad.wilk@...cle.com, hch@....de,
robin.murphy@....com, joro@...tes.org, parri.andrea@...il.com,
dave.hansen@...el.com
Subject: Re: [PATCH V8 5/9] x86/sev-es: Expose sev_es_ghcb_hv_call() to call
ghcb hv call out of sev code
On 10/22/2021 12:22 AM, Borislav Petkov wrote:
> On Thu, Oct 21, 2021 at 11:41:05AM -0400, Tianyu Lan wrote:
>> diff --git a/arch/x86/kernel/sev-shared.c b/arch/x86/kernel/sev-shared.c
>> index ea9abd69237e..368ed36971e3 100644
>> --- a/arch/x86/kernel/sev-shared.c
>> +++ b/arch/x86/kernel/sev-shared.c
>> @@ -124,10 +124,9 @@ static enum es_result verify_exception_info(struct ghcb *ghcb, struct es_em_ctxt
>> return ES_VMM_ERROR;
>> }
>>
>> -static enum es_result sev_es_ghcb_hv_call(struct ghcb *ghcb,
>> - struct es_em_ctxt *ctxt,
>> - u64 exit_code, u64 exit_info_1,
>> - u64 exit_info_2)
>> +enum es_result sev_es_ghcb_hv_call(struct ghcb *ghcb, bool set_ghcb_msr,
>> + struct es_em_ctxt *ctxt, u64 exit_code,
>> + u64 exit_info_1, u64 exit_info_2)
>> {
>> /* Fill in protocol and format specifiers */
>> ghcb->protocol_version = GHCB_PROTOCOL_MAX;
>> @@ -137,7 +136,15 @@ static enum es_result sev_es_ghcb_hv_call(struct ghcb *ghcb,
>> ghcb_set_sw_exit_info_1(ghcb, exit_info_1);
>> ghcb_set_sw_exit_info_2(ghcb, exit_info_2);
>>
>> - sev_es_wr_ghcb_msr(__pa(ghcb));
>> + /*
>> + * Hyper-V unenlightened guests use a paravisor for communicating and
>> + * GHCB pages are being allocated and set up by that paravisor. Linux
>> + * should not change ghcb page pa in such case and so add set_ghcb_msr
>
> "... not change the GHCB page's physical address."
>
> Remove the "so add... " rest.
>
> Otherwise, LGTM.
>
> Do you want me to take it through the tip tree?
Yes, please and this patch is based on the your clean up patch which is
already in the tip sev branch.
Powered by blists - more mailing lists