Commit 4c64616bb51b399886ded8f4f69bad4da2da1817
Exists in
smarc-l5.0.0_1.0.0-ga
and in
5 other branches
Merge branch 'x86-debug-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip
Pull x86/debug changes from Ingo Molnar. * 'x86-debug-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: x86: Fix section warnings x86-64: Fix CFI data for common_interrupt() x86: Properly _init-annotate NMI selftest code x86/debug: Fix/improve the show_msr=<cpus> debug print out
Showing 7 changed files Side-by-side Diff
arch/x86/include/asm/processor.h
... | ... | @@ -162,6 +162,7 @@ |
162 | 162 | extern void identify_boot_cpu(void); |
163 | 163 | extern void identify_secondary_cpu(struct cpuinfo_x86 *); |
164 | 164 | extern void print_cpu_info(struct cpuinfo_x86 *); |
165 | +void print_cpu_msr(struct cpuinfo_x86 *); | |
165 | 166 | extern void init_scattered_cpuid_features(struct cpuinfo_x86 *c); |
166 | 167 | extern unsigned int init_intel_cacheinfo(struct cpuinfo_x86 *c); |
167 | 168 | extern unsigned short num_cache_leaves; |
arch/x86/kernel/acpi/boot.c
... | ... | @@ -593,7 +593,7 @@ |
593 | 593 | #ifdef CONFIG_ACPI_HOTPLUG_CPU |
594 | 594 | #include <acpi/processor.h> |
595 | 595 | |
596 | -static void acpi_map_cpu2node(acpi_handle handle, int cpu, int physid) | |
596 | +static void __cpuinitdata acpi_map_cpu2node(acpi_handle handle, int cpu, int physid) | |
597 | 597 | { |
598 | 598 | #ifdef CONFIG_ACPI_NUMA |
599 | 599 | int nid; |
arch/x86/kernel/cpu/common.c
... | ... | @@ -933,7 +933,7 @@ |
933 | 933 | { 0xc0011000, 0xc001103b}, |
934 | 934 | }; |
935 | 935 | |
936 | -static void __cpuinit print_cpu_msr(void) | |
936 | +static void __cpuinit __print_cpu_msr(void) | |
937 | 937 | { |
938 | 938 | unsigned index_min, index_max; |
939 | 939 | unsigned index; |
940 | 940 | |
... | ... | @@ -997,13 +997,13 @@ |
997 | 997 | else |
998 | 998 | printk(KERN_CONT "\n"); |
999 | 999 | |
1000 | -#ifdef CONFIG_SMP | |
1000 | + __print_cpu_msr(); | |
1001 | +} | |
1002 | + | |
1003 | +void __cpuinit print_cpu_msr(struct cpuinfo_x86 *c) | |
1004 | +{ | |
1001 | 1005 | if (c->cpu_index < show_msr) |
1002 | - print_cpu_msr(); | |
1003 | -#else | |
1004 | - if (show_msr) | |
1005 | - print_cpu_msr(); | |
1006 | -#endif | |
1006 | + __print_cpu_msr(); | |
1007 | 1007 | } |
1008 | 1008 | |
1009 | 1009 | static __init int setup_disablecpuid(char *arg) |
arch/x86/kernel/entry_64.S
... | ... | @@ -812,7 +812,7 @@ |
812 | 812 | |
813 | 813 | /* Restore saved previous stack */ |
814 | 814 | popq %rsi |
815 | - CFI_DEF_CFA_REGISTER rsi | |
815 | + CFI_DEF_CFA rsi,SS+8-RBP /* reg/off reset after def_cfa_expr */ | |
816 | 816 | leaq ARGOFFSET-RBP(%rsi), %rsp |
817 | 817 | CFI_DEF_CFA_REGISTER rsp |
818 | 818 | CFI_ADJUST_CFA_OFFSET RBP-ARGOFFSET |
arch/x86/kernel/nmi_selftest.c
... | ... | @@ -12,6 +12,7 @@ |
12 | 12 | #include <linux/smp.h> |
13 | 13 | #include <linux/cpumask.h> |
14 | 14 | #include <linux/delay.h> |
15 | +#include <linux/init.h> | |
15 | 16 | |
16 | 17 | #include <asm/apic.h> |
17 | 18 | #include <asm/nmi.h> |
18 | 19 | |
19 | 20 | |
20 | 21 | |
21 | 22 | |
22 | 23 | |
23 | 24 | |
... | ... | @@ -20,35 +21,35 @@ |
20 | 21 | #define FAILURE 1 |
21 | 22 | #define TIMEOUT 2 |
22 | 23 | |
23 | -static int nmi_fail; | |
24 | +static int __initdata nmi_fail; | |
24 | 25 | |
25 | 26 | /* check to see if NMI IPIs work on this machine */ |
26 | -static DECLARE_BITMAP(nmi_ipi_mask, NR_CPUS) __read_mostly; | |
27 | +static DECLARE_BITMAP(nmi_ipi_mask, NR_CPUS) __initdata; | |
27 | 28 | |
28 | -static int testcase_total; | |
29 | -static int testcase_successes; | |
30 | -static int expected_testcase_failures; | |
31 | -static int unexpected_testcase_failures; | |
32 | -static int unexpected_testcase_unknowns; | |
29 | +static int __initdata testcase_total; | |
30 | +static int __initdata testcase_successes; | |
31 | +static int __initdata expected_testcase_failures; | |
32 | +static int __initdata unexpected_testcase_failures; | |
33 | +static int __initdata unexpected_testcase_unknowns; | |
33 | 34 | |
34 | -static int nmi_unk_cb(unsigned int val, struct pt_regs *regs) | |
35 | +static int __init nmi_unk_cb(unsigned int val, struct pt_regs *regs) | |
35 | 36 | { |
36 | 37 | unexpected_testcase_unknowns++; |
37 | 38 | return NMI_HANDLED; |
38 | 39 | } |
39 | 40 | |
40 | -static void init_nmi_testsuite(void) | |
41 | +static void __init init_nmi_testsuite(void) | |
41 | 42 | { |
42 | 43 | /* trap all the unknown NMIs we may generate */ |
43 | 44 | register_nmi_handler(NMI_UNKNOWN, nmi_unk_cb, 0, "nmi_selftest_unk"); |
44 | 45 | } |
45 | 46 | |
46 | -static void cleanup_nmi_testsuite(void) | |
47 | +static void __init cleanup_nmi_testsuite(void) | |
47 | 48 | { |
48 | 49 | unregister_nmi_handler(NMI_UNKNOWN, "nmi_selftest_unk"); |
49 | 50 | } |
50 | 51 | |
51 | -static int test_nmi_ipi_callback(unsigned int val, struct pt_regs *regs) | |
52 | +static int __init test_nmi_ipi_callback(unsigned int val, struct pt_regs *regs) | |
52 | 53 | { |
53 | 54 | int cpu = raw_smp_processor_id(); |
54 | 55 | |
... | ... | @@ -58,7 +59,7 @@ |
58 | 59 | return NMI_DONE; |
59 | 60 | } |
60 | 61 | |
61 | -static void test_nmi_ipi(struct cpumask *mask) | |
62 | +static void __init test_nmi_ipi(struct cpumask *mask) | |
62 | 63 | { |
63 | 64 | unsigned long timeout; |
64 | 65 | |
... | ... | @@ -86,7 +87,7 @@ |
86 | 87 | return; |
87 | 88 | } |
88 | 89 | |
89 | -static void remote_ipi(void) | |
90 | +static void __init remote_ipi(void) | |
90 | 91 | { |
91 | 92 | cpumask_copy(to_cpumask(nmi_ipi_mask), cpu_online_mask); |
92 | 93 | cpumask_clear_cpu(smp_processor_id(), to_cpumask(nmi_ipi_mask)); |
93 | 94 | |
94 | 95 | |
... | ... | @@ -94,19 +95,19 @@ |
94 | 95 | test_nmi_ipi(to_cpumask(nmi_ipi_mask)); |
95 | 96 | } |
96 | 97 | |
97 | -static void local_ipi(void) | |
98 | +static void __init local_ipi(void) | |
98 | 99 | { |
99 | 100 | cpumask_clear(to_cpumask(nmi_ipi_mask)); |
100 | 101 | cpumask_set_cpu(smp_processor_id(), to_cpumask(nmi_ipi_mask)); |
101 | 102 | test_nmi_ipi(to_cpumask(nmi_ipi_mask)); |
102 | 103 | } |
103 | 104 | |
104 | -static void reset_nmi(void) | |
105 | +static void __init reset_nmi(void) | |
105 | 106 | { |
106 | 107 | nmi_fail = 0; |
107 | 108 | } |
108 | 109 | |
109 | -static void dotest(void (*testcase_fn)(void), int expected) | |
110 | +static void __init dotest(void (*testcase_fn)(void), int expected) | |
110 | 111 | { |
111 | 112 | testcase_fn(); |
112 | 113 | /* |
113 | 114 | |
... | ... | @@ -131,12 +132,12 @@ |
131 | 132 | reset_nmi(); |
132 | 133 | } |
133 | 134 | |
134 | -static inline void print_testname(const char *testname) | |
135 | +static inline void __init print_testname(const char *testname) | |
135 | 136 | { |
136 | 137 | printk("%12s:", testname); |
137 | 138 | } |
138 | 139 | |
139 | -void nmi_selftest(void) | |
140 | +void __init nmi_selftest(void) | |
140 | 141 | { |
141 | 142 | init_nmi_testsuite(); |
142 | 143 |
arch/x86/kernel/smpboot.c
... | ... | @@ -776,9 +776,10 @@ |
776 | 776 | schedule(); |
777 | 777 | } |
778 | 778 | |
779 | - if (cpumask_test_cpu(cpu, cpu_callin_mask)) | |
779 | + if (cpumask_test_cpu(cpu, cpu_callin_mask)) { | |
780 | + print_cpu_msr(&cpu_data(cpu)); | |
780 | 781 | pr_debug("CPU%d: has booted.\n", cpu); |
781 | - else { | |
782 | + } else { | |
782 | 783 | boot_error = 1; |
783 | 784 | if (*(volatile u32 *)TRAMPOLINE_SYM(trampoline_status) |
784 | 785 | == 0xA5A5A5A5) |
drivers/iommu/amd_iommu.c
... | ... | @@ -2804,7 +2804,7 @@ |
2804 | 2804 | * we don't need to preallocate the protection domains anymore. |
2805 | 2805 | * For now we have to. |
2806 | 2806 | */ |
2807 | -static void prealloc_protection_domains(void) | |
2807 | +static void __init prealloc_protection_domains(void) | |
2808 | 2808 | { |
2809 | 2809 | struct iommu_dev_data *dev_data; |
2810 | 2810 | struct dma_ops_domain *dma_dom; |