aboutsummaryrefslogtreecommitdiffstats
path: root/arch/x86/kernel/cpu/common.c
diff options
context:
space:
mode:
Diffstat (limited to 'arch/x86/kernel/cpu/common.c')
-rw-r--r--arch/x86/kernel/cpu/common.c18
1 files changed, 12 insertions, 6 deletions
diff --git a/arch/x86/kernel/cpu/common.c b/arch/x86/kernel/cpu/common.c
index 24b6fd10625a..a135239badb7 100644
--- a/arch/x86/kernel/cpu/common.c
+++ b/arch/x86/kernel/cpu/common.c
@@ -284,8 +284,13 @@ static __always_inline void setup_smap(struct cpuinfo_x86 *c)
284 raw_local_save_flags(eflags); 284 raw_local_save_flags(eflags);
285 BUG_ON(eflags & X86_EFLAGS_AC); 285 BUG_ON(eflags & X86_EFLAGS_AC);
286 286
287 if (cpu_has(c, X86_FEATURE_SMAP)) 287 if (cpu_has(c, X86_FEATURE_SMAP)) {
288#ifdef CONFIG_X86_SMAP
288 set_in_cr4(X86_CR4_SMAP); 289 set_in_cr4(X86_CR4_SMAP);
290#else
291 clear_in_cr4(X86_CR4_SMAP);
292#endif
293 }
289} 294}
290 295
291/* 296/*
@@ -1020,7 +1025,8 @@ __setup("show_msr=", setup_show_msr);
1020 1025
1021static __init int setup_noclflush(char *arg) 1026static __init int setup_noclflush(char *arg)
1022{ 1027{
1023 setup_clear_cpu_cap(X86_FEATURE_CLFLSH); 1028 setup_clear_cpu_cap(X86_FEATURE_CLFLUSH);
1029 setup_clear_cpu_cap(X86_FEATURE_CLFLUSHOPT);
1024 return 1; 1030 return 1;
1025} 1031}
1026__setup("noclflush", setup_noclflush); 1032__setup("noclflush", setup_noclflush);
@@ -1073,6 +1079,10 @@ static __init int setup_disablecpuid(char *arg)
1073} 1079}
1074__setup("clearcpuid=", setup_disablecpuid); 1080__setup("clearcpuid=", setup_disablecpuid);
1075 1081
1082DEFINE_PER_CPU(unsigned long, kernel_stack) =
1083 (unsigned long)&init_thread_union - KERNEL_STACK_OFFSET + THREAD_SIZE;
1084EXPORT_PER_CPU_SYMBOL(kernel_stack);
1085
1076#ifdef CONFIG_X86_64 1086#ifdef CONFIG_X86_64
1077struct desc_ptr idt_descr = { NR_VECTORS * 16 - 1, (unsigned long) idt_table }; 1087struct desc_ptr idt_descr = { NR_VECTORS * 16 - 1, (unsigned long) idt_table };
1078struct desc_ptr debug_idt_descr = { NR_VECTORS * 16 - 1, 1088struct desc_ptr debug_idt_descr = { NR_VECTORS * 16 - 1,
@@ -1089,10 +1099,6 @@ DEFINE_PER_CPU(struct task_struct *, current_task) ____cacheline_aligned =
1089 &init_task; 1099 &init_task;
1090EXPORT_PER_CPU_SYMBOL(current_task); 1100EXPORT_PER_CPU_SYMBOL(current_task);
1091 1101
1092DEFINE_PER_CPU(unsigned long, kernel_stack) =
1093 (unsigned long)&init_thread_union - KERNEL_STACK_OFFSET + THREAD_SIZE;
1094EXPORT_PER_CPU_SYMBOL(kernel_stack);
1095
1096DEFINE_PER_CPU(char *, irq_stack_ptr) = 1102DEFINE_PER_CPU(char *, irq_stack_ptr) =
1097 init_per_cpu_var(irq_stack_union.irq_stack) + IRQ_STACK_SIZE - 64; 1103 init_per_cpu_var(irq_stack_union.irq_stack) + IRQ_STACK_SIZE - 64;
1098 1104