RE: [PATCH v4 00/12] Unify TDCALL/SEAMCALL and TDVMCALL assembly

From: Huang, Kai
Date: Mon Sep 11 2023 - 21:27:49 EST




> -----Original Message-----
> From: Huang, Kai <kai.huang@xxxxxxxxx>
> Sent: Tuesday, September 12, 2023 10:30 AM
> To: kirill.shutemov@xxxxxxxxxxxxxxx; peterz@xxxxxxxxxxxxx;
> pbonzini@xxxxxxxxxx; linux-kernel@xxxxxxxxxxxxxxx
> Cc: Hansen, Dave <dave.hansen@xxxxxxxxx>; Christopherson,, Sean
> <seanjc@xxxxxxxxxx>; bp@xxxxxxxxx; x86@xxxxxxxxxx; hpa@xxxxxxxxx;
> mingo@xxxxxxxxxx; tglx@xxxxxxxxxxxxx;
> sathyanarayanan.kuppuswamy@xxxxxxxxxxxxxxx; Yamahata, Isaku
> <isaku.yamahata@xxxxxxxxx>; n.borisov.lkml@xxxxxxxxx
> Subject: Re: [PATCH v4 00/12] Unify TDCALL/SEAMCALL and TDVMCALL
> assembly
>
> On Mon, 2023-09-11 at 19:08 +0200, Paolo Bonzini wrote:
> > On 8/15/23 13:01, Kai Huang wrote:
> > > Hi Peter, Kirill,
> > >
> > > This series unifies the assembly code for TDCALL/SEAMCALL and TDVMCALL.
> > > Now all of them use one singe TDX_MODULE_CALL asm macro. More
> > > information please see cover letter of v2 (see link below).
> > >
> > > Tested by booting TDX guest, initializing TDX module, and running
> > > TDX guest successfully, all with this series applied.
> >
> > Not sure it if's new in this version but I'm seeing
> >
> > WARNING: modpost: EXPORT symbol "__seamcall_ret" [vmlinux] version ...
> > Is "__seamcall_ret" prototyped in <asm/asm-prototypes.h>?
> > WARNING: modpost: EXPORT symbol "__seamcall" [vmlinux] version ...
> > Is "__seamcall" prototyped in <asm/asm-prototypes.h>?
> > WARNING: modpost: EXPORT symbol "__seamcall_saved_ret" [vmlinux]
> version ...
> > Is "__seamcall_saved_ret" prototyped in <asm/asm-prototypes.h>?
> >
> > which is fixed by
> >
> > diff --git a/arch/x86/include/asm/asm-prototypes.h
> > b/arch/x86/include/asm/asm-prototypes.h
> > index 8f80de627c60..eff5252e9c86 100644
> > --- a/arch/x86/include/asm/asm-prototypes.h
> > +++ b/arch/x86/include/asm/asm-prototypes.h
> > @@ -6,6 +6,7 @@
> > #include <asm/page.h>
> > #include <asm/checksum.h>
> > #include <asm/mce.h>
> > +#include <asm/tdx.h>
> >
> > #include <asm-generic/asm-prototypes.h>
> >
>
> Thanks Paolo!
>
> I never met this issue, not even from LKP. Do you happen to know which Kconfig
> option can trigger this? Or would you mind sharing your .config?

(replying via outlook due to some networking issue of my home network)

After digging, this is due to exporting __seamcall*() assembly functions while MODVERSIONS is enabled.

This series itself doesn't cause this warning.

I didn't export them in this series because I would like to leave to KVM patches when we are sure we need to export them.

E.g., I have seamcall*() wrappers to retry running out of entropy, and we may have concern exporting __seamcall*() low level functions directly and may wish to export higher level wrappers.

So I think the fix should be with the patch that truly exports those __seamcall*(). I'll talk to Isaku on this to get his idea.

Thanks!