[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <aJ5vz33PCCqtScJa@google.com>
Date: Thu, 14 Aug 2025 16:22:55 -0700
From: Sean Christopherson <seanjc@...gle.com>
To: Kai Huang <kai.huang@...el.com>
Cc: Rick P Edgecombe <rick.p.edgecombe@...el.com>, "kvm@...r.kernel.org" <kvm@...r.kernel.org>,
"ashish.kalra@....com" <ashish.kalra@....com>, Dave Hansen <dave.hansen@...el.com>,
"thomas.lendacky@....com" <thomas.lendacky@....com>, "kas@...nel.org" <kas@...nel.org>,
"mingo@...hat.com" <mingo@...hat.com>, "dwmw@...zon.co.uk" <dwmw@...zon.co.uk>,
"pbonzini@...hat.com" <pbonzini@...hat.com>, Reinette Chatre <reinette.chatre@...el.com>,
Isaku Yamahata <isaku.yamahata@...el.com>, "nik.borisov@...e.com" <nik.borisov@...e.com>,
"tglx@...utronix.de" <tglx@...utronix.de>, "hpa@...or.com" <hpa@...or.com>,
"peterz@...radead.org" <peterz@...radead.org>, "sagis@...gle.com" <sagis@...gle.com>,
Farrah Chen <farrah.chen@...el.com>, "bp@...en8.de" <bp@...en8.de>,
"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
"binbin.wu@...ux.intel.com" <binbin.wu@...ux.intel.com>, Chao Gao <chao.gao@...el.com>,
Dan J Williams <dan.j.williams@...el.com>, "x86@...nel.org" <x86@...nel.org>
Subject: Re: [PATCH v6 7/7] KVM: TDX: Explicitly do WBINVD when no more TDX SEAMCALLs
On Thu, Aug 14, 2025, Kai Huang wrote:
> On Thu, 2025-08-14 at 11:00 -0700, Sean Christopherson wrote:
> > > > > + */
> > > > > + tdx_cpu_flush_cache();
> > > >
> > > > IIUC, this can be:
> > > >
> > > > if (IS_ENABLED(CONFIG_KEXEC))
> > > > tdx_cpu_flush_cache();
> > > >
> > >
> > > No strong objection, just 2 cents. I bet !CONFIG_KEXEC && CONFIG_INTEL_TDX_HOST
> > > kernels will be the minority. Seems like an opportunity to simplify the code.
> >
> > Reducing the number of lines of code is not always a simplification. IMO, not
> > checking CONFIG_KEXEC adds "complexity" because anyone that reads the comment
> > (and/or the massive changelog) will be left wondering why there's a bunch of
> > documentation that talks about kexec, but no hint of kexec considerations in the
> > code.
>
> I think we can use 'kexec_in_progress', which is even better than
> IS_ENABLED(CONFIG_KEXEC) IMHO.
I don't think that will accomplish what you want. E.g. kvm-intel.ko is unloaded
after doing TDX things, while kexec_in_progress=false, and then some time later
a kexec is triggered. In that case, stop_this_cpu() will still get stuck doing
WBINVD.
Powered by blists - more mailing lists