Re: [PATCH v2 17/21] x86/virt/seamldr: Install a new TDX Module
From: Xu Yilun
Date: Thu Jan 15 2026 - 01:33:08 EST
> static int do_seamldr_install_module(void *params)
> {
> + struct tdx_module_args args = { .rcx = __pa(params) };
Is it better we put the definition, or at least the value assignment in
case TDP_CPU_INSTALL? This pattern always appears here for a seamcall
wrapper but this function is far more complex than that.
And the .rcx = __pa(params) also confuse me a bit. Better we name it
e.g. seamldr_params which looks reasonable for seamcall arguments.
> enum tdp_state newstate, curstate = TDP_START;
> int cpu = smp_processor_id();
> bool primary;
> @@ -297,6 +302,10 @@ static int do_seamldr_install_module(void *params)
> if (primary)
> ret = tdx_module_shutdown();
> break;
> + case TDP_CPU_INSTALL:
> + scoped_guard(raw_spinlock, &seamldr_lock)
> + ret = seamldr_call(P_SEAMLDR_INSTALL, &args);
> + break;
> default:
> break;
> }
> --
> 2.47.3
>