Re: [PATCH 5/6] x86/virt/tdx: Make TDX module initialize the extensions

Xu Yilun <[email protected]>
Newsgroups org.kernel.vger.kvm,dev.linux.lists.linux-coco,org.kernel.vger.linux-kernel
Message-ID <ao1mE3boGj0Tok2y@yilunxu-OptiPlex-7050>
> Not specifically. Just wondering what it is doing. Like is it the big operation
> to prep the memory, and ADD just hands pages which sit on a list waiting the
> real work?

Yes, TDH.EXT.INIT is the big operation to prep the memory. ADD just hands
pages.


> Or more like a "we think we are good to go" notification from the
> VMM?
> 
> >  I can think of some case that TDH.EXT.MEM.ADD is not
> > needed but the extensions initialization is needed. For example: after
> > an compatible TDX module update.
> > 
> > I may ask the TDX module team to get a better understanding.
> 
> That this is also called during an update just raises further questions to me.
> If is doing initing of the memory, then what happens during an update? I'd
> expect memory would need to be persisted across an update, not initialized. Or

The update of the extensions is just like the basic TDX module update.

			TDX module			The extensions
			=================		=====================
execution memory	SEAM range			Added by TDH.EXT.MEM.ADD

binary loading		P-SEAMLDR.INSTALL		TDH.EXT.INIT

initialization		TDH.SYS.INIT/LP.INIT		TDH.EXT.INIT

resuming state		TDH.SYS.UPDATE			TDH.EXT.INIT
(consume handoff data)


The extensions memory is mainly for their own execution context, code &
data. During update, the execution binary of the extensions must also
be updated to match the new TDX module binary. That means the execution
context is re-built, the memory is re-intialized.

> it is doing something different when called after a TDH.SYS.UPDATE? Does it
> consume the handoff data?

So TDH.EXT.INIT does mostly the same after update, it re-builds the
execution context from scratch. The difference is that it then
consumes the handoff data if any.
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.