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

From: Kuppuswamy, Sathyanarayanan
Date: Tue Mar 30 2021 - 13:04:06 EST




On 3/30/21 8:10 AM, Dave Hansen wrote:
On 3/30/21 8:00 AM, Andi Kleen wrote:
+ /* MWAIT is not supported in TDX platform, so suppress it */
+ setup_clear_cpu_cap(X86_FEATURE_MWAIT);
In fact, MWAIT bit returned by CPUID instruction is zero for TD guest. This
is enforced by SEAM module.
Good point.
Do we still need to safeguard it by setup_clear_cpu_cap() here?
I guess it doesn't hurt to do it explicitly.

If this MWAIT behavior (clearing the CPUID bit) is part of the guest
architecture, then it would also be appropriate to WARN() rather than
silently clearing the X86_FEATURE bit.
Makes sense. It will be useful to find the problem with TDX Module.


--
Sathyanarayanan Kuppuswamy
Linux Kernel Developer