Commit 555e5986bab6715ad6e39a35aeb67a218cc80abf

Authored by Linus Torvalds

Merge branch 'parisc-3.18-2' of git://git.kernel.org/pub/scm/linux/kernel/git/deller/parisc-linux

Pull parisc updates from Helge Deller:
 "Changes include:
   - wire up the bpf syscall
   - remove CONFIG_64BIT usage from some userspace-exported header files
   - use compat functions for msgctl, shmat, shmctl and semtimedop
     syscalls"

* 'parisc-3.18-2' of git://git.kernel.org/pub/scm/linux/kernel/git/deller/parisc-linux:
  parisc: Avoid using CONFIG_64BIT in userspace exported headers
  parisc: Use compat layer for msgctl, shmat, shmctl and semtimedop syscalls
  parisc: Use BUILD_BUG() instead of undefined functions
  parisc: Wire up bpf syscall

Showing 8 changed files Side-by-side Diff

arch/parisc/include/asm/uaccess.h
... ... @@ -9,6 +9,8 @@
9 9 #include <asm/errno.h>
10 10 #include <asm-generic/uaccess-unaligned.h>
11 11  
  12 +#include <linux/bug.h>
  13 +
12 14 #define VERIFY_READ 0
13 15 #define VERIFY_WRITE 1
14 16  
... ... @@ -28,11 +30,6 @@
28 30 * that put_user is the same as __put_user, etc.
29 31 */
30 32  
31   -extern int __get_kernel_bad(void);
32   -extern int __get_user_bad(void);
33   -extern int __put_kernel_bad(void);
34   -extern int __put_user_bad(void);
35   -
36 33 static inline long access_ok(int type, const void __user * addr,
37 34 unsigned long size)
38 35 {
... ... @@ -43,8 +40,8 @@
43 40 #define get_user __get_user
44 41  
45 42 #if !defined(CONFIG_64BIT)
46   -#define LDD_KERNEL(ptr) __get_kernel_bad();
47   -#define LDD_USER(ptr) __get_user_bad();
  43 +#define LDD_KERNEL(ptr) BUILD_BUG()
  44 +#define LDD_USER(ptr) BUILD_BUG()
48 45 #define STD_KERNEL(x, ptr) __put_kernel_asm64(x,ptr)
49 46 #define STD_USER(x, ptr) __put_user_asm64(x,ptr)
50 47 #define ASM_WORD_INSN ".word\t"
... ... @@ -94,7 +91,7 @@
94 91 case 2: __get_kernel_asm("ldh",ptr); break; \
95 92 case 4: __get_kernel_asm("ldw",ptr); break; \
96 93 case 8: LDD_KERNEL(ptr); break; \
97   - default: __get_kernel_bad(); break; \
  94 + default: BUILD_BUG(); break; \
98 95 } \
99 96 } \
100 97 else { \
... ... @@ -103,7 +100,7 @@
103 100 case 2: __get_user_asm("ldh",ptr); break; \
104 101 case 4: __get_user_asm("ldw",ptr); break; \
105 102 case 8: LDD_USER(ptr); break; \
106   - default: __get_user_bad(); break; \
  103 + default: BUILD_BUG(); break; \
107 104 } \
108 105 } \
109 106 \
... ... @@ -136,7 +133,7 @@
136 133 case 2: __put_kernel_asm("sth",__x,ptr); break; \
137 134 case 4: __put_kernel_asm("stw",__x,ptr); break; \
138 135 case 8: STD_KERNEL(__x,ptr); break; \
139   - default: __put_kernel_bad(); break; \
  136 + default: BUILD_BUG(); break; \
140 137 } \
141 138 } \
142 139 else { \
... ... @@ -145,7 +142,7 @@
145 142 case 2: __put_user_asm("sth",__x,ptr); break; \
146 143 case 4: __put_user_asm("stw",__x,ptr); break; \
147 144 case 8: STD_USER(__x,ptr); break; \
148   - default: __put_user_bad(); break; \
  145 + default: BUILD_BUG(); break; \
149 146 } \
150 147 } \
151 148 \
arch/parisc/include/uapi/asm/bitsperlong.h
1 1 #ifndef __ASM_PARISC_BITSPERLONG_H
2 2 #define __ASM_PARISC_BITSPERLONG_H
3 3  
4   -/*
5   - * using CONFIG_* outside of __KERNEL__ is wrong,
6   - * __LP64__ was also removed from headers, so what
7   - * is the right approach on parisc?
8   - * -arnd
9   - */
10   -#if (defined(__KERNEL__) && defined(CONFIG_64BIT)) || defined (__LP64__)
  4 +#if defined(__LP64__)
