diff options
author | Ingo Molnar <mingo@kernel.org> | 2015-08-18 03:39:47 -0400 |
---|---|---|
committer | Ingo Molnar <mingo@kernel.org> | 2015-08-18 03:39:47 -0400 |
commit | a5dd19249607474ed680f16b4f5e8477d2b68689 (patch) | |
tree | 1aeeef053773c07bc02f3aa637febc80ceb96732 /arch/x86/math-emu | |
parent | 6b7e26547fad7ace3dcb27a5babd2317fb9d1e12 (diff) | |
parent | 512255a2ad2c832ca7d4de9f31245f73781922d0 (diff) |
Merge branch 'x86/urgent' into x86/asm to fix up conflicts and to pick up fixes
Conflicts:
arch/x86/entry/entry_64_compat.S
arch/x86/math-emu/get_address.c
Signed-off-by: Ingo Molnar <mingo@kernel.org>
Diffstat (limited to 'arch/x86/math-emu')
-rw-r--r-- | arch/x86/math-emu/fpu_entry.c | 3 | ||||
-rw-r--r-- | arch/x86/math-emu/fpu_system.h | 21 | ||||
-rw-r--r-- | arch/x86/math-emu/get_address.c | 3 |
3 files changed, 20 insertions, 7 deletions
diff --git a/arch/x86/math-emu/fpu_entry.c b/arch/x86/math-emu/fpu_entry.c index f37e84ab49f3..3d8f2e421466 100644 --- a/arch/x86/math-emu/fpu_entry.c +++ b/arch/x86/math-emu/fpu_entry.c | |||
@@ -29,7 +29,6 @@ | |||
29 | 29 | ||
30 | #include <asm/uaccess.h> | 30 | #include <asm/uaccess.h> |
31 | #include <asm/traps.h> | 31 | #include <asm/traps.h> |
32 | #include <asm/desc.h> | ||
33 | #include <asm/user.h> | 32 | #include <asm/user.h> |
34 | #include <asm/fpu/internal.h> | 33 | #include <asm/fpu/internal.h> |
35 | 34 | ||
@@ -181,7 +180,7 @@ void math_emulate(struct math_emu_info *info) | |||
181 | math_abort(FPU_info, SIGILL); | 180 | math_abort(FPU_info, SIGILL); |
182 | } | 181 | } |
183 | 182 | ||
184 | code_descriptor = LDT_DESCRIPTOR(FPU_CS); | 183 | code_descriptor = FPU_get_ldt_descriptor(FPU_CS); |
185 | if (SEG_D_SIZE(code_descriptor)) { | 184 | if (SEG_D_SIZE(code_descriptor)) { |
186 | /* The above test may be wrong, the book is not clear */ | 185 | /* The above test may be wrong, the book is not clear */ |
187 | /* Segmented 32 bit protected mode */ | 186 | /* Segmented 32 bit protected mode */ |
diff --git a/arch/x86/math-emu/fpu_system.h b/arch/x86/math-emu/fpu_system.h index 9ccecb61a4fa..5e044d506b7a 100644 --- a/arch/x86/math-emu/fpu_system.h +++ b/arch/x86/math-emu/fpu_system.h | |||
@@ -16,9 +16,24 @@ | |||
16 | #include <linux/kernel.h> | 16 | #include <linux/kernel.h> |
17 | #include <linux/mm.h> | 17 | #include <linux/mm.h> |
18 | 18 | ||
19 | /* s is always from a cpu register, and the cpu does bounds checking | 19 | #include <asm/desc.h> |
20 | * during register load --> no further bounds checks needed */ | 20 | #include <asm/mmu_context.h> |
21 | #define LDT_DESCRIPTOR(s) (((struct desc_struct *)current->mm->context.ldt)[(s) >> 3]) | 21 | |
22 | static inline struct desc_struct FPU_get_ldt_descriptor(unsigned seg) | ||
23 | { | ||
24 | static struct desc_struct zero_desc; | ||
25 | struct desc_struct ret = zero_desc; | ||
26 | |||
27 | #ifdef CONFIG_MODIFY_LDT_SYSCALL | ||
28 | seg >>= 3; | ||
29 | mutex_lock(¤t->mm->context.lock); | ||
30 | if (current->mm->context.ldt && seg < current->mm->context.ldt->size) | ||
31 | ret = current->mm->context.ldt->entries[seg]; | ||
32 | mutex_unlock(¤t->mm->context.lock); | ||
33 | #endif | ||
34 | return ret; | ||
35 | } | ||
36 | |||
22 | #define SEG_D_SIZE(x) ((x).b & (3 << 21)) | 37 | #define SEG_D_SIZE(x) ((x).b & (3 << 21)) |
23 | #define SEG_G_BIT(x) ((x).b & (1 << 23)) | 38 | #define SEG_G_BIT(x) ((x).b & (1 << 23)) |
24 | #define SEG_GRANULARITY(x) (((x).b & (1 << 23)) ? 4096 : 1) | 39 | #define SEG_GRANULARITY(x) (((x).b & (1 << 23)) ? 4096 : 1) |
diff --git a/arch/x86/math-emu/get_address.c b/arch/x86/math-emu/get_address.c index a2eefb121a5f..8db26591d91a 100644 --- a/arch/x86/math-emu/get_address.c +++ b/arch/x86/math-emu/get_address.c | |||
@@ -20,7 +20,6 @@ | |||
20 | #include <linux/stddef.h> | 20 | #include <linux/stddef.h> |
21 | 21 | ||
22 | #include <asm/uaccess.h> | 22 | #include <asm/uaccess.h> |
23 | #include <asm/desc.h> | ||
24 | #include <asm/vm86.h> | 23 | #include <asm/vm86.h> |
25 | 24 | ||
26 | #include "fpu_system.h" | 25 | #include "fpu_system.h" |
@@ -159,7 +158,7 @@ static long pm_address(u_char FPU_modrm, u_char segment, | |||
159 | addr->selector = PM_REG_(segment); | 158 | addr->selector = PM_REG_(segment); |
160 | } | 159 | } |
161 | 160 | ||
162 | descriptor = LDT_DESCRIPTOR(PM_REG_(segment)); | 161 | descriptor = FPU_get_ldt_descriptor(addr->selector); |
163 | base_address = SEG_BASE_ADDR(descriptor); | 162 | base_address = SEG_BASE_ADDR(descriptor); |
164 | address = base_address + offset; | 163 | address = base_address + offset; |
165 | limit = base_address | 164 | limit = base_address |