Merge branch 'x86-x32-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git...
Linus Torvalds [Fri, 30 Mar 2012 01:12:23 +0000 (18:12 -0700)]
Pull x32 support for x86-64 from Ingo Molnar:
 "This tree introduces the X32 binary format and execution mode for x86:
  32-bit data space binaries using 64-bit instructions and 64-bit kernel
  syscalls.

  This allows applications whose working set fits into a 32 bits address
  space to make use of 64-bit instructions while using a 32-bit address
  space with shorter pointers, more compressed data structures, etc."

Fix up trivial context conflicts in arch/x86/{Kconfig,vdso/vma.c}

* 'x86-x32-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: (71 commits)
  x32: Fix alignment fail in struct compat_siginfo
  x32: Fix stupid ia32/x32 inversion in the siginfo format
  x32: Add ptrace for x32
  x32: Switch to a 64-bit clock_t
  x32: Provide separate is_ia32_task() and is_x32_task() predicates
  x86, mtrr: Use explicit sizing and padding for the 64-bit ioctls
  x86/x32: Fix the binutils auto-detect
  x32: Warn and disable rather than error if binutils too old
  x32: Only clear TIF_X32 flag once
  x32: Make sure TS_COMPAT is cleared for x32 tasks
  fs: Remove missed ->fds_bits from cessation use of fd_set structs internally
  fs: Fix close_on_exec pointer in alloc_fdtable
  x32: Drop non-__vdso weak symbols from the x32 VDSO
  x32: Fix coding style violations in the x32 VDSO code
  x32: Add x32 VDSO support
  x32: Allow x32 to be configured
  x32: If configured, add x32 system calls to system call tables
  x32: Handle process creation
  x32: Signal-related system calls
  x86: Add #ifdef CONFIG_COMPAT to <asm/sys_ia32.h>
  ...

32 files changed:
1  2 
arch/x86/Kconfig
arch/x86/ia32/ia32_signal.c
arch/x86/include/asm/elf.h
arch/x86/include/asm/processor.h
arch/x86/include/asm/thread_info.h
arch/x86/kernel/cpu/perf_event.c
arch/x86/kernel/entry_64.S
arch/x86/kernel/process_64.c
arch/x86/kernel/ptrace.c
arch/x86/kernel/signal.c
arch/x86/kernel/sys_x86_64.c
arch/x86/syscalls/syscall_32.tbl
arch/x86/vdso/vdso32-setup.c
arch/x86/vdso/vma.c
drivers/char/lp.c
drivers/staging/android/binder.c
fs/autofs4/dev-ioctl.c
fs/binfmt_elf.c
fs/compat.c
fs/exec.c
fs/file.c
fs/proc/base.c
fs/select.c
include/linux/Kbuild
include/linux/compat.h
include/linux/kernel.h
include/linux/time.h
kernel/exit.c
net/bluetooth/hci_sock.c
net/compat.c
net/socket.c
security/selinux/hooks.c

@@@ -2173,10 -2175,22 +2173,23 @@@ config IA32_AOU
        ---help---
          Support old a.out binaries in the 32bit emulation.
  
+ config X86_X32
+       bool "x32 ABI for 64-bit mode (EXPERIMENTAL)"
+       depends on X86_64 && IA32_EMULATION && EXPERIMENTAL
+       ---help---
+         Include code to run binaries for the x32 native 32-bit ABI
+         for 64-bit processors.  An x32 process gets access to the
+         full 64-bit register file and wide data path while leaving
+         pointers at 32 bits for smaller memory footprint.
+         You will need a recent binutils (2.22 or later) with
+         elf32_x86_64 support enabled to compile a kernel with this
+         option set.
  config COMPAT
        def_bool y
-       depends on IA32_EMULATION
+       depends on IA32_EMULATION || X86_X32
 +      select ARCH_WANT_OLD_COMPAT_IPC
  
  config COMPAT_FOR_U64_ALIGNMENT
        def_bool COMPAT
Simple merge
Simple merge
Simple merge
Simple merge
  #include <asm/apic.h>
  #include <asm/stacktrace.h>
  #include <asm/nmi.h>
- #include <asm/compat.h>
  #include <asm/smp.h>
  #include <asm/alternative.h>
 +#include <asm/timer.h>
  
  #include "perf_event.h"
  
Simple merge
Simple merge
Simple merge
  #include <asm/processor.h>
  #include <asm/ucontext.h>
  #include <asm/i387.h>
 +#include <asm/fpu-internal.h>
  #include <asm/vdso.h>
  #include <asm/mce.h>
+ #include <asm/sighandling.h>
  
  #ifdef CONFIG_X86_64
  #include <asm/proto.h>
Simple merge
Simple merge
Simple merge
@@@ -122,10 -170,11 +170,10 @@@ static int setup_additional_pages(struc
  
        current->mm->context.vdso = (void *)addr;
  
-       ret = install_special_mapping(mm, addr, vdso_size,
+       ret = install_special_mapping(mm, addr, size,
                                      VM_READ|VM_EXEC|
 -                                    VM_MAYREAD|VM_MAYWRITE|VM_MAYEXEC|
 -                                    VM_ALWAYSDUMP,
 +                                    VM_MAYREAD|VM_MAYWRITE|VM_MAYEXEC,
-                                     vdso_pages);
+                                     pages);
        if (ret) {
                current->mm->context.vdso = NULL;
                goto up_fail;
Simple merge
Simple merge
Simple merge
diff --cc fs/binfmt_elf.c
Simple merge
diff --cc fs/compat.c
Simple merge
diff --cc fs/exec.c
Simple merge
diff --cc fs/file.c
Simple merge
diff --cc fs/proc/base.c
Simple merge
diff --cc fs/select.c
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
diff --cc kernel/exit.c
Simple merge
Simple merge
diff --cc net/compat.c
Simple merge
diff --cc net/socket.c
Simple merge
Simple merge