11 5 #define __BITS_PER_LONG 64
12 6 #define SHIFT_PER_LONG 6
13 7 #else
arch/parisc/include/uapi/asm/msgbuf.h
1 1 #ifndef _PARISC_MSGBUF_H
2 2 #define _PARISC_MSGBUF_H
3 3  
  4 +#include <asm/bitsperlong.h>
  5 +
4 6 /*
5 7 * The msqid64_ds structure for parisc architecture, copied from sparc.
6 8 * Note extra padding because this structure is passed back and forth
7 9  
8 10  
... ... @@ -13,15 +15,15 @@
13 15  
14 16 struct msqid64_ds {
15 17 struct ipc64_perm msg_perm;
16   -#ifndef CONFIG_64BIT
  18 +#if __BITS_PER_LONG != 64
17 19 unsigned int __pad1;
18 20 #endif
19 21 __kernel_time_t msg_stime; /* last msgsnd time */
20   -#ifndef CONFIG_64BIT
  22 +#if __BITS_PER_LONG != 64
21 23 unsigned int __pad2;
22 24 #endif
23 25 __kernel_time_t msg_rtime; /* last msgrcv time */
24   -#ifndef CONFIG_64BIT
  26 +#if __BITS_PER_LONG != 64
25 27 unsigned int __pad3;
26 28 #endif
27 29 __kernel_time_t msg_ctime; /* last change time */
arch/parisc/include/uapi/asm/sembuf.h
1 1 #ifndef _PARISC_SEMBUF_H
2 2 #define _PARISC_SEMBUF_H
3 3  
  4 +#include <asm/bitsperlong.h>
  5 +
4 6 /*
5 7 * The semid64_ds structure for parisc architecture.
6 8 * Note extra padding because this structure is passed back and forth
7 9  
... ... @@ -13,11 +15,11 @@
13 15  
14 16 struct semid64_ds {
15 17 struct ipc64_perm sem_perm; /* permissions .. see ipc.h */
16   -#ifndef CONFIG_64BIT
  18 +#if __BITS_PER_LONG != 64
17 19 unsigned int __pad1;
18 20 #endif
19 21 __kernel_time_t sem_otime; /* last semop time */
20   -#ifndef CONFIG_64BIT
  22 +#if __BITS_PER_LONG != 64
21 23 unsigned int __pad2;
22 24 #endif
23 25 __kernel_time_t sem_ctime; /* last change time */
arch/parisc/include/uapi/asm/shmbuf.h
1 1 #ifndef _PARISC_SHMBUF_H
2 2 #define _PARISC_SHMBUF_H
3 3  
  4 +#include <asm/bitsperlong.h>
  5 +
4 6 /*
5 7 * The shmid64_ds structure for parisc architecture.
6 8 * Note extra padding because this structure is passed back and forth
7 9  
8 10  
9 11  
... ... @@ -13,19 +15,19 @@
13 15  
14 16 struct shmid64_ds {
15 17 struct ipc64_perm shm_perm; /* operation perms */
16   -#ifndef CONFIG_64BIT
  18 +#if __BITS_PER_LONG != 64
17 19 unsigned int __pad1;
18 20 #endif
19 21 __kernel_time_t shm_atime; /* last attach time */
20   -#ifndef CONFIG_64BIT
  22 +#if __BITS_PER_LONG != 64
21 23 unsigned int __pad2;
22 24 #endif
23 25 __kernel_time_t shm_dtime; /* last detach time */
24   -#ifndef CONFIG_64BIT
  26 +#if __BITS_PER_LONG != 64
25 27 unsigned int __pad3;
26 28 #endif
27 29 __kernel_time_t shm_ctime; /* last change time */
28   -#ifndef CONFIG_64BIT
  30 +#if __BITS_PER_LONG != 64
