aboutsummaryrefslogtreecommitdiffstats
path: root/arch/x86/include/asm/processor.h
diff options
context:
space:
mode:
Diffstat (limited to 'arch/x86/include/asm/processor.h')
-rw-r--r--arch/x86/include/asm/processor.h48
1 files changed, 33 insertions, 15 deletions
diff --git a/arch/x86/include/asm/processor.h b/arch/x86/include/asm/processor.h
index 3bfd5235a9e..9874dd98a29 100644
--- a/arch/x86/include/asm/processor.h
+++ b/arch/x86/include/asm/processor.h
@@ -16,6 +16,7 @@ struct mm_struct;
16#include <asm/cpufeature.h> 16#include <asm/cpufeature.h>
17#include <asm/system.h> 17#include <asm/system.h>
18#include <asm/page.h> 18#include <asm/page.h>
19#include <asm/pgtable_types.h>
19#include <asm/percpu.h> 20#include <asm/percpu.h>
20#include <asm/msr.h> 21#include <asm/msr.h>
21#include <asm/desc_defs.h> 22#include <asm/desc_defs.h>
@@ -73,7 +74,7 @@ struct cpuinfo_x86 {
73 char pad0; 74 char pad0;
74#else 75#else
75 /* Number of 4K pages in DTLB/ITLB combined(in pages): */ 76 /* Number of 4K pages in DTLB/ITLB combined(in pages): */
76 int x86_tlbsize; 77 int x86_tlbsize;
77 __u8 x86_virt_bits; 78 __u8 x86_virt_bits;
78 __u8 x86_phys_bits; 79 __u8 x86_phys_bits;
79#endif 80#endif
@@ -93,7 +94,7 @@ struct cpuinfo_x86 {
93 unsigned long loops_per_jiffy; 94 unsigned long loops_per_jiffy;
94#ifdef CONFIG_SMP 95#ifdef CONFIG_SMP
95 /* cpus sharing the last level cache: */ 96 /* cpus sharing the last level cache: */
96 cpumask_t llc_shared_map; 97 cpumask_var_t llc_shared_map;
97#endif 98#endif
98 /* cpuid returned max cores value: */ 99 /* cpuid returned max cores value: */
99 u16 x86_max_cores; 100 u16 x86_max_cores;
@@ -247,7 +248,6 @@ struct x86_hw_tss {
247#define IO_BITMAP_LONGS (IO_BITMAP_BYTES/sizeof(long)) 248#define IO_BITMAP_LONGS (IO_BITMAP_BYTES/sizeof(long))
248#define IO_BITMAP_OFFSET offsetof(struct tss_struct, io_bitmap) 249#define IO_BITMAP_OFFSET offsetof(struct tss_struct, io_bitmap)
249#define INVALID_IO_BITMAP_OFFSET 0x8000 250#define INVALID_IO_BITMAP_OFFSET 0x8000
250#define INVALID_IO_BITMAP_OFFSET_LAZY 0x9000
251 251
252struct tss_struct { 252struct tss_struct {
253 /* 253 /*
@@ -262,11 +262,6 @@ struct tss_struct {
262 * be within the limit. 262 * be within the limit.
263 */ 263 */
264 unsigned long io_bitmap[IO_BITMAP_LONGS + 1]; 264 unsigned long io_bitmap[IO_BITMAP_LONGS + 1];
265 /*
266 * Cache the current maximum and the last task that used the bitmap:
267 */
268 unsigned long io_bitmap_max;
269 struct thread_struct *io_bitmap_owner;
270 265
271 /* 266 /*
272 * .. and then another 0x100 bytes for the emergency kernel stack: 267 * .. and then another 0x100 bytes for the emergency kernel stack:
@@ -378,9 +373,30 @@ union thread_xstate {
378 373
379#ifdef CONFIG_X86_64 374#ifdef CONFIG_X86_64
380DECLARE_PER_CPU(struct orig_ist, orig_ist); 375DECLARE_PER_CPU(struct orig_ist, orig_ist);
376
377union irq_stack_union {
378 char irq_stack[IRQ_STACK_SIZE];
379 /*
380 * GCC hardcodes the stack canary as %gs:40. Since the
381 * irq_stack is the object at %gs:0, we reserve the bottom
382 * 48 bytes of the irq stack for the canary.
383 */
384 struct {
385 char gs_base[40];
386 unsigned long stack_canary;
387 };
388};
389
390DECLARE_PER_CPU(union irq_stack_union, irq_stack_union);
391DECLARE_INIT_PER_CPU(irq_stack_union);
392
393DECLARE_PER_CPU(char *, irq_stack_ptr);
394#else /* X86_64 */
395#ifdef CONFIG_CC_STACKPROTECTOR
396DECLARE_PER_CPU(unsigned long, stack_canary);
381#endif 397#endif
398#endif /* X86_64 */
382 399
383extern void print_cpu_info(struct cpuinfo_x86 *);
384extern unsigned int xstate_size; 400extern unsigned int xstate_size;
385extern void free_thread_xstate(struct task_struct *); 401extern void free_thread_xstate(struct task_struct *);
386extern struct kmem_cache *task_xstate_cachep; 402extern struct kmem_cache *task_xstate_cachep;
@@ -717,6 +733,7 @@ static inline void __sti_mwait(unsigned long eax, unsigned long ecx)
717extern void mwait_idle_with_hints(unsigned long eax, unsigned long ecx); 733extern void mwait_idle_with_hints(unsigned long eax, unsigned long ecx);
718 734
719extern void select_idle_routine(const struct cpuinfo_x86 *c); 735extern void select_idle_routine(const struct cpuinfo_x86 *c);
736extern void init_c1e_mask(void);
720 737
721extern unsigned long boot_option_idle_override; 738extern unsigned long boot_option_idle_override;
722extern unsigned long idle_halt; 739extern unsigned long idle_halt;
@@ -752,9 +769,9 @@ extern int sysenter_setup(void);
752extern struct desc_ptr early_gdt_descr; 769extern struct desc_ptr early_gdt_descr;
753 770
754extern void cpu_set_gdt(int); 771extern void cpu_set_gdt(int);
755extern void switch_to_new_gdt(void); 772extern void switch_to_new_gdt(int);
773extern void load_percpu_segment(int);
756extern void cpu_init(void); 774extern void cpu_init(void);
757extern void init_gdt(int cpu);
758 775
759static inline unsigned long get_debugctlmsr(void) 776static inline unsigned long get_debugctlmsr(void)
760{ 777{
@@ -839,6 +856,7 @@ static inline void spin_lock_prefetch(const void *x)
839 * User space process size: 3GB (default). 856 * User space process size: 3GB (default).
840 */ 857 */
841#define TASK_SIZE PAGE_OFFSET 858#define TASK_SIZE PAGE_OFFSET
859#define TASK_SIZE_MAX TASK_SIZE
842#define STACK_TOP TASK_SIZE 860#define STACK_TOP TASK_SIZE
843#define STACK_TOP_MAX STACK_TOP 861#define STACK_TOP_MAX STACK_TOP
844 862
@@ -898,7 +916,7 @@ extern unsigned long thread_saved_pc(struct task_struct *tsk);
898/* 916/*
899 * User space process size. 47bits minus one guard page. 917 * User space process size. 47bits minus one guard page.
900 */ 918 */
901#define TASK_SIZE64 ((1UL << 47) - PAGE_SIZE) 919#define TASK_SIZE_MAX ((1UL << 47) - PAGE_SIZE)
902 920
903/* This decides where the kernel will search for a free chunk of vm 921/* This decides where the kernel will search for a free chunk of vm
904 * space during mmap's. 922 * space during mmap's.
@@ -907,12 +925,12 @@ extern unsigned long thread_saved_pc(struct task_struct *tsk);
907 0xc0000000 : 0xFFFFe000) 925 0xc0000000 : 0xFFFFe000)
908 926
909#define TASK_SIZE (test_thread_flag(TIF_IA32) ? \ 927#define TASK_SIZE (test_thread_flag(TIF_IA32) ? \
910 IA32_PAGE_OFFSET : TASK_SIZE64) 928 IA32_PAGE_OFFSET : TASK_SIZE_MAX)
911#define TASK_SIZE_OF(child) ((test_tsk_thread_flag(child, TIF_IA32)) ? \ 929#define TASK_SIZE_OF(child) ((test_tsk_thread_flag(child, TIF_IA32)) ? \
912 IA32_PAGE_OFFSET : TASK_SIZE64) 930 IA32_PAGE_OFFSET : TASK_SIZE_MAX)
913 931
914#define STACK_TOP TASK_SIZE 932#define STACK_TOP TASK_SIZE
915#define STACK_TOP_MAX TASK_SIZE64 933#define STACK_TOP_MAX TASK_SIZE_MAX
916 934
917#define INIT_THREAD { \ 935#define INIT_THREAD { \
918 .sp0 = (unsigned long)&init_stack + sizeof(init_stack) \ 936 .sp0 = (unsigned long)&init_stack + sizeof(init_stack) \