diff options
author | Christoph Hellwig <hch@lst.de> | 2010-03-10 18:21:19 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2010-03-12 18:52:32 -0500 |
commit | e28cbf22933d0c0ccaf3c4c27a1a263b41f73859 (patch) | |
tree | a93ff48cfd97766a23b2c4f3ea86fccfc9c51d3f /arch/s390 | |
parent | baed7fc9b580bd3fb8252ff1d9b36eaf1f86b670 (diff) |
improve sys_newuname() for compat architectures
On an architecture that supports 32-bit compat we need to override the
reported machine in uname with the 32-bit value. Instead of doing this
separately in every architecture introduce a COMPAT_UTS_MACHINE define in
<asm/compat.h> and apply it directly in sys_newuname().
Signed-off-by: Christoph Hellwig <hch@lst.de>
Cc: Ralf Baechle <ralf@linux-mips.org>
Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Cc: Paul Mundt <lethal@linux-sh.org>
Cc: Jeff Dike <jdike@addtoit.com>
Cc: Hirokazu Takata <takata@linux-m32r.org>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: Ingo Molnar <mingo@elte.hu>
Cc: H. Peter Anvin <hpa@zytor.com>
Cc: Al Viro <viro@zeniv.linux.org.uk>
Cc: Arnd Bergmann <arnd@arndb.de>
Cc: Heiko Carstens <heiko.carstens@de.ibm.com>
Cc: Martin Schwidefsky <schwidefsky@de.ibm.com>
Cc: "Luck, Tony" <tony.luck@intel.com>
Cc: James Morris <jmorris@namei.org>
Cc: Andreas Schwab <schwab@linux-m68k.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'arch/s390')
-rw-r--r-- | arch/s390/include/asm/compat.h | 3 | ||||
-rw-r--r-- | arch/s390/kernel/compat_wrapper.S | 2 | ||||
-rw-r--r-- | arch/s390/kernel/entry.h | 2 | ||||
-rw-r--r-- | arch/s390/kernel/sys_s390.c | 11 | ||||
-rw-r--r-- | arch/s390/kernel/syscalls.S | 2 |
5 files changed, 4 insertions, 16 deletions
diff --git a/arch/s390/include/asm/compat.h b/arch/s390/include/asm/compat.h index 01a08020bc0e..104f2007f097 100644 --- a/arch/s390/include/asm/compat.h +++ b/arch/s390/include/asm/compat.h | |||
@@ -35,7 +35,8 @@ | |||
35 | 35 | ||
36 | extern long psw32_user_bits; | 36 | extern long psw32_user_bits; |
37 | 37 | ||
38 | #define COMPAT_USER_HZ 100 | 38 | #define COMPAT_USER_HZ 100 |
39 | #define COMPAT_UTS_MACHINE "s390\0\0\0\0" | ||
39 | 40 | ||
40 | typedef u32 compat_size_t; | 41 | typedef u32 compat_size_t; |
41 | typedef s32 compat_ssize_t; | 42 | typedef s32 compat_ssize_t; |
diff --git a/arch/s390/kernel/compat_wrapper.S b/arch/s390/kernel/compat_wrapper.S index 30de2d0e52bb..672ce52341b4 100644 --- a/arch/s390/kernel/compat_wrapper.S +++ b/arch/s390/kernel/compat_wrapper.S | |||
@@ -547,7 +547,7 @@ sys32_setdomainname_wrapper: | |||
547 | .globl sys32_newuname_wrapper | 547 | .globl sys32_newuname_wrapper |
548 | sys32_newuname_wrapper: | 548 | sys32_newuname_wrapper: |
549 | llgtr %r2,%r2 # struct new_utsname * | 549 | llgtr %r2,%r2 # struct new_utsname * |
550 | jg sys_s390_newuname # branch to system call | 550 | jg sys_newuname # branch to system call |
551 | 551 | ||
552 | .globl compat_sys_adjtimex_wrapper | 552 | .globl compat_sys_adjtimex_wrapper |
553 | compat_sys_adjtimex_wrapper: | 553 | compat_sys_adjtimex_wrapper: |
diff --git a/arch/s390/kernel/entry.h b/arch/s390/kernel/entry.h index 15fd68b196c0..eb15c12ec158 100644 --- a/arch/s390/kernel/entry.h +++ b/arch/s390/kernel/entry.h | |||
@@ -24,7 +24,6 @@ int __cpuinit start_secondary(void *cpuvoid); | |||
24 | void __init startup_init(void); | 24 | void __init startup_init(void); |
25 | void die(const char * str, struct pt_regs * regs, long err); | 25 | void die(const char * str, struct pt_regs * regs, long err); |
26 | 26 | ||
27 | struct new_utsname; | ||
28 | struct s390_mmap_arg_struct; | 27 | struct s390_mmap_arg_struct; |
29 | struct fadvise64_64_args; | 28 | struct fadvise64_64_args; |
30 | struct old_sigaction; | 29 | struct old_sigaction; |
@@ -32,7 +31,6 @@ struct old_sigaction; | |||
32 | long sys_mmap2(struct s390_mmap_arg_struct __user *arg); | 31 | long sys_mmap2(struct s390_mmap_arg_struct __user *arg); |
33 | long sys_s390_ipc(uint call, int first, unsigned long second, | 32 | long sys_s390_ipc(uint call, int first, unsigned long second, |
34 | unsigned long third, void __user *ptr); | 33 | unsigned long third, void __user *ptr); |
35 | long sys_s390_newuname(struct new_utsname __user *name); | ||
36 | long sys_s390_personality(unsigned long personality); | 34 | long sys_s390_personality(unsigned long personality); |
37 | long sys_s390_fadvise64(int fd, u32 offset_high, u32 offset_low, | 35 | long sys_s390_fadvise64(int fd, u32 offset_high, u32 offset_low, |
38 | size_t len, int advice); | 36 | size_t len, int advice); |
diff --git a/arch/s390/kernel/sys_s390.c b/arch/s390/kernel/sys_s390.c index b8b78092ab7c..7b6b0f81a283 100644 --- a/arch/s390/kernel/sys_s390.c +++ b/arch/s390/kernel/sys_s390.c | |||
@@ -131,17 +131,6 @@ SYSCALL_DEFINE5(s390_ipc, uint, call, int, first, unsigned long, second, | |||
131 | } | 131 | } |
132 | 132 | ||
133 | #ifdef CONFIG_64BIT | 133 | #ifdef CONFIG_64BIT |
134 | SYSCALL_DEFINE1(s390_newuname, struct new_utsname __user *, name) | ||
135 | { | ||
136 | int ret = sys_newuname(name); | ||
137 | |||
138 | if (personality(current->personality) == PER_LINUX32 && !ret) { | ||
139 | ret = copy_to_user(name->machine, "s390\0\0\0\0", 8); | ||
140 | if (ret) ret = -EFAULT; | ||
141 | } | ||
142 | return ret; | ||
143 | } | ||
144 | |||
145 | SYSCALL_DEFINE1(s390_personality, unsigned long, personality) | 134 | SYSCALL_DEFINE1(s390_personality, unsigned long, personality) |
146 | { | 135 | { |
147 | int ret; | 136 | int ret; |
diff --git a/arch/s390/kernel/syscalls.S b/arch/s390/kernel/syscalls.S index 990ac8b321c8..201ce6bed34e 100644 --- a/arch/s390/kernel/syscalls.S +++ b/arch/s390/kernel/syscalls.S | |||
@@ -130,7 +130,7 @@ SYSCALL(sys_fsync,sys_fsync,sys32_fsync_wrapper) | |||
130 | SYSCALL(sys_sigreturn,sys_sigreturn,sys32_sigreturn) | 130 | SYSCALL(sys_sigreturn,sys_sigreturn,sys32_sigreturn) |
131 | SYSCALL(sys_clone,sys_clone,sys_clone_wrapper) /* 120 */ | 131 | SYSCALL(sys_clone,sys_clone,sys_clone_wrapper) /* 120 */ |
132 | SYSCALL(sys_setdomainname,sys_setdomainname,sys32_setdomainname_wrapper) | 132 | SYSCALL(sys_setdomainname,sys_setdomainname,sys32_setdomainname_wrapper) |
133 | SYSCALL(sys_newuname,sys_s390_newuname,sys32_newuname_wrapper) | 133 | SYSCALL(sys_newuname,sys_newuname,sys32_newuname_wrapper) |
134 | NI_SYSCALL /* modify_ldt for i386 */ | 134 | NI_SYSCALL /* modify_ldt for i386 */ |
135 | SYSCALL(sys_adjtimex,sys_adjtimex,compat_sys_adjtimex_wrapper) | 135 | SYSCALL(sys_adjtimex,sys_adjtimex,compat_sys_adjtimex_wrapper) |
136 | SYSCALL(sys_mprotect,sys_mprotect,sys32_mprotect_wrapper) /* 125 */ | 136 | SYSCALL(sys_mprotect,sys_mprotect,sys32_mprotect_wrapper) /* 125 */ |