lkml.org 
[lkml]   [2021]   [Nov]   [2]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH v6 14/42] x86/sev: Register GHCB memory when SEV-SNP is active
On Fri, Oct 08, 2021 at 01:04:25PM -0500, Brijesh Singh wrote:
> + /* SEV-SNP guest requires that GHCB must be registered. */
> + if (cc_platform_has(CC_ATTR_SEV_SNP))
> + snp_register_ghcb(data, __pa(ghcb));

This looks like more of that "let's register a GHCB at the time the
first #VC fires".

And there already is setup_ghcb() which is called in the #VC handler.
And that thing registers a GHCB GPA.

But then you have to do it here again.

I think this should be changed together with the CPUID page detection
stuff we talked about earlier, where, after you've established that this
is an SNP guest, you call setup_ghcb() *once* and after that you have
everything set up, including the GHCB GPA. And then the #VC exceptions
can come.

Right?

Or is there a chicken-and-an-egg issue here which I'm not thinking
about?

--
Regards/Gruss,
Boris.

https://people.kernel.org/tglx/notes-about-netiquette

\
 
 \ /
  Last update: 2021-11-02 17:54    [W:0.333 / U:0.336 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site