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

2021-03-29 Thread Kuppuswamy, Sathyanarayanan
On 3/29/21 3:12 PM, Dave Hansen wrote: On 3/29/21 3:09 PM, Kuppuswamy, Sathyanarayanan wrote: +    case EXIT_REASON_MWAIT_INSTRUCTION: +    /* MWAIT is supressed, not supposed to reach here. */ +    WARN(1, "MWAIT unexpected #VE Exception\n"); +    return -EFAULT; How is MWAIT "

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

2021-03-29 Thread Dave Hansen
On 3/29/21 3:09 PM, Kuppuswamy, Sathyanarayanan wrote: > +    case EXIT_REASON_MWAIT_INSTRUCTION: > +    /* MWAIT is supressed, not supposed to reach here. */ > +    WARN(1, "MWAIT unexpected #VE Exception\n"); > +    return -EFAULT; How is MWAIT "supppressed"?

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

2021-03-29 Thread Kuppuswamy, Sathyanarayanan
On 3/29/21 3:02 PM, Dave Hansen wrote: On 3/29/21 2:55 PM, Kuppuswamy, Sathyanarayanan wrote: MONITOR is a privileged instruction, right?  So we can only end up in here if the kernel screws up and isn't reading CPUID correctly, right? That dosen't seem to me like something we want to suppre

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

2021-03-29 Thread Dave Hansen
On 3/29/21 2:55 PM, Kuppuswamy, Sathyanarayanan wrote: >> >> MONITOR is a privileged instruction, right?  So we can only end up in >> here if the kernel screws up and isn't reading CPUID correctly, right? >> >> That dosen't seem to me like something we want to suppress.  This needs >> a warning, at

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

2021-03-29 Thread Kuppuswamy, Sathyanarayanan
On 3/29/21 10:14 AM, Dave Hansen wrote: On 3/27/21 3:54 PM, Kuppuswamy Sathyanarayanan wrote: + /* +* Per Guest-Host-Communication Interface (GHCI) for Intel Trust +* Domain Extensions (Intel TDX) specification, sec 2.4, +* some instructions that unconditionally

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

2021-03-29 Thread Dave Hansen
On 3/27/21 3:54 PM, Kuppuswamy Sathyanarayanan wrote: > + /* > + * Per Guest-Host-Communication Interface (GHCI) for Intel Trust > + * Domain Extensions (Intel TDX) specification, sec 2.4, > + * some instructions that unconditionally cause #VE (such as WBINVD, > + * MONITOR,

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

2021-03-27 Thread Kuppuswamy Sathyanarayanan
In non-root TDX guest mode, MWAIT, MONITOR and WBINVD instructions are not supported. So handle #VE due to these instructions as no ops. Signed-off-by: Kuppuswamy Sathyanarayanan Reviewed-by: Andi Kleen --- Changes since v1: * Added WARN() for MWAIT #VE exception. Changes since previous seri