Re: [PATCH v7 06/20] x86/virt/tdx: Shut down TDX module in case of error

From: Thomas Gleixner
Date: Tue Nov 22 2022 - 11:52:27 EST


On Tue, Nov 22 2022 at 07:20, Dave Hansen wrote:
> On 11/22/22 01:20, Peter Zijlstra wrote:
>> Either the Changelog is broken or this TDX crud is worse crap than I
>> thought possible, because the only way to actually meet that requirement
>> as stated is stop_machine().
>
> I think the changelog is broken. I don't see anything in the TDX module
> spec about "the SEMACALL can run concurrently on different CPUs".
> Shutdown, as far as I can tell, just requires that the shutdown seamcall
> be run once on each CPU. Concurrency and ordering don't seem to matter
> at all.

You're right. The 'can concurrently run' thing is for LP.INIT:

4.2.2.
LP-Scope Initialization: TDH.SYS.LP.INIT

TDH.SYS.LP.INIT is intended to perform LP-scope, core-scope and
package-scope initialization of the Intel TDX module. It can be called
only after TDH.SYS.INIT completes successfully, and it can run
concurrently on multiple LPs.