Re: [PATCH v2 2/5] x86/virt/tdx: Pull kexec cache flush logic into arch/x86

Edgecombe, Rick P
2026-03-31T23:29:55Z

On Tue, 2026-03-31 at 16:04 -0700, Sean Christopherson wrote:
> > Oh, you acked it actually. But I was under the impression that after this
> > patch here, the splat wouldn't be triggered. So it inadvertently fixes it.
>
> Ah, that's why I was a bit confused.  I was assuming tdx_shutdown_cpu() was a
> cpuhp callback, but it's actually an IPI callback.
>
> Hmm, isn't this patch wrong then?  Ah, no, the changelog says:
>
>   However, WBINVD is already generally done at CPU offline as matter of
> course. So don't bother adding TDX specific logic for this, and rely on the
> normal WBINVD to handle it.
>
> What's the "normal" WBINVD?  At the very least, tdx_offline_cpu() should have
> a comment that explicitly calls out where that WBVIND is.

I guess we could add one in tdx_offline_cpu(). Seems reasonable.

>   I assume you're
> referring to the wbinvd() calls in things like hlt_play_dead()?

Yea.

>
> But unless the WBINVD is actually costly, why bother getting fancy?

What is the suggestion to make it less fancy? Just put the wbinvd in
tdx_offline_cpu()? Yea that works too. Probably will get a comment either way.