aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2013-07-02 19:24:24 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2013-07-02 19:24:24 -0400
commit35c23d5d797629a83389bf5dccc5e4a7fb477504 (patch)
tree6031a0713cb1434cd9334dc23665b08d43738313
parent57935b262c40a3cbe54c5a61be230331a48f0a3a (diff)
parent719038de98bc8479b771c582a1e4a1e86079da22 (diff)
Merge branch 'x86-cpu-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip
Pull x86 cpu updates from Ingo Molnar: "Two changes: - Extend 32-bit double fault debugging aid to 64-bit - Fix a build warning" * 'x86-cpu-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: x86/intel/cacheinfo: Shut up last long-standing warning x86: Extend #DF debugging aid to 64-bit
-rw-r--r--arch/x86/Kconfig.debug1
-rw-r--r--arch/x86/include/asm/processor.h2
-rw-r--r--arch/x86/kernel/Makefile2
-rw-r--r--arch/x86/kernel/cpu/intel_cacheinfo.c52
-rw-r--r--arch/x86/kernel/doublefault.c (renamed from arch/x86/kernel/doublefault_32.c)15
-rw-r--r--arch/x86/kernel/traps.c3
6 files changed, 45 insertions, 30 deletions
diff --git a/arch/x86/Kconfig.debug b/arch/x86/Kconfig.debug
index c198b7e13e7b..b6a770132b67 100644
--- a/arch/x86/Kconfig.debug
+++ b/arch/x86/Kconfig.debug
@@ -122,7 +122,6 @@ config DEBUG_NX_TEST
122config DOUBLEFAULT 122config DOUBLEFAULT
123 default y 123 default y
124 bool "Enable doublefault exception handler" if EXPERT 124 bool "Enable doublefault exception handler" if EXPERT
125 depends on X86_32
126 ---help--- 125 ---help---
127 This option allows trapping of rare doublefault exceptions that 126 This option allows trapping of rare doublefault exceptions that
128 would otherwise cause a system to silently reboot. Disabling this 127 would otherwise cause a system to silently reboot. Disabling this
diff --git a/arch/x86/include/asm/processor.h b/arch/x86/include/asm/processor.h
index 22224b3b43bb..5b87d52eed0b 100644
--- a/arch/x86/include/asm/processor.h
+++ b/arch/x86/include/asm/processor.h
@@ -981,5 +981,5 @@ bool xen_set_default_idle(void);
981#endif 981#endif
982 982
983void stop_this_cpu(void *dummy); 983void stop_this_cpu(void *dummy);
984 984void df_debug(struct pt_regs *regs, long error_code);
985#endif /* _ASM_X86_PROCESSOR_H */ 985#endif /* _ASM_X86_PROCESSOR_H */
diff --git a/arch/x86/kernel/Makefile b/arch/x86/kernel/Makefile
index 7bd3bd310106..4ce822ed58f5 100644
--- a/arch/x86/kernel/Makefile
+++ b/arch/x86/kernel/Makefile
@@ -67,7 +67,7 @@ obj-$(CONFIG_KEXEC) += relocate_kernel_$(BITS).o crash.o
67obj-$(CONFIG_CRASH_DUMP) += crash_dump_$(BITS).o 67obj-$(CONFIG_CRASH_DUMP) += crash_dump_$(BITS).o
68obj-y += kprobes/ 68obj-y += kprobes/
69obj-$(CONFIG_MODULES) += module.o 69obj-$(CONFIG_MODULES) += module.o
70obj-$(CONFIG_DOUBLEFAULT) += doublefault_32.o 70obj-$(CONFIG_DOUBLEFAULT) += doublefault.o
71obj-$(CONFIG_KGDB) += kgdb.o 71obj-$(CONFIG_KGDB) += kgdb.o
72obj-$(CONFIG_VM86) += vm86_32.o 72obj-$(CONFIG_VM86) += vm86_32.o
73obj-$(CONFIG_EARLY_PRINTK) += early_printk.o 73obj-$(CONFIG_EARLY_PRINTK) += early_printk.o
diff --git a/arch/x86/kernel/cpu/intel_cacheinfo.c b/arch/x86/kernel/cpu/intel_cacheinfo.c
index 7c6f7d548c0f..8dc72dda66fe 100644
--- a/arch/x86/kernel/cpu/intel_cacheinfo.c
+++ b/arch/x86/kernel/cpu/intel_cacheinfo.c
@@ -618,36 +618,34 @@ unsigned int __cpuinit init_intel_cacheinfo(struct cpuinfo_x86 *c)
618 * parameters cpuid leaf to find the cache details 618 * parameters cpuid leaf to find the cache details
619 */ 619 */
620 for (i = 0; i < num_cache_leaves; i++) { 620 for (i = 0; i < num_cache_leaves; i++) {
621 struct _cpuid4_info_regs this_leaf; 621 struct _cpuid4_info_regs this_leaf = {};
622 int retval; 622 int retval;
623 623
624 retval = cpuid4_cache_lookup_regs(i, &this_leaf); 624 retval = cpuid4_cache_lookup_regs(i, &this_leaf);
625 if (retval >= 0) { 625 if (retval < 0)
626 switch (this_leaf.eax.split.level) { 626 continue;
627 case 1: 627
628 if (this_leaf.eax.split.type == 628 switch (this_leaf.eax.split.level) {
629 CACHE_TYPE_DATA) 629 case 1:
630 new_l1d = this_leaf.size/1024; 630 if (this_leaf.eax.split.type == CACHE_TYPE_DATA)
631 else if (this_leaf.eax.split.type == 631 new_l1d = this_leaf.size/1024;
632 CACHE_TYPE_INST) 632 else if (this_leaf.eax.split.type == CACHE_TYPE_INST)
633 new_l1i = this_leaf.size/1024; 633 new_l1i = this_leaf.size/1024;
634 break; 634 break;
635 case 2: 635 case 2:
636 new_l2 = this_leaf.size/1024; 636 new_l2 = this_leaf.size/1024;
637 num_threads_sharing = 1 + this_leaf.eax.split.num_threads_sharing; 637 num_threads_sharing = 1 + this_leaf.eax.split.num_threads_sharing;
638 index_msb = get_count_order(num_threads_sharing); 638 index_msb = get_count_order(num_threads_sharing);
639 l2_id = c->apicid & ~((1 << index_msb) - 1); 639 l2_id = c->apicid & ~((1 << index_msb) - 1);
640 break; 640 break;
641 case 3: 641 case 3:
642 new_l3 = this_leaf.size/1024; 642 new_l3 = this_leaf.size/1024;
643 num_threads_sharing = 1 + this_leaf.eax.split.num_threads_sharing; 643 num_threads_sharing = 1 + this_leaf.eax.split.num_threads_sharing;
644 index_msb = get_count_order( 644 index_msb = get_count_order(num_threads_sharing);
645 num_threads_sharing); 645 l3_id = c->apicid & ~((1 << index_msb) - 1);
646 l3_id = c->apicid & ~((1 << index_msb) - 1); 646 break;
647 break; 647 default:
648 default: 648 break;
649 break;
650 }
651 } 649 }
652 } 650 }
653 } 651 }
diff --git a/arch/x86/kernel/doublefault_32.c b/arch/x86/kernel/doublefault.c
index 155a13f33ed8..5d3fe8d36e4a 100644
--- a/arch/x86/kernel/doublefault_32.c
+++ b/arch/x86/kernel/doublefault.c
@@ -9,6 +9,8 @@
9#include <asm/processor.h> 9#include <asm/processor.h>
10#include <asm/desc.h> 10#include <asm/desc.h>
11 11
12#ifdef CONFIG_X86_32
13
12#define DOUBLEFAULT_STACKSIZE (1024) 14#define DOUBLEFAULT_STACKSIZE (1024)
13static unsigned long doublefault_stack[DOUBLEFAULT_STACKSIZE]; 15static unsigned long doublefault_stack[DOUBLEFAULT_STACKSIZE];
14#define STACK_START (unsigned long)(doublefault_stack+DOUBLEFAULT_STACKSIZE) 16#define STACK_START (unsigned long)(doublefault_stack+DOUBLEFAULT_STACKSIZE)
@@ -67,3 +69,16 @@ struct tss_struct doublefault_tss __cacheline_aligned = {
67 .__cr3 = __pa_nodebug(swapper_pg_dir), 69 .__cr3 = __pa_nodebug(swapper_pg_dir),
68 } 70 }
69}; 71};
72
73/* dummy for do_double_fault() call */
74void df_debug(struct pt_regs *regs, long error_code) {}
75
76#else /* !CONFIG_X86_32 */
77
78void df_debug(struct pt_regs *regs, long error_code)
79{
80 pr_emerg("PANIC: double fault, error_code: 0x%lx\n", error_code);
81 show_regs(regs);
82 panic("Machine halted.");
83}
84#endif
diff --git a/arch/x86/kernel/traps.c b/arch/x86/kernel/traps.c
index 772e2a846dec..167d481c5fd3 100644
--- a/arch/x86/kernel/traps.c
+++ b/arch/x86/kernel/traps.c
@@ -254,6 +254,9 @@ dotraplinkage void do_double_fault(struct pt_regs *regs, long error_code)
254 tsk->thread.error_code = error_code; 254 tsk->thread.error_code = error_code;
255 tsk->thread.trap_nr = X86_TRAP_DF; 255 tsk->thread.trap_nr = X86_TRAP_DF;
256 256
257#ifdef CONFIG_DOUBLEFAULT
258 df_debug(regs, error_code);
259#endif
257 /* 260 /*
258 * This is always a kernel trap and never fixable (and thus must 261 * This is always a kernel trap and never fixable (and thus must
259 * never return). 262 * never return).