Re: [RFC PATCH 04/20] x86/virt/tdx: Introduce a "tdx" subsystem and "tsm" device
From: Huang, Kai
Date: Mon Jun 02 2025 - 19:44:27 EST
> static int init_tdx_module(void)
> {
> int ret;
> @@ -1136,6 +1209,8 @@ static int init_tdx_module(void)
>
> pr_info("%lu KB allocated for PAMT\n", tdmrs_count_pamt_kb(&tdx_tdmr_list));
>
> + tdx_subsys_init();
> +
> out_put_tdxmem:
> /*
> * @tdx_memlist is written here and read at memory hotplug time.
The error handling of init_module_module() is already very heavy. Although
tdx_subsys_init() doesn't return any error, I would prefer to putting
tdx_subsys_init() to __tdx_enable() (the caller of init_tdx_module()) so that
init_tdx_module() can just focus on initializing the TDX module.