Re: [PATCH 1/1] x86/tdx: Route safe halt execution via tdx_safe_halt
From: Kirill A. Shutemov
Date: Wed Jan 29 2025 - 05:37:47 EST
On Tue, Jan 28, 2025 at 09:36:52PM +0000, Vishal Annapurve wrote:
> Direct HLT instruction execution causes #VEs for TDX VMs which is routed
> to hypervisor via tdvmcall. This process renders HLT instruction
> execution inatomic, so any preceeding instructions like STI/MOV SS will
> end up enabling interrupts before the HLT instruction is routed to the
> hypervisor. This creates scenarios where interrupts could land during
> HLT instruction emulation without aborting halt operation leading to
> idefinite halt wait times.
>
> x86_idle is already upgraded to invoke tdx_safe_halt to avoid such
> scenarios, but it didn't cover pvnative_safe_halt which can be invoked
> using raw_safe_halt from call sites like acpi_safe_halt (acpi_pm
> subsystem). This patch upgrades the safe_halt executions to use
> tdx_safe_halt.
The question is why acpi_safe_halt() is ever called.
It only supposed to be called if the CPU supports C-states. See
pr->flags.power check in acpi_processor_power_init().
pr->flags.power is zero for me.
Maybe your BIOS is broken and enumerates C-states. I don't see how
C-states make sense for VMs.
--
Kiryl Shutsemau / Kirill A. Shutemov