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/kernel | |
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/kernel')
-rw-r--r-- | arch/x86/kernel/process_64.c | 2 | ||||
-rw-r--r-- | arch/x86/kernel/sys_x86_64.c | 6 |
2 files changed, 5 insertions, 3 deletions
diff --git a/arch/x86/kernel/process_64.c b/arch/x86/kernel/process_64.c index 9b9fe4a85c8..0e900d09e23 100644 --- a/arch/x86/kernel/process_64.c +++ b/arch/x86/kernel/process_64.c | |||
@@ -508,6 +508,7 @@ void set_personality_64bit(void) | |||
508 | 508 | ||
509 | /* Make sure to be in 64bit mode */ | 509 | /* Make sure to be in 64bit mode */ |
510 | clear_thread_flag(TIF_IA32); | 510 | clear_thread_flag(TIF_IA32); |
511 | clear_thread_flag(TIF_ADDR32); | ||
511 | 512 | ||
512 | /* Ensure the corresponding mm is not marked. */ | 513 | /* Ensure the corresponding mm is not marked. */ |
513 | if (current->mm) | 514 | if (current->mm) |
@@ -526,6 +527,7 @@ void set_personality_ia32(void) | |||
526 | 527 | ||
527 | /* Make sure to be in 32bit mode */ | 528 | /* Make sure to be in 32bit mode */ |
528 | set_thread_flag(TIF_IA32); | 529 | set_thread_flag(TIF_IA32); |
530 | set_thread_flag(TIF_ADDR32); | ||
529 | current->personality |= force_personality32; | 531 | current->personality |= force_personality32; |
530 | 532 | ||
531 | /* Mark the associated mm as containing 32-bit tasks. */ | 533 | /* Mark the associated mm as containing 32-bit tasks. */ |
diff --git a/arch/x86/kernel/sys_x86_64.c b/arch/x86/kernel/sys_x86_64.c index 051489082d5..f921df8c209 100644 --- a/arch/x86/kernel/sys_x86_64.c +++ b/arch/x86/kernel/sys_x86_64.c | |||
@@ -98,7 +98,7 @@ out: | |||
98 | static void find_start_end(unsigned long flags, unsigned long *begin, | 98 | static void find_start_end(unsigned long flags, unsigned long *begin, |
99 | unsigned long *end) | 99 | unsigned long *end) |
100 | { | 100 | { |
101 | if (!test_thread_flag(TIF_IA32) && (flags & MAP_32BIT)) { | 101 | if (!test_thread_flag(TIF_ADDR32) && (flags & MAP_32BIT)) { |
102 | unsigned long new_begin; | 102 | unsigned long new_begin; |
103 | /* This is usually used needed to map code in small | 103 | /* This is usually used needed to map code in small |
104 | model, so it needs to be in the first 31bit. Limit | 104 | model, so it needs to be in the first 31bit. Limit |
@@ -144,7 +144,7 @@ arch_get_unmapped_area(struct file *filp, unsigned long addr, | |||
144 | (!vma || addr + len <= vma->vm_start)) | 144 | (!vma || addr + len <= vma->vm_start)) |
145 | return addr; | 145 | return addr; |
146 | } | 146 | } |
147 | if (((flags & MAP_32BIT) || test_thread_flag(TIF_IA32)) | 147 | if (((flags & MAP_32BIT) || test_thread_flag(TIF_ADDR32)) |
148 | && len <= mm->cached_hole_size) { | 148 | && len <= mm->cached_hole_size) { |
149 | mm->cached_hole_size = 0; | 149 | mm->cached_hole_size = 0; |
150 | mm->free_area_cache = begin; | 150 | mm->free_area_cache = begin; |
@@ -205,7 +205,7 @@ arch_get_unmapped_area_topdown(struct file *filp, const unsigned long addr0, | |||
205 | return addr; | 205 | return addr; |
206 | 206 | ||
207 | /* for MAP_32BIT mappings we force the legact mmap base */ | 207 | /* for MAP_32BIT mappings we force the legact mmap base */ |
208 | if (!test_thread_flag(TIF_IA32) && (flags & MAP_32BIT)) | 208 | if (!test_thread_flag(TIF_ADDR32) && (flags & MAP_32BIT)) |
209 | goto bottomup; | 209 | goto bottomup; |
210 | 210 | ||
211 | /* requesting a specific address */ | 211 | /* requesting a specific address */ |