lkml.org 
[lkml]   [2020]   [Mar]   [20]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH 18/70] x86/boot/compressed/64: Add stage1 #VC handler
On Fri, Mar 20, 2020 at 02:16:39PM -0700, David Rientjes wrote:
> On Thu, 19 Mar 2020, Joerg Roedel wrote:
> > +#define GHCB_SEV_GHCB_RESP_CODE(v) ((v) & 0xfff)
> > +#define VMGEXIT() { asm volatile("rep; vmmcall\n\r"); }
>
> Since preemption and irqs should be disabled before updating the GHCB and
> its MSR and until the contents have been accessed following VMGEXIT,
> should there be checks in place to ensure that's always the case?

Good point, some checking is certainly helpful. Currently it is the
case, because the GHCB is accessed and used only:

1) At boot when only the boot CPU is running

2) In the #VC handler, which does not enable interrupts

3) In the NMI handler, which is also not preemptible

I can also add code to sev_es_get/put_ghcb to make sure these conditions
are met. All this does not prevent the preemption by NMIs, which could
cause another nested #VC exception, but that is handled separatly.


Regards,

Joerg

\
 
 \ /
  Last update: 2020-03-20 23:21    [W:0.076 / U:34.252 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site