[PATCH v3 4/4] powerpc: generate uapi header and system call table files

Arnd Bergmann arnd at arndb.de
Wed Dec 5 08:33:13 AEDT 2018


On Tue, Dec 4, 2018 at 10:17 PM Arnd Bergmann <arnd at arndb.de> wrote:
>
> > diff --git a/arch/powerpc/kernel/systbl.S b/arch/powerpc/kernel/systbl.S
> > index 9ff1913..d756348 100644
> > --- a/arch/powerpc/kernel/systbl.S
> > +++ b/arch/powerpc/kernel/systbl.S
>
> >  #ifdef CONFIG_PPC64
> > @@ -47,5 +25,17 @@
> >  .globl sys_call_table
> >  sys_call_table:
> >
> > +#if defined CONFIG_PPC64 && defined(CONFIG_COMPAT)
> > +#define __SYSCALL(nr, entry, nargs) .8byte entry
> >  #define compat_sys_sigsuspend  sys_sigsuspend
> > -#include <asm/systbl.h>
> > +#include <asm/syscall_table_c32.h>
> > +#undef __SYSCALL
> > +#elif defined CONFIG_PPC64 && !defined(CONFIG_COMPAT)
> > +#define __SYSCALL(nr, entry, nargs) .8byte entry
> > +#include <asm/syscall_table_64.h>
> > +#undef __SYSCALL
>
> This part looks wrong: where the old sys_call_table contained
> both the native and compat calls side by side, the new table
> contains only the compat versions (note that CONFIG_COMPAT is
> always set on PPC64). I think you copy-pasted this incorrectly from
> one of the other architectures that uses a different layout for the
> compat calls.
>
> The way I think this could work best is if you add a preparation
> patch that splits out the 64-bit table into two separate ones
> (and make sure that works). After that, you can add your
> existing patch, rebased to use the two generated tables
> instead of the old-style tables. I'll follow up with an untested
> patch for illustration.

One more thing I noticed while writing up that patch: you also need
to use the DOTSYM() macro in __SYSCALL() to generate the correct
symbol name for the old ELF ABI (when PPC64_ELF_ABI_v2 is
not set).

       Arnd


More information about the Linuxppc-dev mailing list