diff mbox

[20/25] arm64:ilp32: add sys_ilp32.c and a separate table (in entry.S) to use it

Message ID 20160428222137.GB18227@yury-N73SV (mailing list archive)
State New, archived
Headers show

Commit Message

Yury Norov April 28, 2016, 10:21 p.m. UTC
On Thu, Apr 28, 2016 at 10:43:59PM +0200, Arnd Bergmann wrote:
> On Thursday 28 April 2016 22:19:14 Yury Norov wrote:
> > 
> > Yes, we need. Otherwise we have circular dependency like this:
> > arch/arm64/kernel/sys_ilp32.c:60:0: warning: "__SC_WRAP" redefined
> >  #define __SC_WRAP(nr, sym) [nr] = compat_##sym,
> >   ^
> >   In file included from include/asm-generic/unistd.h:1:0,
> >                    from ./arch/arm64/include/uapi/asm/unistd.h:16,
> >                    from ./arch/arm64/include/asm/unistd.h:62,
> >                    from ./include/uapi/linux/unistd.h:7,
> >                    from include/linux/syscalls.h:23,
> >                    from arch/arm64/kernel/sys_ilp32.c:30:
> > include/uapi/asm-generic/unistd.h:33:0: note: this is the location of the previous definition
> >  #define __SC_WRAP __SYSCALL
> > 
> > Defining __SYSCALL_COMPAT at the top of the file does not help much.
> 
> Hmm, this sounds like something that we should fix in the asm-generic/unistd.h
> file. Is it just for __SC_WRAP, or also the other macros?
> 
> 	Arnd

For __SYSCALL and __SC_WRAP:

 #include <linux/fs.h>
@@ -48,13 +50,12 @@ asmlinkage long
 ilp32_sys_rt_sigreturn_wrapper(void);
   
 #include <asm/syscall.h>
     
-#undef __SYSCALL
-#undef __SC_COMP
-#undef __SC_WRAP
-#undef __SC_3264
-#undef __SC_COMP_3264
 
-#define __SYSCALL_COMPAT
 #define __SYSCALL(nr, sym)     [nr] = sym,
 #define __SC_WRAP(nr, sym)     [nr] = compat_##sym,
         
This patch makes gcc warn about redefinition.

arch/arm64/kernel/sys_ilp32.c:59:0: warning: "__SYSCALL" redefined
 #define __SYSCALL(nr, sym) [nr] = sym,
 ^
In file included from include/asm-generic/unistd.h:1:0,
                 from ./arch/arm64/include/uapi/asm/unistd.h:16,
                 from ./arch/arm64/include/asm/unistd.h:62,
                 from ./include/uapi/linux/unistd.h:7,
                 from include/linux/syscalls.h:23,
                 from arch/arm64/kernel/sys_ilp32.c:30:
include/uapi/asm-generic/unistd.h:15:0: note: this is the location of the previous definition
 #define __SYSCALL(x, y)
 ^
arch/arm64/kernel/sys_ilp32.c:60:0: warning: "__SC_WRAP" redefined
 #define __SC_WRAP(nr, sym) [nr] = compat_##sym,
 ^
In file included from include/asm-generic/unistd.h:1:0,
                 from ./arch/arm64/include/uapi/asm/unistd.h:16,
                 from ./arch/arm64/include/asm/unistd.h:62,
                 from ./include/uapi/linux/unistd.h:7,
                 from include/linux/syscalls.h:23,
                 from arch/arm64/kernel/sys_ilp32.c:30:
include/uapi/asm-generic/unistd.h:33:0: note: this is the location of the previous definition
 #define __SC_WRAP __SYSCALL
 ^

Comments

Arnd Bergmann April 28, 2016, 10:43 p.m. UTC | #1
On Friday 29 April 2016 01:21:37 Yury Norov wrote:
> index 1458ad7..410d817 100644
> --- a/arch/arm64/kernel/sys_ilp32.c
> +++ b/arch/arm64/kernel/sys_ilp32.c
> @@ -17,6 +17,8 @@
>  * along with this program.  If not, see
>  * <http://www.gnu.org/licenses/>.
>  */
>     
> +#define __SYSCALL_COMPAT
> +
>  #include <linux/compiler.h>
>  #include <linux/errno.h>
>  #include <linux/fs.h>
> @@ -48,13 +50,12 @@ asmlinkage long
>  ilp32_sys_rt_sigreturn_wrapper(void);
>    
>  #include <asm/syscall.h>
>      
> -#undef __SYSCALL
> -#undef __SC_COMP
> -#undef __SC_WRAP
> -#undef __SC_3264
> -#undef __SC_COMP_3264
>  
> -#define __SYSCALL_COMPAT
>  #define __SYSCALL(nr, sym)     [nr] = sym,
>  #define __SC_WRAP(nr, sym)     [nr] = compat_##sym,
>          
> This patch makes gcc warn about redefinition.
> 
> arch/arm64/kernel/sys_ilp32.c:59:0: warning: "__SYSCALL" redefined
>  #define __SYSCALL(nr, sym) [nr] = sym,
>  ^
> In file included from include/asm-generic/unistd.h:1:0,
> 

