Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

ipc: use Kconfig options for __ARCH_WANT_[COMPAT_]IPC_PARSE_VERSION

Rather than #define the options manually in the architecture code, add
Kconfig options for them and select them there instead. This also allows
us to select the compat IPC version parsing automatically for platforms
using the old compat IPC interface.

Reported-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Will Deacon <will.deacon@arm.com>
Cc: Arnd Bergmann <arnd@arndb.de>
Cc: Chris Metcalf <cmetcalf@tilera.com>
Cc: Catalin Marinas <catalin.marinas@arm.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>

authored by

Will Deacon and committed by
Linus Torvalds
c1d7e01d 05ba3f1a

+29 -22
+7
arch/Kconfig
··· 248 248 config HAVE_CMPXCHG_DOUBLE 249 249 bool 250 250 251 + config ARCH_WANT_IPC_PARSE_VERSION 252 + bool 253 + 254 + config ARCH_WANT_COMPAT_IPC_PARSE_VERSION 255 + bool 256 + 251 257 config ARCH_WANT_OLD_COMPAT_IPC 258 + select ARCH_WANT_COMPAT_IPC_PARSE_VERSION 252 259 bool 253 260 254 261 config HAVE_ARCH_SECCOMP_FILTER
+1
arch/alpha/Kconfig
··· 14 14 select AUTO_IRQ_AFFINITY if SMP 15 15 select GENERIC_IRQ_SHOW 16 16 select ARCH_WANT_OPTIONAL_GPIOLIB 17 + select ARCH_WANT_IPC_PARSE_VERSION 17 18 select ARCH_HAVE_NMI_SAFE_CMPXCHG 18 19 select GENERIC_SMP_IDLE_THREAD 19 20 select GENERIC_CMOS_UPDATE
-1
arch/alpha/include/asm/unistd.h
··· 470 470 471 471 #define NR_SYSCALLS 504 472 472 473 - #define __ARCH_WANT_IPC_PARSE_VERSION 474 473 #define __ARCH_WANT_OLD_READDIR 475 474 #define __ARCH_WANT_STAT64 476 475 #define __ARCH_WANT_SYS_GETHOSTNAME
+1
arch/arm/Kconfig
··· 39 39 select GENERIC_IRQ_PROBE 40 40 select GENERIC_IRQ_SHOW 41 41 select GENERIC_IRQ_PROBE 42 + select ARCH_WANT_IPC_PARSE_VERSION 42 43 select HARDIRQS_SW_RESEND 43 44 select CPU_PM if (SUSPEND || CPU_IDLE) 44 45 select GENERIC_PCI_IOMAP
-1
arch/arm/include/asm/unistd.h
··· 446 446 447 447 #ifdef __KERNEL__ 448 448 449 - #define __ARCH_WANT_IPC_PARSE_VERSION 450 449 #define __ARCH_WANT_STAT64 451 450 #define __ARCH_WANT_SYS_GETHOSTNAME 452 451 #define __ARCH_WANT_SYS_PAUSE
+1
arch/avr32/Kconfig
··· 12 12 select HARDIRQS_SW_RESEND 13 13 select GENERIC_IRQ_SHOW 14 14 select ARCH_HAVE_CUSTOM_GPIO_H 15 + select ARCH_WANT_IPC_PARSE_VERSION 15 16 select ARCH_HAVE_NMI_SAFE_CMPXCHG 16 17 select GENERIC_CLOCKEVENTS 17 18 help
-1
arch/avr32/include/asm/unistd.h
··· 318 318 /* SMP stuff */ 319 319 #define __IGNORE_getcpu 320 320 321 - #define __ARCH_WANT_IPC_PARSE_VERSION 322 321 #define __ARCH_WANT_STAT64 323 322 #define __ARCH_WANT_SYS_ALARM 324 323 #define __ARCH_WANT_SYS_GETHOSTNAME
+1
arch/blackfin/Kconfig
··· 33 33 select HAVE_PERF_EVENTS 34 34 select ARCH_HAVE_CUSTOM_GPIO_H 35 35 select ARCH_WANT_OPTIONAL_GPIOLIB 36 + select ARCH_WANT_IPC_PARSE_VERSION 36 37 select HAVE_GENERIC_HARDIRQS 37 38 select GENERIC_ATOMIC64 38 39 select GENERIC_IRQ_PROBE
-1
arch/blackfin/include/asm/unistd.h
··· 434 434 #define __IGNORE_getcpu 435 435 436 436 #ifdef __KERNEL__ 437 - #define __ARCH_WANT_IPC_PARSE_VERSION 438 437 #define __ARCH_WANT_STAT64 439 438 #define __ARCH_WANT_SYS_ALARM 440 439 #define __ARCH_WANT_SYS_GETHOSTNAME
+1
arch/cris/Kconfig
··· 42 42 select HAVE_IDE 43 43 select GENERIC_ATOMIC64 44 44 select HAVE_GENERIC_HARDIRQS 45 + select ARCH_WANT_IPC_PARSE_VERSION 45 46 select GENERIC_IRQ_SHOW 46 47 select GENERIC_IOMAP 47 48 select GENERIC_SMP_IDLE_THREAD if ETRAX_ARCH_V32
-1
arch/cris/include/asm/unistd.h
··· 347 347 348 348 #include <arch/unistd.h> 349 349 350 - #define __ARCH_WANT_IPC_PARSE_VERSION 351 350 #define __ARCH_WANT_OLD_READDIR 352 351 #define __ARCH_WANT_OLD_STAT 353 352 #define __ARCH_WANT_STAT64
+1
arch/frv/Kconfig
··· 9 9 select GENERIC_IRQ_SHOW 10 10 select ARCH_HAVE_NMI_SAFE_CMPXCHG 11 11 select GENERIC_CPU_DEVICES 12 + select ARCH_WANT_IPC_PARSE_VERSION 12 13 13 14 config ZONE_DMA 14 15 bool
-1
arch/frv/include/asm/unistd.h
··· 349 349 350 350 #define NR_syscalls 338 351 351 352 - #define __ARCH_WANT_IPC_PARSE_VERSION 353 352 /* #define __ARCH_WANT_OLD_READDIR */ 354 353 #define __ARCH_WANT_OLD_STAT 355 354 #define __ARCH_WANT_STAT64
+1
arch/h8300/Kconfig
··· 3 3 default y 4 4 select HAVE_IDE 5 5 select HAVE_GENERIC_HARDIRQS 6 + select ARCH_WANT_IPC_PARSE_VERSION 6 7 select GENERIC_IRQ_SHOW 7 8 select GENERIC_CPU_DEVICES 8 9
-1
arch/h8300/include/asm/unistd.h
··· 331 331 332 332 #define NR_syscalls 321 333 333 334 - #define __ARCH_WANT_IPC_PARSE_VERSION 335 334 #define __ARCH_WANT_OLD_READDIR 336 335 #define __ARCH_WANT_OLD_STAT 337 336 #define __ARCH_WANT_STAT64
+1
arch/m32r/Kconfig
··· 7 7 select HAVE_KERNEL_GZIP 8 8 select HAVE_KERNEL_BZIP2 9 9 select HAVE_KERNEL_LZMA 10 + select ARCH_WANT_IPC_PARSE_VERSION 10 11 select HAVE_GENERIC_HARDIRQS 11 12 select GENERIC_IRQ_PROBE 12 13 select GENERIC_IRQ_SHOW
-1
arch/m32r/include/asm/unistd.h
··· 336 336 337 337 #define NR_syscalls 326 338 338 339 - #define __ARCH_WANT_IPC_PARSE_VERSION 340 339 #define __ARCH_WANT_STAT64 341 340 #define __ARCH_WANT_SYS_ALARM 342 341 #define __ARCH_WANT_SYS_GETHOSTNAME
+1
arch/m68k/Kconfig
··· 10 10 select GENERIC_STRNCPY_FROM_USER if MMU 11 11 select GENERIC_STRNLEN_USER if MMU 12 12 select FPU if MMU 13 + select ARCH_WANT_IPC_PARSE_VERSION 13 14 select ARCH_USES_GETTIMEOFFSET if MMU && !COLDFIRE 14 15 15 16 config RWSEM_GENERIC_SPINLOCK
-1
arch/m68k/include/asm/unistd.h
··· 357 357 358 358 #define NR_syscalls 347 359 359 360 - #define __ARCH_WANT_IPC_PARSE_VERSION 361 360 #define __ARCH_WANT_OLD_READDIR 362 361 #define __ARCH_WANT_OLD_STAT 363 362 #define __ARCH_WANT_STAT64
+1
arch/microblaze/Kconfig
··· 15 15 select TRACING_SUPPORT 16 16 select OF 17 17 select OF_EARLY_FLATTREE 18 + select ARCH_WANT_IPC_PARSE_VERSION 18 19 select IRQ_DOMAIN 19 20 select HAVE_GENERIC_HARDIRQS 20 21 select GENERIC_IRQ_PROBE
-1
arch/microblaze/include/asm/unistd.h
··· 400 400 #ifdef __KERNEL__ 401 401 #ifndef __ASSEMBLY__ 402 402 403 - #define __ARCH_WANT_IPC_PARSE_VERSION 404 403 /* #define __ARCH_WANT_OLD_READDIR */ 405 404 /* #define __ARCH_WANT_OLD_STAT */ 406 405 #define __ARCH_WANT_STAT64
+1
arch/mips/Kconfig
··· 27 27 select GENERIC_IRQ_PROBE 28 28 select GENERIC_IRQ_SHOW 29 29 select HAVE_ARCH_JUMP_LABEL 30 + select ARCH_WANT_IPC_PARSE_VERSION 30 31 select IRQ_FORCED_THREADING 31 32 select HAVE_MEMBLOCK 32 33 select HAVE_MEMBLOCK_NODE_MAP
-1
arch/mips/include/asm/unistd.h
··· 1034 1034 #ifndef __ASSEMBLY__ 1035 1035 1036 1036 #define __ARCH_OMIT_COMPAT_SYS_GETDENTS64 1037 - #define __ARCH_WANT_IPC_PARSE_VERSION 1038 1037 #define __ARCH_WANT_OLD_READDIR 1039 1038 #define __ARCH_WANT_SYS_ALARM 1040 1039 #define __ARCH_WANT_SYS_GETHOSTNAME
+1
arch/mn10300/Kconfig
··· 3 3 select HAVE_OPROFILE 4 4 select HAVE_GENERIC_HARDIRQS 5 5 select GENERIC_IRQ_SHOW 6 + select ARCH_WANT_IPC_PARSE_VERSION 6 7 select HAVE_ARCH_TRACEHOOK 7 8 select HAVE_ARCH_KGDB 8 9 select HAVE_NMI_WATCHDOG if MN10300_WD_TIMER
-1
arch/mn10300/include/asm/unistd.h
··· 358 358 /* 359 359 * specify the deprecated syscalls we want to support on this arch 360 360 */ 361 - #define __ARCH_WANT_IPC_PARSE_VERSION 362 361 #define __ARCH_WANT_OLD_READDIR 363 362 #define __ARCH_WANT_OLD_STAT 364 363 #define __ARCH_WANT_STAT64
+1
arch/powerpc/Kconfig
··· 121 121 select HAVE_REGS_AND_STACK_ACCESS_API 122 122 select HAVE_HW_BREAKPOINT if PERF_EVENTS && PPC_BOOK3S_64 123 123 select HAVE_GENERIC_HARDIRQS 124 + select ARCH_WANT_IPC_PARSE_VERSION 124 125 select SPARSE_IRQ 125 126 select IRQ_PER_CPU 126 127 select IRQ_DOMAIN
-1
arch/powerpc/include/asm/unistd.h
··· 389 389 #include <linux/compiler.h> 390 390 #include <linux/linkage.h> 391 391 392 - #define __ARCH_WANT_IPC_PARSE_VERSION 393 392 #define __ARCH_WANT_OLD_READDIR 394 393 #define __ARCH_WANT_STAT64 395 394 #define __ARCH_WANT_SYS_ALARM
+1
arch/s390/Kconfig
··· 118 118 select ARCH_INLINE_WRITE_UNLOCK_BH 119 119 select ARCH_INLINE_WRITE_UNLOCK_IRQ 120 120 select ARCH_INLINE_WRITE_UNLOCK_IRQRESTORE 121 + select ARCH_WANT_IPC_PARSE_VERSION 121 122 select GENERIC_SMP_IDLE_THREAD 122 123 select GENERIC_TIME_VSYSCALL 123 124 select GENERIC_CLOCKEVENTS
-1
arch/s390/include/asm/unistd.h
··· 388 388 #define __IGNORE_recvmmsg 389 389 #define __IGNORE_sendmmsg 390 390 391 - #define __ARCH_WANT_IPC_PARSE_VERSION 392 391 #define __ARCH_WANT_OLD_READDIR 393 392 #define __ARCH_WANT_SYS_ALARM 394 393 #define __ARCH_WANT_SYS_GETHOSTNAME
+2
arch/sh/Kconfig
··· 21 21 select HAVE_KERNEL_LZMA 22 22 select HAVE_KERNEL_XZ 23 23 select HAVE_KERNEL_LZO 24 + select ARCH_WANT_IPC_PARSE_VERSION 24 25 select HAVE_SYSCALL_TRACEPOINTS 25 26 select HAVE_REGS_AND_STACK_ACCESS_API 26 27 select HAVE_GENERIC_HARDIRQS ··· 51 50 select HAVE_DYNAMIC_FTRACE 52 51 select HAVE_FUNCTION_TRACE_MCOUNT_TEST 53 52 select HAVE_FTRACE_NMI_ENTER if DYNAMIC_FTRACE 53 + select ARCH_WANT_IPC_PARSE_VERSION 54 54 select HAVE_FUNCTION_GRAPH_TRACER 55 55 select HAVE_ARCH_KGDB 56 56 select HAVE_HW_BREAKPOINT
-1
arch/sh/include/asm/unistd.h
··· 6 6 # endif 7 7 8 8 # define __ARCH_WANT_SYS_RT_SIGSUSPEND 9 - # define __ARCH_WANT_IPC_PARSE_VERSION 10 9 # define __ARCH_WANT_OLD_READDIR 11 10 # define __ARCH_WANT_OLD_STAT 12 11 # define __ARCH_WANT_STAT64
+1
arch/sparc/Kconfig
··· 27 27 select HAVE_ARCH_JUMP_LABEL 28 28 select HAVE_GENERIC_HARDIRQS 29 29 select GENERIC_IRQ_SHOW 30 + select ARCH_WANT_IPC_PARSE_VERSION 30 31 select USE_GENERIC_SMP_HELPERS if SMP 31 32 select GENERIC_PCI_IOMAP 32 33 select HAVE_NMI_WATCHDOG if SPARC64
-1
arch/sparc/include/asm/unistd.h
··· 423 423 #endif 424 424 425 425 #ifdef __KERNEL__ 426 - #define __ARCH_WANT_IPC_PARSE_VERSION 427 426 #define __ARCH_WANT_OLD_READDIR 428 427 #define __ARCH_WANT_STAT64 429 428 #define __ARCH_WANT_SYS_ALARM
+1
arch/x86/Kconfig
··· 85 85 select GENERIC_IOMAP 86 86 select DCACHE_WORD_ACCESS 87 87 select GENERIC_SMP_IDLE_THREAD 88 + select ARCH_WANT_IPC_PARSE_VERSION if X86_32 88 89 select HAVE_ARCH_SECCOMP_FILTER 89 90 select BUILDTIME_EXTABLE_SORT 90 91 select GENERIC_CMOS_UPDATE
-1
arch/x86/include/asm/unistd.h
··· 15 15 # ifdef CONFIG_X86_32 16 16 17 17 # include <asm/unistd_32.h> 18 - # define __ARCH_WANT_IPC_PARSE_VERSION 19 18 # define __ARCH_WANT_STAT64 20 19 # define __ARCH_WANT_SYS_IPC 21 20 # define __ARCH_WANT_SYS_OLD_MMAP
-1
include/linux/compat.h
··· 256 256 compat_size_t __user *len_ptr); 257 257 258 258 #ifdef CONFIG_ARCH_WANT_OLD_COMPAT_IPC 259 - #define __ARCH_WANT_COMPAT_IPC_PARSE_VERSION 260 259 long compat_sys_semctl(int first, int second, int third, void __user *uptr); 261 260 long compat_sys_msgsnd(int first, int second, int third, void __user *uptr); 262 261 long compat_sys_msgrcv(int first, int second, int msgtyp, int third,
+1 -1
ipc/compat.c
··· 118 118 119 119 static inline int compat_ipc_parse_version(int *cmd) 120 120 { 121 - #ifdef __ARCH_WANT_COMPAT_IPC_PARSE_VERSION 121 + #ifdef CONFIG_ARCH_WANT_COMPAT_IPC_PARSE_VERSION 122 122 int version = *cmd & IPC_64; 123 123 124 124 /* this is tricky: architectures that have support for the old
+2 -2
ipc/util.c
··· 804 804 return ERR_PTR(err); 805 805 } 806 806 807 - #ifdef __ARCH_WANT_IPC_PARSE_VERSION 807 + #ifdef CONFIG_ARCH_WANT_IPC_PARSE_VERSION 808 808 809 809 810 810 /** ··· 826 826 } 827 827 } 828 828 829 - #endif /* __ARCH_WANT_IPC_PARSE_VERSION */ 829 + #endif /* CONFIG_ARCH_WANT_IPC_PARSE_VERSION */ 830 830 831 831 #ifdef CONFIG_PROC_FS 832 832 struct ipc_proc_iter {
+1 -1
ipc/util.h
··· 130 130 struct ipc_ids *ids, int id, int cmd, 131 131 struct ipc64_perm *perm, int extra_perm); 132 132 133 - #ifndef __ARCH_WANT_IPC_PARSE_VERSION 133 + #ifndef CONFIG_ARCH_WANT_IPC_PARSE_VERSION 134 134 /* On IA-64, we always use the "64-bit version" of the IPC structures. */ 135 135 # define ipc_parse_version(cmd) IPC_64 136 136 #else