[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <YnmaSB2WCJwqaZae@zn.tnic>
Date: Tue, 10 May 2022 00:48:40 +0200
From: Borislav Petkov <bp@...en8.de>
To: Tianyu Lan <ltykernel@...il.com>
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 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.
Thx.
--
Regards/Gruss,
Boris.
https://people.kernel.org/tglx/notes-about-netiquette
Powered by blists - more mailing lists