diff options
| author | H. Peter Anvin <hpa@zytor.com> | 2012-02-06 16:03:09 -0500 |
|---|---|---|
| committer | H. Peter Anvin <hpa@zytor.com> | 2012-02-20 15:48:46 -0500 |
| commit | 6bd330083e0e97b7ddc053459190bf3d5768ca83 (patch) | |
| tree | c0fc2e703c4ce13b33cc364e5ad3eac712b57fb7 /arch/x86/include/asm | |
| parent | cf420048b3b2af9ce928d35cc5455c646c9dd2f7 (diff) | |
x86: Factor out TIF_IA32 from 32-bit address space
Factor out IA32 (compatibility instruction set) from 32-bit address
space in the thread_info flags; this is a precondition patch for x32
support.
Originally-by: H. J. Lu <hjl.tools@gmail.com>
Signed-off-by: H. Peter Anvin <hpa@zytor.com>
Link: http://lkml.kernel.org/n/tip-4pr1xnnksprt7t0h3w5fw4rv@git.kernel.org
Diffstat (limited to 'arch/x86/include/asm')
| -rw-r--r-- | arch/x86/include/asm/elf.h | 4 | ||||
| -rw-r--r-- | arch/x86/include/asm/processor.h | 4 | ||||
| -rw-r--r-- | arch/x86/include/asm/thread_info.h | 4 |
3 files changed, 7 insertions, 5 deletions
diff --git a/arch/x86/include/asm/elf.h b/arch/x86/include/asm/elf.h index 5f962df30d0f..410fa6a219f6 100644 --- a/arch/x86/include/asm/elf.h +++ b/arch/x86/include/asm/elf.h | |||
| @@ -287,7 +287,7 @@ do { \ | |||
| 287 | #define VDSO_HIGH_BASE 0xffffe000U /* CONFIG_COMPAT_VDSO address */ | 287 | #define VDSO_HIGH_BASE 0xffffe000U /* CONFIG_COMPAT_VDSO address */ |
| 288 | 288 | ||
| 289 | /* 1GB for 64bit, 8MB for 32bit */ | 289 | /* 1GB for 64bit, 8MB for 32bit */ |
| 290 | #define STACK_RND_MASK (test_thread_flag(TIF_IA32) ? 0x7ff : 0x3fffff) | 290 | #define STACK_RND_MASK (test_thread_flag(TIF_ADDR32) ? 0x7ff : 0x3fffff) |
| 291 | 291 | ||
| 292 | #define ARCH_DLINFO \ | 292 | #define ARCH_DLINFO \ |
| 293 | do { \ | 293 | do { \ |
| @@ -330,7 +330,7 @@ static inline int mmap_is_ia32(void) | |||
| 330 | return 1; | 330 | return 1; |
| 331 | #endif | 331 | #endif |
| 332 | #ifdef CONFIG_IA32_EMULATION | 332 | #ifdef CONFIG_IA32_EMULATION |
| 333 | if (test_thread_flag(TIF_IA32)) | 333 | if (test_thread_flag(TIF_ADDR32)) |
| 334 | return 1; | 334 | return 1; |
| 335 | #endif | 335 | #endif |
| 336 | return 0; | 336 | return 0; |
diff --git a/arch/x86/include/asm/processor.h b/arch/x86/include/asm/processor.h index aa9088c26931..9f748b5fb701 100644 --- a/arch/x86/include/asm/processor.h +++ b/arch/x86/include/asm/processor.h | |||
| @@ -924,9 +924,9 @@ extern unsigned long thread_saved_pc(struct task_struct *tsk); | |||
| 924 | #define IA32_PAGE_OFFSET ((current->personality & ADDR_LIMIT_3GB) ? \ | 924 | #define IA32_PAGE_OFFSET ((current->personality & ADDR_LIMIT_3GB) ? \ |
| 925 | 0xc0000000 : 0xFFFFe000) | 925 | 0xc0000000 : 0xFFFFe000) |
| 926 | 926 | ||
| 927 | #define TASK_SIZE (test_thread_flag(TIF_IA32) ? \ | 927 | #define TASK_SIZE (test_thread_flag(TIF_ADDR32) ? \ |
| 928 | IA32_PAGE_OFFSET : TASK_SIZE_MAX) | 928 | IA32_PAGE_OFFSET : TASK_SIZE_MAX) |
| 929 | #define TASK_SIZE_OF(child) ((test_tsk_thread_flag(child, TIF_IA32)) ? \ | 929 | #define TASK_SIZE_OF(child) ((test_tsk_thread_flag(child, TIF_ADDR32)) ? \ |
| 930 | IA32_PAGE_OFFSET : TASK_SIZE_MAX) | 930 | IA32_PAGE_OFFSET : TASK_SIZE_MAX) |
| 931 | 931 | ||
| 932 | #define STACK_TOP TASK_SIZE | 932 | #define STACK_TOP TASK_SIZE |
diff --git a/arch/x86/include/asm/thread_info.h b/arch/x86/include/asm/thread_info.h index bc817cd8b443..d1803a495b35 100644 --- a/arch/x86/include/asm/thread_info.h +++ b/arch/x86/include/asm/thread_info.h | |||
| @@ -86,7 +86,7 @@ struct thread_info { | |||
| 86 | #define TIF_MCE_NOTIFY 10 /* notify userspace of an MCE */ | 86 | #define TIF_MCE_NOTIFY 10 /* notify userspace of an MCE */ |
| 87 | #define TIF_USER_RETURN_NOTIFY 11 /* notify kernel of userspace return */ | 87 | #define TIF_USER_RETURN_NOTIFY 11 /* notify kernel of userspace return */ |
| 88 | #define TIF_NOTSC 16 /* TSC is not accessible in userland */ | 88 | #define TIF_NOTSC 16 /* TSC is not accessible in userland */ |
| 89 | #define TIF_IA32 17 /* 32bit process */ | 89 | #define TIF_IA32 17 /* IA32 compatibility process */ |
| 90 | #define TIF_FORK 18 /* ret_from_fork */ | 90 | #define TIF_FORK 18 /* ret_from_fork */ |
| 91 | #define TIF_MEMDIE 20 /* is terminating due to OOM killer */ | 91 | #define TIF_MEMDIE 20 /* is terminating due to OOM killer */ |
| 92 | #define TIF_DEBUG 21 /* uses debug registers */ | 92 | #define TIF_DEBUG 21 /* uses debug registers */ |
| @@ -95,6 +95,7 @@ struct thread_info { | |||
| 95 | #define TIF_BLOCKSTEP 25 /* set when we want DEBUGCTLMSR_BTF */ | 95 | #define TIF_BLOCKSTEP 25 /* set when we want DEBUGCTLMSR_BTF */ |
| 96 | #define TIF_LAZY_MMU_UPDATES 27 /* task is updating the mmu lazily */ | 96 | #define TIF_LAZY_MMU_UPDATES 27 /* task is updating the mmu lazily */ |
| 97 | #define TIF_SYSCALL_TRACEPOINT 28 /* syscall tracepoint instrumentation */ | 97 | #define TIF_SYSCALL_TRACEPOINT 28 /* syscall tracepoint instrumentation */ |
| 98 | #define TIF_ADDR32 29 /* 32-bit address space on 64 bits */ | ||
| 98 | 99 | ||
| 99 | #define _TIF_SYSCALL_TRACE (1 << TIF_SYSCALL_TRACE) | 100 | #define _TIF_SYSCALL_TRACE (1 << TIF_SYSCALL_TRACE) |
| 100 | #define _TIF_NOTIFY_RESUME (1 << TIF_NOTIFY_RESUME) | 101 | #define _TIF_NOTIFY_RESUME (1 << TIF_NOTIFY_RESUME) |
| @@ -116,6 +117,7 @@ struct thread_info { | |||
| 116 | #define _TIF_BLOCKSTEP (1 << TIF_BLOCKSTEP) | 117 | #define _TIF_BLOCKSTEP (1 << TIF_BLOCKSTEP) |
| 117 | #define _TIF_LAZY_MMU_UPDATES (1 << TIF_LAZY_MMU_UPDATES) | 118 | #define _TIF_LAZY_MMU_UPDATES (1 << TIF_LAZY_MMU_UPDATES) |
| 118 | #define _TIF_SYSCALL_TRACEPOINT (1 << TIF_SYSCALL_TRACEPOINT) | 119 | #define _TIF_SYSCALL_TRACEPOINT (1 << TIF_SYSCALL_TRACEPOINT) |
| 120 | #define _TIF_ADDR32 (1 << TIF_ADDR32) | ||
| 119 | 121 | ||
| 120 | /* work to do in syscall_trace_enter() */ | 122 | /* work to do in syscall_trace_enter() */ |
| 121 | #define _TIF_WORK_SYSCALL_ENTRY \ | 123 | #define _TIF_WORK_SYSCALL_ENTRY \ |
