Re: [PATCH v3 1/1] x86/tdx: Handle MWAIT, MONITOR and WBINVD

From: Sean Christopherson
Date: Mon Mar 29 2021 - 19:40:01 EST


On Mon, Mar 29, 2021, Andy Lutomirski wrote:
>
> > On Mar 29, 2021, at 4:17 PM, Kuppuswamy Sathyanarayanan <sathyanarayanan.kuppuswamy@xxxxxxxxxxxxxxx> wrote:
> >
> > In non-root TDX guest mode, MWAIT, MONITOR and WBINVD instructions
> > are not supported. So handle #VE due to these instructions
> > appropriately.
>
> Is there something I missed elsewhere in the code that checks CPL?

#GP due to CPL!=0 has priority over VM-Exit, i.e. userspace will get a #GP
directly; there will be no VM-Exit to the TDX Module and thus no #VE.

SDM section "25.1.1 - Relative Priority of Faults and VM Exits".