Re: [PATCH 3/6] x86/virt/tdx: Detect if the extensions initialization is required

Kiryl Shutsemau <[email protected]>
Newsgroups org.kernel.vger.kvm,dev.linux.lists.linux-coco,org.kernel.vger.linux-kernel
Message-ID <aow0zU7mYdpaqBxk@thinkstation>
On Fri, Aug 21, 2026 at 10:22:01PM +0000, Edgecombe, Rick P wrote:
> On Fri, 2026-08-21 at 16:22 +0100, Kiryl Shutsemau wrote:
> > On Fri, Aug 21, 2026 at 11:29:17AM +0800, Xu Yilun wrote:
> > >   static __init int init_tdx_module(void)
> > >   {
> > >   	int ret;
> > > @@ -1229,6 +1253,10 @@ static __init int init_tdx_module(void)
> > >   	if (ret)
> > >   		goto err_reset_pamts;
> > >   
> > > +	ret = init_tdx_module_extensions();
> > > +	if (ret)
> > > +		goto err_reset_pamts;
> > > +
> > 
> > Hm. Don't we need TDH.SYS.SHUTDOWN/DISABLE on error?
> > 
> > Once TDMRs are initialized the module is functional. Yanking PAMT from
> > under it is not safe AFAICS.
> 
> If we reset all the memory, how is it different than bailing halfway when
> initializing the TDMRs? Some special state changes after the last TDMR is
> inited?

Hm. Yeah, it is not special. The module gets SYS_READY after
TDH.SYS.KEY.CONFIG on all CPU. So it is a new problem.

And I think it is not a problem if we never ask TDX module to manipulate
the memory.

-- 
  Kiryl Shutsemau / Kirill A. Shutemov
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.