Re: [PATCH v12 05/22] x86/virt/tdx: Add SEAMCALL infrastructure

From: Huang, Kai
Date: Wed Jun 28 2023 - 19:31:49 EST


On Wed, 2023-06-28 at 14:50 +0300, kirill.shutemov@xxxxxxxxxxxxxxx wrote:
> On Wed, Jun 28, 2023 at 03:34:05AM +0000, Huang, Kai wrote:
> > On Wed, 2023-06-28 at 11:09 +0800, Chao Gao wrote:
> > > > +/*
> > > > + * Wrapper of __seamcall() to convert SEAMCALL leaf function error code
> > > > + * to kernel error code. @seamcall_ret and @out contain the SEAMCALL
> > > > + * leaf function return code and the additional output respectively if
> > > > + * not NULL.
> > > > + */
> > > > +static int __always_unused seamcall(u64 fn, u64 rcx, u64 rdx, u64 r8, u64
> > > > r9,
> > > > + u64 *seamcall_ret,
> > > > + struct tdx_module_output *out)
> > > > +{
> > > > + u64 sret;
> > > > + int cpu;
> > > > +
> > > > + /* Need a stable CPU id for printing error message */
> > > > + cpu = get_cpu();
> > > > + sret = __seamcall(fn, rcx, rdx, r8, r9, out);
> > > > + put_cpu();
> > > > +
> > > > + /* Save SEAMCALL return code if the caller wants it */
> > > > + if (seamcall_ret)
> > > > + *seamcall_ret = sret;
> > >
> > > Hi Kai,
> > >
> > > All callers in this series pass NULL for seamcall_ret. I am no sure if
> > > you keep it intentionally.
> >
> > In this series all the callers doesn't need seamcall_ret.
>
> I'm fine keeping it if it is needed by KVM TDX enabling. Otherwise, just
> drop it.

No problem I'll drop it. KVM is using __seamcall() anyway.