lkml.org 
[lkml]   [2021]   [Mar]   [30]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    /
    SubjectRe: [PATCH v1 1/1] x86/tdx: Handle MWAIT, MONITOR and WBINVD
    From
    Date
    On 3/27/2021 8:18 AM, Kuppuswamy Sathyanarayanan wrote:
    > 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 <sathyanarayanan.kuppuswamy@linux.intel.com>
    > Reviewed-by: Andi Kleen <ak@linux.intel.com>
    > ---
    >
    > Changes since previous series:
    > * Suppressed MWAIT feature as per Andi's comment.
    > * Added warning debug log for MWAIT #VE exception.
    >
    > arch/x86/kernel/tdx.c | 23 +++++++++++++++++++++++
    > 1 file changed, 23 insertions(+)
    >
    > diff --git a/arch/x86/kernel/tdx.c b/arch/x86/kernel/tdx.c
    > index e936b2f88bf6..fb7d22b846fc 100644
    > --- a/arch/x86/kernel/tdx.c
    > +++ b/arch/x86/kernel/tdx.c
    > @@ -308,6 +308,9 @@ void __init tdx_early_init(void)
    >
    > setup_force_cpu_cap(X86_FEATURE_TDX_GUEST);
    >
    > + /* 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.

    Do we still need to safeguard it by setup_clear_cpu_cap() here?

    > +
    > tdg_get_info();
    >
    > pv_ops.irq.safe_halt = tdg_safe_halt;


    \
     
     \ /
      Last update: 2021-03-30 06:58    [W:8.235 / U:0.100 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site