diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2014-12-14 14:51:50 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2014-12-14 14:51:50 -0500 |
commit | 536e89ee53e9cbdec00e49ae1888bffa262043d8 (patch) | |
tree | 79f842cdd5217986204faf8d4c0aa707b64356bf /arch/x86/include/asm/segment.h | |
parent | 9ea18f8cab5f1c36cdd0f09717e35ceb48c36a87 (diff) | |
parent | 0e58af4e1d2166e9e33375a0f121e4867010d4f8 (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 (mainly Andy's TLS fixes), plus a cleanup"
* 'x86-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
x86/tls: Disallow unusual TLS segments
x86/tls: Validate TLS entries to protect espfix
MAINTAINERS: Add me as x86 VDSO submaintainer
x86/asm: Unify segment selector defines
x86/asm: Guard against building the 32/64-bit versions of the asm-offsets*.c file directly
x86_64, switch_to(): Load TLS descriptors before switching DS and ES
x86/mm: Use min() instead of min_t() in the e820 printout code
x86/mm: Fix zone ranges boot printout
x86/doc: Update documentation after file shuffling
Diffstat (limited to 'arch/x86/include/asm/segment.h')
-rw-r--r-- | arch/x86/include/asm/segment.h | 30 |
1 files changed, 9 insertions, 21 deletions
diff --git a/arch/x86/include/asm/segment.h b/arch/x86/include/asm/segment.h index 6f1c3a8a33ab..db257a58571f 100644 --- a/arch/x86/include/asm/segment.h +++ b/arch/x86/include/asm/segment.h | |||
@@ -23,6 +23,15 @@ | |||
23 | #define GDT_ENTRY_BOOT_TSS (GDT_ENTRY_BOOT_CS + 2) | 23 | #define GDT_ENTRY_BOOT_TSS (GDT_ENTRY_BOOT_CS + 2) |
24 | #define __BOOT_TSS (GDT_ENTRY_BOOT_TSS * 8) | 24 | #define __BOOT_TSS (GDT_ENTRY_BOOT_TSS * 8) |
25 | 25 | ||
26 | #define SEGMENT_RPL_MASK 0x3 /* | ||
27 | * Bottom two bits of selector give the ring | ||
28 | * privilege level | ||
29 | */ | ||
30 | #define SEGMENT_TI_MASK 0x4 /* Bit 2 is table indicator (LDT/GDT) */ | ||
31 | #define USER_RPL 0x3 /* User mode is privilege level 3 */ | ||
32 | #define SEGMENT_LDT 0x4 /* LDT segment has TI set... */ | ||
33 | #define SEGMENT_GDT 0x0 /* ... GDT has it cleared */ | ||
34 | |||
26 | #ifdef CONFIG_X86_32 | 35 | #ifdef CONFIG_X86_32 |
27 | /* | 36 | /* |
28 | * The layout of the per-CPU GDT under Linux: | 37 | * The layout of the per-CPU GDT under Linux: |
@@ -125,16 +134,6 @@ | |||
125 | #define PNP_TS1 (GDT_ENTRY_PNPBIOS_TS1 * 8) /* transfer data segment */ | 134 | #define PNP_TS1 (GDT_ENTRY_PNPBIOS_TS1 * 8) /* transfer data segment */ |
126 | #define PNP_TS2 (GDT_ENTRY_PNPBIOS_TS2 * 8) /* another data segment */ | 135 | #define PNP_TS2 (GDT_ENTRY_PNPBIOS_TS2 * 8) /* another data segment */ |
127 | 136 | ||
128 | /* Bottom two bits of selector give the ring privilege level */ | ||
129 | #define SEGMENT_RPL_MASK 0x3 | ||
130 | /* Bit 2 is table indicator (LDT/GDT) */ | ||
131 | #define SEGMENT_TI_MASK 0x4 | ||
132 | |||
133 | /* User mode is privilege level 3 */ | ||
134 | #define USER_RPL 0x3 | ||
135 | /* LDT segment has TI set, GDT has it cleared */ | ||
136 | #define SEGMENT_LDT 0x4 | ||
137 | #define SEGMENT_GDT 0x0 | ||
138 | 137 | ||
139 | /* | 138 | /* |
140 | * Matching rules for certain types of segments. | 139 | * Matching rules for certain types of segments. |
@@ -192,17 +191,6 @@ | |||
192 | #define get_kernel_rpl() 0 | 191 | #define get_kernel_rpl() 0 |
193 | #endif | 192 | #endif |
194 | 193 | ||
195 | /* User mode is privilege level 3 */ | ||
196 | #define USER_RPL 0x3 | ||
197 | /* LDT segment has TI set, GDT has it cleared */ | ||
198 | #define SEGMENT_LDT 0x4 | ||
199 | #define SEGMENT_GDT 0x0 | ||
200 | |||
201 | /* Bottom two bits of selector give the ring privilege level */ | ||
202 | #define SEGMENT_RPL_MASK 0x3 | ||
203 | /* Bit 2 is table indicator (LDT/GDT) */ | ||
204 | #define SEGMENT_TI_MASK 0x4 | ||
205 | |||
206 | #define IDT_ENTRIES 256 | 194 | #define IDT_ENTRIES 256 |
207 | #define NUM_EXCEPTION_VECTORS 32 | 195 | #define NUM_EXCEPTION_VECTORS 32 |
208 | /* Bitmask of exception vectors which push an error code on the stack */ | 196 | /* Bitmask of exception vectors which push an error code on the stack */ |