]> git.kernelconcepts.de Git - karo-tx-linux.git/commitdiff
x32: Add a thread flag for x32 processes
authorH. Peter Anvin <hpa@zytor.com>
Tue, 14 Feb 2012 21:56:49 +0000 (13:56 -0800)
committerH. Peter Anvin <hpa@zytor.com>
Mon, 20 Feb 2012 20:48:49 +0000 (12:48 -0800)
An x32 process is *almost* the same thing as a 64-bit process with a
32-bit address limit, but there are a few minor differences -- in
particular core dumps are 32 bits and signal handling is different.

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
arch/x86/include/asm/thread_info.h
arch/x86/kernel/process_64.c

index d1803a495b35dca0fcc8444798718f8f0f212bcb..912e93511466ff3b59b6c32e552b821fb2fb0e4d 100644 (file)
@@ -96,6 +96,7 @@ struct thread_info {
 #define TIF_LAZY_MMU_UPDATES   27      /* task is updating the mmu lazily */
 #define TIF_SYSCALL_TRACEPOINT 28      /* syscall tracepoint instrumentation */
 #define TIF_ADDR32             29      /* 32-bit address space on 64 bits */
+#define TIF_X32                        30      /* 32-bit native x86-64 binary */
 
 #define _TIF_SYSCALL_TRACE     (1 << TIF_SYSCALL_TRACE)
 #define _TIF_NOTIFY_RESUME     (1 << TIF_NOTIFY_RESUME)
@@ -118,6 +119,7 @@ struct thread_info {
 #define _TIF_LAZY_MMU_UPDATES  (1 << TIF_LAZY_MMU_UPDATES)
 #define _TIF_SYSCALL_TRACEPOINT        (1 << TIF_SYSCALL_TRACEPOINT)
 #define _TIF_ADDR32            (1 << TIF_ADDR32)
+#define _TIF_X32               (1 << TIF_X32)
 
 /* work to do in syscall_trace_enter() */
 #define _TIF_WORK_SYSCALL_ENTRY        \
index 0e900d09e2328b08d1f2670ea4ce3920127e77b8..5fe2fbaa56ba264168f2d2c6d9ba53ed7d57a1ee 100644 (file)
@@ -509,6 +509,7 @@ void set_personality_64bit(void)
        /* Make sure to be in 64bit mode */
        clear_thread_flag(TIF_IA32);
        clear_thread_flag(TIF_ADDR32);
+       clear_thread_flag(TIF_X32);
 
        /* Ensure the corresponding mm is not marked. */
        if (current->mm)
@@ -528,6 +529,7 @@ void set_personality_ia32(void)
        /* Make sure to be in 32bit mode */
        set_thread_flag(TIF_IA32);
        set_thread_flag(TIF_ADDR32);
+       clear_thread_flag(TIF_X32);
        current->personality |= force_personality32;
 
        /* Mark the associated mm as containing 32-bit tasks. */