Ok, I think I see it now. Can you #undef the two symbols at the
end of arch/arm64/include/uapi/asm/unistd.h or possibly
include/uapi/asm-generic/unistd.h?

	Arnd
Yury Norov April 29, 2016, 1:13 p.m. UTC | #2
On Fri, Apr 29, 2016 at 12:43:41AM +0200, Arnd Bergmann wrote:
> On Friday 29 April 2016 01:21:37 Yury Norov wrote:
> > index 1458ad7..410d817 100644
> > --- a/arch/arm64/kernel/sys_ilp32.c
> > +++ b/arch/arm64/kernel/sys_ilp32.c
> > @@ -17,6 +17,8 @@
> >  * along with this program.  If not, see
> >  * <http://www.gnu.org/licenses/>.
> >  */
> >     
> > +#define __SYSCALL_COMPAT
> > +
> >  #include <linux/compiler.h>
> >  #include <linux/errno.h>
> >  #include <linux/fs.h>
> > @@ -48,13 +50,12 @@ asmlinkage long
> >  ilp32_sys_rt_sigreturn_wrapper(void);
> >    
> >  #include <asm/syscall.h>
> >      
> > -#undef __SYSCALL
> > -#undef __SC_COMP
> > -#undef __SC_WRAP
> > -#undef __SC_3264
> > -#undef __SC_COMP_3264
> >  
> > -#define __SYSCALL_COMPAT
> >  #define __SYSCALL(nr, sym)     [nr] = sym,
> >  #define __SC_WRAP(nr, sym)     [nr] = compat_##sym,
> >          
> > This patch makes gcc warn about redefinition.
> > 
> > arch/arm64/kernel/sys_ilp32.c:59:0: warning: "__SYSCALL" redefined
> >  #define __SYSCALL(nr, sym) [nr] = sym,
> >  ^
> > In file included from include/asm-generic/unistd.h:1:0,
> > 
> 
> Ok, I think I see it now. Can you #undef the two symbols at the
> end of arch/arm64/include/uapi/asm/unistd.h

I think it doesn't look better than what we have now, but not worse
as well. If you like it, I'll change.

> or possibly
> include/uapi/asm-generic/unistd.h?
> 
> 	Arnd
Arnd Bergmann April 29, 2016, 3:45 p.m. UTC | #3
On Friday 29 April 2016 16:13:38 Yury Norov wrote:
> On Fri, Apr 29, 2016 at 12:43:41AM +0200, Arnd Bergmann wrote:
> > On Friday 29 April 2016 01:21:37 Yury Norov wrote:

> > > 
> > > arch/arm64/kernel/sys_ilp32.c:59:0: warning: "__SYSCALL" redefined
> > >  #define __SYSCALL(nr, sym) [nr] = sym,
> > >  ^
> > > In file included from include/asm-generic/unistd.h:1:0,
> > > 
> > 
> > Ok, I think I see it now. Can you #undef the two symbols at the
> > end of arch/arm64/include/uapi/asm/unistd.h
> 
> I think it doesn't look better than what we have now, but not worse
> as well. If you like it, I'll change.

I looked again and saw that the existing architectures also #undef __SYSCALL,
and they don't have __SC_WRAP. It's probably fine to just #undef the
two here (don't undef SC_COMP, __SC_3264 and SC_COMP_3264).

Changing the asm-generic header to not require the #undef would be nice,
but then we should do that for all 12 users of that file.

	Arnd
diff mbox

Patch

diff --git a/arch/arm64/kernel/sys_ilp32.c
b/arch/arm64/kernel/sys_ilp32.c
index 1458ad7..410d817 100644
--- a/arch/arm64/kernel/sys_ilp32.c
+++ b/arch/arm64/kernel/sys_ilp32.c
@@ -17,6 +17,8 @@ 
 * along with this program.  If not, see
 * <http://www.gnu.org/licenses/>.
 */
    
+#define __SYSCALL_COMPAT
+
 #include <linux/compiler.h>
 #include <linux/errno.h>