[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <c9a7eaa8-a8b3-3ed3-c52c-7a2cea3c95bc@gmail.com>
Date: Thu, 10 Jun 2021 22:13:32 +0800
From: Tianyu Lan <ltykernel@...il.com>
To: Joerg Roedel <joro@...tes.org>
Cc: kys@...rosoft.com, haiyangz@...rosoft.com, sthemmin@...rosoft.com,
wei.liu@...nel.org, decui@...rosoft.com, tglx@...utronix.de,
mingo@...hat.com, bp@...en8.de, x86@...nel.org, hpa@...or.com,
arnd@...db.de, dave.hansen@...ux.intel.com, luto@...nel.org,
peterz@...radead.org, akpm@...ux-foundation.org,
kirill.shutemov@...ux.intel.com, rppt@...nel.org,
hannes@...xchg.org, cai@....pw, krish.sadhukhan@...cle.com,
saravanand@...com, Tianyu.Lan@...rosoft.com,
konrad.wilk@...cle.com, hch@....de, m.szyprowski@...sung.com,
robin.murphy@....com, boris.ostrovsky@...cle.com, jgross@...e.com,
sstabellini@...nel.org, will@...nel.org,
xen-devel@...ts.xenproject.org, davem@...emloft.net,
kuba@...nel.org, jejb@...ux.ibm.com, martin.petersen@...cle.com,
iommu@...ts.linux-foundation.org, linux-arch@...r.kernel.org,
linux-hyperv@...r.kernel.org, linux-kernel@...r.kernel.org,
linux-scsi@...r.kernel.org, netdev@...r.kernel.org,
vkuznets@...hat.com, thomas.lendacky@....com,
brijesh.singh@....com, sunilmut@...rosoft.com
Subject: Re: [RFC PATCH V3 01/11] x86/HV: Initialize GHCB page in Isolation VM
Hi Joerg:
Thanks for your review.
On 6/9/2021 8:38 PM, Joerg Roedel wrote:
> On Sun, May 30, 2021 at 11:06:18AM -0400, Tianyu Lan wrote:
>> From: Tianyu Lan <Tianyu.Lan@...rosoft.com>
>>
>> Hyper-V exposes GHCB page via SEV ES GHCB MSR for SNP guest
>> to communicate with hypervisor. Map GHCB page for all
>> cpus to read/write MSR register and submit hvcall request
>> via GHCB.
>>
>> Signed-off-by: Tianyu Lan <Tianyu.Lan@...rosoft.com>
>> ---
>> arch/x86/hyperv/hv_init.c | 60 ++++++++++++++++++++++++++++++---
>> arch/x86/include/asm/mshyperv.h | 2 ++
>> include/asm-generic/mshyperv.h | 2 ++
>> 3 files changed, 60 insertions(+), 4 deletions(-)
>>
>> diff --git a/arch/x86/hyperv/hv_init.c b/arch/x86/hyperv/hv_init.c
>> index bb0ae4b5c00f..dc74d01cb859 100644
>> --- a/arch/x86/hyperv/hv_init.c
>> +++ b/arch/x86/hyperv/hv_init.c
>> @@ -60,6 +60,9 @@ static int hv_cpu_init(unsigned int cpu)
>> struct hv_vp_assist_page **hvp = &hv_vp_assist_page[smp_processor_id()];
>> void **input_arg;
>> struct page *pg;
>> + u64 ghcb_gpa;
>> + void *ghcb_va;
>> + void **ghcb_base;
>
> Any reason you can't reuse the SEV-ES support code in the Linux kernel?
> It already has code to setup GHCBs for all vCPUs.
>
> I see that you don't need #VC handling in your SNP VMs because of the
> paravisor running underneath it, but just re-using the GHCB setup code
> shouldn't be too hard.
>
Thanks for your suggestion. I will have a try to use SEV-ES code.
Powered by blists - more mailing lists