Re: [PATCH v10 05/16] x86/virt/tdx: Add skeleton to enable TDX on demand

From: Huang, Kai
Date: Wed Mar 15 2023 - 22:52:33 EST



> >
> > @@ -356,7 +357,7 @@ static int try_init_module_global(void)
> > * The TDX module global initialization only needs to be done
> > * once on any cpu.
> > */
> > - spin_lock(&tdx_global_init_lock);
> > + raw_spin_lock_irqsave(&tdx_global_init_lock, flags);
>
> As hardware_enable_all() uses cpus_read_lock(), irqsave isn't needed.
> this line should be raw_spin_lock().
>

OK. I missed that in PREEMPT_RT kernel the spinlock is converted to sleeping
lock. So I'll change to use raw_spin_lock() as we talked. Thanks.