Re: [PATCH V4 4/4] x86/tdx: Remove TDX specific idle routine

From: Vishal Annapurve
Date: Thu Feb 13 2025 - 12:40:55 EST


On Wed, Feb 12, 2025 at 5:03 AM Kirill A. Shutemov <kirill@xxxxxxxxxxxxx> wrote:
>
> On Wed, Feb 12, 2025 at 12:07:47AM +0000, Vishal Annapurve wrote:
> > With explicit dependency on CONFIG_PARAVIRT and TDX specific
> > halt()/safe_halt() routines in place, default_idle() is safe to execute for
> > TDX VMs. Remove TDX specific idle routine override which is now
> > redundant.
>
> I am not convinced that it is good idea.
>
> It adds two needless flipping of IF in the hot path: first enabling
> interrupts in tdx_safe_halt() and disabling it back in default_idle().
>

IIUC, the aspect of flipping IF in the hot path twice is also
applicable to default_idle() that gets executed for non-confidential
VMs. I agree that it's redundant for TDX VMs and if there is strong
consensus here, I can drop this cleanup in the next version.

> --
> Kiryl Shutsemau / Kirill A. Shutemov