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

From: Isaku Yamahata
Date: Wed Mar 15 2023 - 20:31:09 EST


On Tue, Mar 07, 2023 at 03:13:50AM +1300,
Kai Huang <kai.huang@xxxxxxxxx> wrote:

> +static int try_init_module_global(void)
> +{
> + int ret;
> +
> + /*
> + * The TDX module global initialization only needs to be done
> + * once on any cpu.
> + */
> + spin_lock(&tdx_global_init_lock);


If I use tdx_cpu_enable() via kvm hardware_enable_all(), this function is called
in the context IPI callback and the lockdep complains. Here is my patch to
address it