Re: [PATCH v3 06/26] x86/virt/tdx: Prepare to support P-SEAMLDR SEAMCALLs
From: Xu Yilun
Date: Thu Jan 29 2026 - 05:05:25 EST
> > static __always_inline int sc_retry_prerr(sc_func_t func,
> > sc_err_func_t err_func,
> > u64 fn, struct tdx_module_args *args)
> > @@ -96,4 +119,7 @@ static __always_inline int sc_retry_prerr(sc_func_t func,
> > #define seamcall_prerr_ret(__fn, __args) \
> > sc_retry_prerr(__seamcall_ret, seamcall_err_ret, (__fn), (__args))
> >
> > +#define seamldr_prerr(__fn, __args) \
> > + sc_retry_prerr(__seamcall, seamldr_err, (__fn), (__args))
> > +
> > #endif
>
> So, honestly, for me, it's a NAK for this whole patch.
>
> Go change the P-SEAMLDR to use the same error code as the TDX module,
> and fix the documentation. No kernel changes, please.
I'm thinking of ways to avoid a new pseamldr version.
Could we just ask for a unified error code space for both SEAMCALL &
SEAMLDR CALL, eliminating overlaps. There is no overlap now, so this is
just another documentation fix.
Then with all the doc fixes, we only need minor code change:
@@ -127,7 +127,8 @@ static __always_inline u64 sc_retry(sc_func_t func, u64 fn,
preempt_disable();
ret = __seamcall_dirty_cache(func, fn, args);
preempt_enable();
- } while (ret == TDX_RND_NO_ENTROPY && --retry);
+ } while ((ret == TDX_RND_NO_ENTROPY ||
+ ret == SEAMLDR_RND_NO_ENTROPY) && --retry);
I think this is a balance. The existing error code philosophy for SEAM
is as informative as possible, e.g. all kinds of xxx_INVALID,
SEAMLDR_RND_NO_ENTROPY is not that evil among 200+ other error codes.