From: Tianyu Lan <ltykernel@gmail.com>
To: Borislav Petkov <bp@alien8.de>
Cc: kys@microsoft.com, haiyangz@microsoft.com,
sthemmin@microsoft.com, wei.liu@kernel.org, decui@microsoft.com,
tglx@linutronix.de, mingo@redhat.com,
dave.hansen@linux.intel.com, x86@kernel.org, hpa@zytor.com,
brijesh.singh@amd.com, venu.busireddy@oracle.com,
michael.roth@amd.com, Tianyu.Lan@microsoft.com,
thomas.lendacky@amd.com, jroedel@suse.de,
michael.h.kelley@microsoft.com, linux-hyperv@vger.kernel.org,
linux-kernel@vger.kernel.org, vkuznets@redhat.com,
parri.andrea@gmail.com
Subject: Re: [PATCH] x86/Hyper-V: Add SEV negotiate protocol support in Isolation VM
Date: Tue, 10 May 2022 11:07:13 +0800 [thread overview]
Message-ID: <24726c1c-42a8-e2f2-2222-0676c8a3869f@gmail.com> (raw)
In-Reply-To: <YnmaSB2WCJwqaZae@zn.tnic>
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@microsoft.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.
prev parent reply other threads:[~2022-05-10 3:07 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-05-05 13:15 [PATCH] x86/Hyper-V: Add SEV negotiate protocol support in Isolation VM Tianyu Lan
2022-05-05 15:47 ` Andrea Parri
2022-05-06 6:46 ` Tianyu Lan
2022-05-09 22:48 ` Borislav Petkov
2022-05-10 3:07 ` Tianyu Lan [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=24726c1c-42a8-e2f2-2222-0676c8a3869f@gmail.com \
--to=ltykernel@gmail.com \
--cc=Tianyu.Lan@microsoft.com \
--cc=bp@alien8.de \
--cc=brijesh.singh@amd.com \
--cc=dave.hansen@linux.intel.com \
--cc=decui@microsoft.com \
--cc=haiyangz@microsoft.com \
--cc=hpa@zytor.com \
--cc=jroedel@suse.de \
--cc=kys@microsoft.com \
--cc=linux-hyperv@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=michael.h.kelley@microsoft.com \
--cc=michael.roth@amd.com \
--cc=mingo@redhat.com \
--cc=parri.andrea@gmail.com \
--cc=sthemmin@microsoft.com \
--cc=tglx@linutronix.de \
--cc=thomas.lendacky@amd.com \
--cc=tiala@microsoft.com \
--cc=venu.busireddy@oracle.com \
--cc=vkuznets@redhat.com \
--cc=wei.liu@kernel.org \
--cc=x86@kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).