> > +/* > > + * Do the module global initialization once and return its result. > > + * It can be done on any cpu. It's always called with interrupts > > + * disabled. > > + */ > > +static int try_init_module_global(void) > > +{ > > Any particular reason why this function is not called from the tdx > module's tdx_init? It's global and must be called once when the module > is initialised. Subsequently kvm which is supposed to call > tdx_cpu_enable() must be sequenced _after_ tdx which shouldn't be that > hard, no? This will eliminate the spinlock as well. > Do you mean early_initcall(tdx_init)? Because it requires VMXON being done to do SEAMCALL. For now only KVM does VMXON.