Re: [PATCH v6 7/7] KVM: TDX: Explicitly do WBINVD when no more TDX SEAMCALLs
From: Huang, Kai
Date: Wed Aug 20 2025 - 17:35:49 EST
On Wed, 2025-08-20 at 22:35 +0200, Paolo Bonzini wrote:
> On Wed, Aug 20, 2025 at 1:22 PM Huang, Kai <kai.huang@xxxxxxxxx> wrote:
> > I think one minor issue here is, when CONFIG_INTEL_TDX_HOST is off but
> > CONFIG_KEXEC_CORE is on, there will be no implementation of
> > tdx_cpu_flush_cache_for_kexec(). This won't result in build error,
> > though, because when TDX_HOST is off, KVM_INTEL_TDX will be off too, i.e.,
> > there won't be any caller of tdx_cpu_flush_cache_for_kexec().
> >
> > But this still doesn't look nice?
>
> Why do you need one? It's called tdx_cpu_flush_cache_for_kexec(), you
> don't need it if TDX is disabled.
Sorry I meant the declaration will still be there w/o the function body.
>
> > Btw, the above will provide the stub function when both KEXEC_CORE and
> > TDX_HOST is off, which seems to be a step back too?
>
> Let's just stop here. Are we really wasting this much time discussing
> like 30 characters and 0 bytes of object code?
>
> > To me, it's more straightforward to just rename it to
> > tdx_cpu_flush_cache_for_kexec() and remove the stub:
>
> Sure, just rename the function and let's call it a day. If it was me,
> v6 was good enough.
>
Thanks for your time Paolo!