[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <CAGtprH-z8bgHQoLiTjnVNK7AK9p0CioFHRRdCKOW5g6j7fO=4g@mail.gmail.com>
Date: Wed, 29 Jan 2025 10:35:57 -0800
From: Vishal Annapurve <vannapurve@...gle.com>
To: Sean Christopherson <seanjc@...gle.com>
Cc: "Kirill A. Shutemov" <kirill@...temov.name>, Dave Hansen <dave.hansen@...el.com>, x86@...nel.org,
linux-kernel@...r.kernel.org, pbonzini@...hat.com, erdemaktas@...gle.com,
ackerleytng@...gle.com, jxgao@...gle.com, sagis@...gle.com, oupton@...gle.com,
pgonda@...gle.com, dave.hansen@...ux.intel.com, linux-coco@...ts.linux.dev,
chao.p.peng@...ux.intel.com, isaku.yamahata@...il.com
Subject: Re: [PATCH 1/1] x86/tdx: Route safe halt execution via tdx_safe_halt
On Wed, Jan 29, 2025 at 6:00 AM Sean Christopherson <seanjc@...gle.com> wrote:
>
> ...
> >
> > I've asked (some time ago) TDX module folks to provide interruptibility
> > state as part of the guest so we can handle STI shadow properly, not as a
> > hack around HLT.
> >
> > The immediate problem can be addressed by fixing the BIOS to not advertise
> > C-states (if I read the situation right).
>
> No, something like Vishal proposed is a better fix. It's still desirable for the
> vCPU to call out to the hypervisor when going idle, otherwise a vCPU that is idle
> for an extended duration will never let the pCPU go idle.
I think Kirill's suggestion will ensure that cpuidle_idle_call() will
invoke default_idle_call() [1] which is correctly patched to call
tdx_safe_halt(), instead of using cpuidle driver subsystem. I am yet
to vet the ACPI cstate configuration for TDX VMs, but unless there is
something critically wrong with exposing cstates to the VM I think
it's better to handle acpi_safe_halt for TDX VMs.
Until there is a better solution to emulate the "sti; hlt;" behavior
for TDX VMs, it's important to deploy warnings as these scenarios are
easy to miss and hard to debug otherwise.
[1] https://elixir.bootlin.com/linux/v6.13/source//kernel/sched/idle.c#L182
Powered by blists - more mailing lists