[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <24726c1c-42a8-e2f2-2222-0676c8a3869f@gmail.com>
Date: Tue, 10 May 2022 11:07:13 +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, dave.hansen@...ux.intel.com, x86@...nel.org,
hpa@...or.com, brijesh.singh@....com, venu.busireddy@...cle.com,
michael.roth@....com, Tianyu.Lan@...rosoft.com,
thomas.lendacky@....com, jroedel@...e.de,
michael.h.kelley@...rosoft.com, linux-hyperv@...r.kernel.org,
linux-kernel@...r.kernel.org, vkuznets@...hat.com,
parri.andrea@...il.com
Subject: Re: [PATCH] x86/Hyper-V: Add SEV negotiate protocol support in
Isolation VM
On 5/10/2022 6:48 AM, Borislav Petkov wrote:
> On Thu, May 05, 2022 at 09:15:02AM -0400, Tianyu Lan wrote:
>> From: Tianyu Lan <Tianyu.Lan@...rosoft.com>
>>
>> Hyper-V Isolation VM code uses sev_es_ghcb_hv_call() to read/write MSR
>> via GHCB page. The SEV-ES guest should negotiate GHCB version before
>> reading/writing MSR via GHCB page.
>
> Why is that?
>
>> Expose sev_es_negotiate_protocol() and sev_es_terminate() from AMD SEV
>> code
>
> Yeah, you keep wanting to expose random SEV-specific code and when we
> go and change it in the future, you'll come complaining that we broke
> hyperv.
>
> I think it might be a lot better if you implement your own functions:
> for example, looking at sev_es_negotiate_protocol() - it uses only
> primitives which you can use because, well, VMGEXIT() is simply a
> wrapper around the asm insn and sev_es_wr_ghcb_msr() is simply writing
> into the MSR.
>
> Ditto for sev_es_terminate().
>
> And sev_es_ghcb_hv_call() too, for that matter. You can define your own.
>
> IOW, you're much better off using those primitives and creating your own
> functions than picking out random SEV-functions and then us breaking
> your isolation VM stuff.
>
OK. I got it. Thanks for your suggestion.
Powered by blists - more mailing lists