diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2015-06-05 13:03:48 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2015-06-05 13:03:48 -0400 |
commit | 51d0f0cb3ae0da0ce5bb0bff8d1305345e6ec7ec (patch) | |
tree | 9f1be28982bca81b19887f47cd85dc7898c6f831 /arch/x86/include | |
parent | a0e9c6efa585897f00eb22e67887e5a25482b1b8 (diff) | |
parent | 425be5679fd292a3c36cb1fe423086708a99f11a (diff) |
Merge branch 'x86-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip
Pull x86 fixes from Ingo Molnar:
"Misc fixes:
- early_idt_handlers[] fix that fixes the build with bleeding edge
tooling
- build warning fix on GCC 5.1
- vm86 fix plus self-test to make it harder to break it again"
* 'x86-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
x86/asm/irq: Stop relying on magic JMP behavior for early_idt_handlers
x86/asm/entry/32, selftests: Add a selftest for kernel entries from VM86 mode
x86/boot: Add CONFIG_PARAVIRT_SPINLOCKS quirk to arch/x86/boot/compressed/misc.h
x86/asm/entry/32: Really make user_mode() work correctly for VM86 mode
Diffstat (limited to 'arch/x86/include')
-rw-r--r-- | arch/x86/include/asm/ptrace.h | 2 | ||||
-rw-r--r-- | arch/x86/include/asm/segment.h | 14 |
2 files changed, 13 insertions, 3 deletions
diff --git a/arch/x86/include/asm/ptrace.h b/arch/x86/include/asm/ptrace.h index 19507ffa5d28..5fabf1362942 100644 --- a/arch/x86/include/asm/ptrace.h +++ b/arch/x86/include/asm/ptrace.h | |||
@@ -107,7 +107,7 @@ static inline unsigned long regs_return_value(struct pt_regs *regs) | |||
107 | static inline int user_mode(struct pt_regs *regs) | 107 | static inline int user_mode(struct pt_regs *regs) |
108 | { | 108 | { |
109 | #ifdef CONFIG_X86_32 | 109 | #ifdef CONFIG_X86_32 |
110 | return (regs->cs & SEGMENT_RPL_MASK) == USER_RPL; | 110 | return ((regs->cs & SEGMENT_RPL_MASK) | (regs->flags & X86_VM_MASK)) >= USER_RPL; |
111 | #else | 111 | #else |
112 | return !!(regs->cs & 3); | 112 | return !!(regs->cs & 3); |
113 | #endif | 113 | #endif |
diff --git a/arch/x86/include/asm/segment.h b/arch/x86/include/asm/segment.h index 5a9856eb12ba..7d5a1929d76b 100644 --- a/arch/x86/include/asm/segment.h +++ b/arch/x86/include/asm/segment.h | |||
@@ -231,11 +231,21 @@ | |||
231 | #define TLS_SIZE (GDT_ENTRY_TLS_ENTRIES* 8) | 231 | #define TLS_SIZE (GDT_ENTRY_TLS_ENTRIES* 8) |
232 | 232 | ||
233 | #ifdef __KERNEL__ | 233 | #ifdef __KERNEL__ |
234 | |||
235 | /* | ||
236 | * early_idt_handler_array is an array of entry points referenced in the | ||
237 | * early IDT. For simplicity, it's a real array with one entry point | ||
238 | * every nine bytes. That leaves room for an optional 'push $0' if the | ||
239 | * vector has no error code (two bytes), a 'push $vector_number' (two | ||
240 | * bytes), and a jump to the common entry code (up to five bytes). | ||
241 | */ | ||
242 | #define EARLY_IDT_HANDLER_SIZE 9 | ||
243 | |||
234 | #ifndef __ASSEMBLY__ | 244 | #ifndef __ASSEMBLY__ |
235 | 245 | ||
236 | extern const char early_idt_handlers[NUM_EXCEPTION_VECTORS][2+2+5]; | 246 | extern const char early_idt_handler_array[NUM_EXCEPTION_VECTORS][EARLY_IDT_HANDLER_SIZE]; |
237 | #ifdef CONFIG_TRACING | 247 | #ifdef CONFIG_TRACING |
238 | # define trace_early_idt_handlers early_idt_handlers | 248 | # define trace_early_idt_handler_array early_idt_handler_array |
239 | #endif | 249 | #endif |
240 | 250 | ||
241 | /* | 251 | /* |