[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20211117232329.GD174703@worktop.programming.kicks-ass.net>
Date: Thu, 18 Nov 2021 00:23:29 +0100
From: Peter Zijlstra <peterz@...radead.org>
To: Sathyanarayanan Kuppuswamy
<sathyanarayanan.kuppuswamy@...ux.intel.com>
Cc: Borislav Petkov <bp@...en8.de>,
Dave Hansen <dave.hansen@...el.com>,
"Kirill A. Shutemov" <kirill@...temov.name>,
Thomas Gleixner <tglx@...utronix.de>,
Ingo Molnar <mingo@...hat.com>,
Andi Kleen <ak@...ux.intel.com>, x86@...nel.org,
linux-kernel@...r.kernel.org,
"Kirill A. Shutemov" <kirill.shutemov@...ux.intel.com>,
Juergen Gross <jgross@...e.com>, Deep Shah <sdeep@...are.com>,
"VMware, Inc." <pv-drivers@...are.com>
Subject: Re: [PATCH] x86/paravirt: Fix build PARAVIRT_XXL=y without XEN_PV
On Wed, Nov 17, 2021 at 03:04:11PM -0800, Sathyanarayanan Kuppuswamy wrote:
> We need PV support to handle halt() and safe_halt() cases.
>
> HLT instruction is generally used in cases like reboot, idle and
> exception fixup handlers.
Which exception calls hlt? Because idle and reboot can easily be done.
> In TDX guest, to support HLT instruction, it has to be emulated using
> a hypercall (aka TDVMCALL).
>
> We have the following three ways to emulate the HLT instruction:
>
> 1. Directly substitute TDVMCALLs in places where we require emulation.
> 2. Use #VE exception handler to emulate it (In TDX guest, executing HLT
> will lead to #VE exception).
> 3. Emulate it using pv_ops
>
> Since option#1 is not a scalable approach, it can be ignored. Option #2
> is also not preferred because, we cannot differentiate between safe
> halt and normal halt use cases in the exception handler.
Would not regs->flags & IF provide clue? I know STI normally has a
shadow, but wouldn't a trap in that shadow still get the flag straight?
I'm sure there's fun bugs around this, but surely TDX is new and doesn't
have these bugs.
Powered by blists - more mailing lists