Re: [PATCH v2 04/21] x86/virt/tdx: Prepare to support P-SEAMLDR SEAMCALLs

From: Chao Gao

Date: Thu Jan 15 2026 - 00:37:59 EST


>> diff --git a/arch/x86/virt/vmx/tdx/seamcall.h b/arch/x86/virt/vmx/tdx/seamcall.h
>> index 71b6ffddfa40..3f462e58d68e 100644
>> --- a/arch/x86/virt/vmx/tdx/seamcall.h
>> +++ b/arch/x86/virt/vmx/tdx/seamcall.h
>> @@ -14,6 +14,19 @@ u64 __seamcall_saved_ret(u64 fn, struct tdx_module_args *args);
>> typedef u64 (*sc_func_t)(u64 fn, struct tdx_module_args *args);
>> +static inline bool is_seamldr_call(u64 fn)
>> +{
>> + return fn & SEAMLDR_SEAMCALL_MASK;
>> +}
>> +
>> +static inline bool sc_need_retry(u64 fn, u64 error_code)
>> +{
>> + if (is_seamldr_call(fn))
>
>Do we need to have this check, can TDX module seamcall return
>
>value SEAMLDR_RND_NO_ENTROPY but for different reason?

Currently, The TDX module doesn't return SEAMLDR_RND_NO_ENTROPY for any reason,
and I think it probably won't in the future. But it isn't ruled out by the
spec. It's the same situation for P-SEAMLDR returning TDX_RND_NO_ENTROPY. So I
slightly prefer to keep this check.