29 31 unsigned int __pad4;
30 32 #endif
31 33 size_t shm_segsz; /* size of segment (bytes) */
32 34  
... ... @@ -36,23 +38,16 @@
36 38 unsigned int __unused2;
37 39 };
38 40  
39   -#ifdef CONFIG_64BIT
40   -/* The 'unsigned int' (formerly 'unsigned long') data types below will
41   - * ensure that a 32-bit app calling shmctl(*,IPC_INFO,*) will work on
42   - * a wide kernel, but if some of these values are meant to contain pointers
43   - * they may need to be 'long long' instead. -PB XXX FIXME
44   - */
45   -#endif
46 41 struct shminfo64 {
47   - unsigned int shmmax;
48   - unsigned int shmmin;
49   - unsigned int shmmni;
50   - unsigned int shmseg;
51   - unsigned int shmall;
52   - unsigned int __unused1;
53   - unsigned int __unused2;
54   - unsigned int __unused3;
55   - unsigned int __unused4;
  42 + unsigned long shmmax;
  43 + unsigned long shmmin;
  44 + unsigned long shmmni;
  45 + unsigned long shmseg;
  46 + unsigned long shmall;
  47 + unsigned long __unused1;
  48 + unsigned long __unused2;
  49 + unsigned long __unused3;
  50 + unsigned long __unused4;
56 51 };
57 52  
58 53 #endif /* _PARISC_SHMBUF_H */
arch/parisc/include/uapi/asm/signal.h
... ... @@ -85,7 +85,7 @@
85 85 struct siginfo;
86 86  
87 87 /* Type of a signal handler. */
88   -#ifdef CONFIG_64BIT
  88 +#if defined(__LP64__)
89 89 /* function pointers on 64-bit parisc are pointers to little structs and the
90 90 * compiler doesn't support code which changes or tests the address of
91 91 * the function in the little struct. This is really ugly -PB
arch/parisc/include/uapi/asm/unistd.h
... ... @@ -833,8 +833,9 @@
833 833 #define __NR_seccomp (__NR_Linux + 338)
834 834 #define __NR_getrandom (__NR_Linux + 339)
835 835 #define __NR_memfd_create (__NR_Linux + 340)
  836 +#define __NR_bpf (__NR_Linux + 341)
836 837  
837   -#define __NR_Linux_syscalls (__NR_memfd_create + 1)
  838 +#define __NR_Linux_syscalls (__NR_bpf + 1)
838 839  
839 840  
840 841 #define __IGNORE_select /* newselect */
arch/parisc/kernel/syscall_table.S
... ... @@ -286,11 +286,11 @@
286 286 ENTRY_COMP(msgsnd)
287 287 ENTRY_COMP(msgrcv)
288 288 ENTRY_SAME(msgget) /* 190 */
289   - ENTRY_SAME(msgctl)
290   - ENTRY_SAME(shmat)
  289 + ENTRY_COMP(msgctl)
  290 + ENTRY_COMP(shmat)
291 291 ENTRY_SAME(shmdt)
292 292 ENTRY_SAME(shmget)
293   - ENTRY_SAME(shmctl) /* 195 */
  293 + ENTRY_COMP(shmctl) /* 195 */
294 294 ENTRY_SAME(ni_syscall) /* streams1 */
295 295 ENTRY_SAME(ni_syscall) /* streams2 */
296 296 ENTRY_SAME(lstat64)
... ... @@ -323,7 +323,7 @@
323 323 ENTRY_SAME(epoll_ctl) /* 225 */
324 324 ENTRY_SAME(epoll_wait)
325 325 ENTRY_SAME(remap_file_pages)
326   - ENTRY_SAME(semtimedop)
  326 + ENTRY_COMP(semtimedop)
327 327 ENTRY_COMP(mq_open)
328 328 ENTRY_SAME(mq_unlink) /* 230 */
329 329 ENTRY_COMP(mq_timedsend)
... ... @@ -436,6 +436,7 @@
436 436 ENTRY_SAME(seccomp)
437 437 ENTRY_SAME(getrandom)
438 438 ENTRY_SAME(memfd_create) /* 340 */
  439 + ENTRY_SAME(bpf)
439 440  
440 441 /* Nothing yet */
441 442