[lkml]   [2022]   [Jun]   [13]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
SubjectRe: [PATCH 21/36] x86/tdx: Remove TDX_HCALL_ISSUE_STI
On Wed, Jun 8, 2022 at 10:48 PM Peter Zijlstra <> wrote:
> Now that arch_cpu_idle() is expected to return with IRQs disabled,
> avoid the useless STI/CLI dance.
> Per the specs this is supposed to work, but nobody has yet relied up
> this behaviour so broken implementations are possible.

I'm totally newbie here.

The point of safe_halt() is that STI must be used and be used
directly before HLT to enable IRQ during the halting and stop
the halting if there is any IRQ.

In TDX case, STI must be used directly before the hypercall.
Otherwise, no IRQ can come and the vcpu would be stalled forever.

Although the hypercall has an "irq_disabled" argument.
But the hypervisor doesn't (and can't) touch the IRQ flags no matter
what the "irq_disabled" argument is. The IRQ is not enabled during
the halting if the IRQ is disabled before the hypercall even if

The "irq_disabled" argument is used for workaround purposes:

Hope my immature/incorrect reply elicits a real response from


 \ /
  Last update: 2022-06-13 10:26    [W:0.484 / U:3.164 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site