[lkml]   [2021]   [Nov]   [17]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
SubjectRe: [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.

 \ /
  Last update: 2021-11-18 00:24    [W:0.117 / U:0.308 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site