From: Borislav Petkov <bp@alien8.de>
To: Tianyu Lan <ltykernel@gmail.com>
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 00:48:40 +0200 [thread overview]
Message-ID: <YnmaSB2WCJwqaZae@zn.tnic> (raw)
In-Reply-To: <20220505131502.402259-1-ltykernel@gmail.com>
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.
Thx.
--
Regards/Gruss,
Boris.
https://people.kernel.org/tglx/notes-about-netiquette
next prev parent reply other threads:[~2022-05-09 22:48 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 [this message]
2022-05-10 3:07 ` Tianyu Lan
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=YnmaSB2WCJwqaZae@zn.tnic \
--to=bp@alien8.de \
--cc=Tianyu.Lan@microsoft.com \
--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=ltykernel@gmail.com \
--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=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).