diff options
Diffstat (limited to 'arch/x86/kernel')
53 files changed, 337 insertions, 201 deletions
diff --git a/arch/x86/kernel/.gitignore b/arch/x86/kernel/.gitignore index 40836ad9079c..4ea38a39aed4 100644 --- a/arch/x86/kernel/.gitignore +++ b/arch/x86/kernel/.gitignore | |||
@@ -1 +1,2 @@ | |||
1 | vsyscall.lds | 1 | vsyscall.lds |
2 | vsyscall_32.lds | ||
diff --git a/arch/x86/kernel/Makefile b/arch/x86/kernel/Makefile index 45855c97923e..38573340b143 100644 --- a/arch/x86/kernel/Makefile +++ b/arch/x86/kernel/Makefile | |||
@@ -3,3 +3,7 @@ include ${srctree}/arch/x86/kernel/Makefile_32 | |||
3 | else | 3 | else |
4 | include ${srctree}/arch/x86/kernel/Makefile_64 | 4 | include ${srctree}/arch/x86/kernel/Makefile_64 |
5 | endif | 5 | endif |
6 | |||
7 | # Workaround to delete .lds files with make clean | ||
8 | # The problem is that we do not enter Makefile_32 with make clean. | ||
9 | clean-files := vsyscall*.lds vsyscall*.so | ||
diff --git a/arch/x86/kernel/Makefile_32 b/arch/x86/kernel/Makefile_32 index 7ff02063b858..a3fa11f8f460 100644 --- a/arch/x86/kernel/Makefile_32 +++ b/arch/x86/kernel/Makefile_32 | |||
@@ -51,7 +51,7 @@ obj-$(CONFIG_SCx200) += scx200_32.o | |||
51 | # We must build both images before we can assemble it. | 51 | # We must build both images before we can assemble it. |
52 | # Note: kbuild does not track this dependency due to usage of .incbin | 52 | # Note: kbuild does not track this dependency due to usage of .incbin |
53 | $(obj)/vsyscall_32.o: $(obj)/vsyscall-int80_32.so $(obj)/vsyscall-sysenter_32.so | 53 | $(obj)/vsyscall_32.o: $(obj)/vsyscall-int80_32.so $(obj)/vsyscall-sysenter_32.so |
54 | targets += $(foreach F,int80 sysenter,vsyscall-$F.o vsyscall-$F.so) | 54 | targets += $(foreach F,int80 sysenter,vsyscall-$F_32.o vsyscall-$F_32.so) |
55 | targets += vsyscall-note_32.o vsyscall_32.lds | 55 | targets += vsyscall-note_32.o vsyscall_32.lds |
56 | 56 | ||
57 | # The DSO images are built using a special linker script. | 57 | # The DSO images are built using a special linker script. |
diff --git a/arch/x86/kernel/alternative.c b/arch/x86/kernel/alternative.c index 42421437ded3..3bd2688bd443 100644 --- a/arch/x86/kernel/alternative.c +++ b/arch/x86/kernel/alternative.c | |||
@@ -63,11 +63,11 @@ __setup("noreplace-paravirt", setup_noreplace_paravirt); | |||
63 | /* Use inline assembly to define this because the nops are defined | 63 | /* Use inline assembly to define this because the nops are defined |
64 | as inline assembly strings in the include files and we cannot | 64 | as inline assembly strings in the include files and we cannot |
65 | get them easily into strings. */ | 65 | get them easily into strings. */ |
66 | asm("\t.data\nintelnops: " | 66 | asm("\t.section .rodata, \"a\"\nintelnops: " |
67 | GENERIC_NOP1 GENERIC_NOP2 GENERIC_NOP3 GENERIC_NOP4 GENERIC_NOP5 GENERIC_NOP6 | 67 | GENERIC_NOP1 GENERIC_NOP2 GENERIC_NOP3 GENERIC_NOP4 GENERIC_NOP5 GENERIC_NOP6 |
68 | GENERIC_NOP7 GENERIC_NOP8); | 68 | GENERIC_NOP7 GENERIC_NOP8); |
69 | extern unsigned char intelnops[]; | 69 | extern const unsigned char intelnops[]; |
70 | static unsigned char *intel_nops[ASM_NOP_MAX+1] = { | 70 | static const unsigned char *const intel_nops[ASM_NOP_MAX+1] = { |
71 | NULL, | 71 | NULL, |
72 | intelnops, | 72 | intelnops, |
73 | intelnops + 1, | 73 | intelnops + 1, |
@@ -81,11 +81,11 @@ static unsigned char *intel_nops[ASM_NOP_MAX+1] = { | |||
81 | #endif | 81 | #endif |
82 | 82 | ||
83 | #ifdef K8_NOP1 | 83 | #ifdef K8_NOP1 |
84 | asm("\t.data\nk8nops: " | 84 | asm("\t.section .rodata, \"a\"\nk8nops: " |
85 | K8_NOP1 K8_NOP2 K8_NOP3 K8_NOP4 K8_NOP5 K8_NOP6 | 85 | K8_NOP1 K8_NOP2 K8_NOP3 K8_NOP4 K8_NOP5 K8_NOP6 |
86 | K8_NOP7 K8_NOP8); | 86 | K8_NOP7 K8_NOP8); |
87 | extern unsigned char k8nops[]; | 87 | extern const unsigned char k8nops[]; |
88 | static unsigned char *k8_nops[ASM_NOP_MAX+1] = { | 88 | static const unsigned char *const k8_nops[ASM_NOP_MAX+1] = { |
89 | NULL, | 89 | NULL, |
90 | k8nops, | 90 | k8nops, |
91 | k8nops + 1, | 91 | k8nops + 1, |
@@ -99,11 +99,11 @@ static unsigned char *k8_nops[ASM_NOP_MAX+1] = { | |||
99 | #endif | 99 | #endif |
100 | 100 | ||
101 | #ifdef K7_NOP1 | 101 | #ifdef K7_NOP1 |
102 | asm("\t.data\nk7nops: " | 102 | asm("\t.section .rodata, \"a\"\nk7nops: " |
103 | K7_NOP1 K7_NOP2 K7_NOP3 K7_NOP4 K7_NOP5 K7_NOP6 | 103 | K7_NOP1 K7_NOP2 K7_NOP3 K7_NOP4 K7_NOP5 K7_NOP6 |
104 | K7_NOP7 K7_NOP8); | 104 | K7_NOP7 K7_NOP8); |
105 | extern unsigned char k7nops[]; | 105 | extern const unsigned char k7nops[]; |
106 | static unsigned char *k7_nops[ASM_NOP_MAX+1] = { | 106 | static const unsigned char *const k7_nops[ASM_NOP_MAX+1] = { |
107 | NULL, | 107 | NULL, |
108 | k7nops, | 108 | k7nops, |
109 | k7nops + 1, | 109 | k7nops + 1, |
@@ -116,28 +116,49 @@ static unsigned char *k7_nops[ASM_NOP_MAX+1] = { | |||
116 | }; | 116 | }; |
117 | #endif | 117 | #endif |
118 | 118 | ||
119 | #ifdef P6_NOP1 | ||
120 | asm("\t.section .rodata, \"a\"\np6nops: " | ||
121 | P6_NOP1 P6_NOP2 P6_NOP3 P6_NOP4 P6_NOP5 P6_NOP6 | ||
122 | P6_NOP7 P6_NOP8); | ||
123 | extern const unsigned char p6nops[]; | ||
124 | static const unsigned char *const p6_nops[ASM_NOP_MAX+1] = { | ||
125 | NULL, | ||
126 | p6nops, | ||
127 | p6nops + 1, | ||
128 | p6nops + 1 + 2, | ||
129 | p6nops + 1 + 2 + 3, | ||
130 | p6nops + 1 + 2 + 3 + 4, | ||
131 | p6nops + 1 + 2 + 3 + 4 + 5, | ||
132 | p6nops + 1 + 2 + 3 + 4 + 5 + 6, | ||
133 | p6nops + 1 + 2 + 3 + 4 + 5 + 6 + 7, | ||
134 | }; | ||
135 | #endif | ||
136 | |||
119 | #ifdef CONFIG_X86_64 | 137 | #ifdef CONFIG_X86_64 |
120 | 138 | ||
121 | extern char __vsyscall_0; | 139 | extern char __vsyscall_0; |
122 | static inline unsigned char** find_nop_table(void) | 140 | static inline const unsigned char*const * find_nop_table(void) |
123 | { | 141 | { |
124 | return k8_nops; | 142 | return boot_cpu_data.x86_vendor != X86_VENDOR_INTEL || |
143 | boot_cpu_data.x86 < 6 ? k8_nops : p6_nops; | ||
125 | } | 144 | } |
126 | 145 | ||
127 | #else /* CONFIG_X86_64 */ | 146 | #else /* CONFIG_X86_64 */ |
128 | 147 | ||
129 | static struct nop { | 148 | static const struct nop { |
130 | int cpuid; | 149 | int cpuid; |
131 | unsigned char **noptable; | 150 | const unsigned char *const *noptable; |
132 | } noptypes[] = { | 151 | } noptypes[] = { |
133 | { X86_FEATURE_K8, k8_nops }, | 152 | { X86_FEATURE_K8, k8_nops }, |
134 | { X86_FEATURE_K7, k7_nops }, | 153 | { X86_FEATURE_K7, k7_nops }, |
154 | { X86_FEATURE_P4, p6_nops }, | ||
155 | { X86_FEATURE_P3, p6_nops }, | ||
135 | { -1, NULL } | 156 | { -1, NULL } |
136 | }; | 157 | }; |
137 | 158 | ||
138 | static unsigned char** find_nop_table(void) | 159 | static const unsigned char*const * find_nop_table(void) |
139 | { | 160 | { |
140 | unsigned char **noptable = intel_nops; | 161 | const unsigned char *const *noptable = intel_nops; |
141 | int i; | 162 | int i; |
142 | 163 | ||
143 | for (i = 0; noptypes[i].cpuid >= 0; i++) { | 164 | for (i = 0; noptypes[i].cpuid >= 0; i++) { |
@@ -154,7 +175,7 @@ static unsigned char** find_nop_table(void) | |||
154 | /* Use this to add nops to a buffer, then text_poke the whole buffer. */ | 175 | /* Use this to add nops to a buffer, then text_poke the whole buffer. */ |
155 | static void add_nops(void *insns, unsigned int len) | 176 | static void add_nops(void *insns, unsigned int len) |
156 | { | 177 | { |
157 | unsigned char **noptable = find_nop_table(); | 178 | const unsigned char *const *noptable = find_nop_table(); |
158 | 179 | ||
159 | while (len > 0) { | 180 | while (len > 0) { |
160 | unsigned int noplen = len; | 181 | unsigned int noplen = len; |
@@ -415,9 +436,6 @@ void __init alternative_instructions(void) | |||
415 | alternatives_smp_unlock(__smp_locks, __smp_locks_end, | 436 | alternatives_smp_unlock(__smp_locks, __smp_locks_end, |
416 | _text, _etext); | 437 | _text, _etext); |
417 | } | 438 | } |
418 | free_init_pages("SMP alternatives", | ||
419 | (unsigned long)__smp_locks, | ||
420 | (unsigned long)__smp_locks_end); | ||
421 | } else { | 439 | } else { |
422 | alternatives_smp_module_add(NULL, "core kernel", | 440 | alternatives_smp_module_add(NULL, "core kernel", |
423 | __smp_locks, __smp_locks_end, | 441 | __smp_locks, __smp_locks_end, |
@@ -428,6 +446,11 @@ void __init alternative_instructions(void) | |||
428 | apply_paravirt(__parainstructions, __parainstructions_end); | 446 | apply_paravirt(__parainstructions, __parainstructions_end); |
429 | local_irq_restore(flags); | 447 | local_irq_restore(flags); |
430 | 448 | ||
449 | if (smp_alt_once) | ||
450 | free_init_pages("SMP alternatives", | ||
451 | (unsigned long)__smp_locks, | ||
452 | (unsigned long)__smp_locks_end); | ||
453 | |||
431 | restart_nmi(); | 454 | restart_nmi(); |
432 | #ifdef CONFIG_X86_MCE | 455 | #ifdef CONFIG_X86_MCE |
433 | restart_mce(); | 456 | restart_mce(); |
diff --git a/arch/x86/kernel/apic_32.c b/arch/x86/kernel/apic_32.c index 3d67ae18d762..793341fffc81 100644 --- a/arch/x86/kernel/apic_32.c +++ b/arch/x86/kernel/apic_32.c | |||
@@ -1277,6 +1277,7 @@ void smp_spurious_interrupt(struct pt_regs *regs) | |||
1277 | /* see sw-dev-man vol 3, chapter 7.4.13.5 */ | 1277 | /* see sw-dev-man vol 3, chapter 7.4.13.5 */ |
1278 | printk(KERN_INFO "spurious APIC interrupt on CPU#%d, " | 1278 | printk(KERN_INFO "spurious APIC interrupt on CPU#%d, " |
1279 | "should never happen.\n", smp_processor_id()); | 1279 | "should never happen.\n", smp_processor_id()); |
1280 | __get_cpu_var(irq_stat).irq_spurious_count++; | ||
1280 | irq_exit(); | 1281 | irq_exit(); |
1281 | } | 1282 | } |
1282 | 1283 | ||
diff --git a/arch/x86/kernel/apic_64.c b/arch/x86/kernel/apic_64.c index 09b82093bc75..f47bc493dba9 100644 --- a/arch/x86/kernel/apic_64.c +++ b/arch/x86/kernel/apic_64.c | |||
@@ -974,15 +974,12 @@ void __init setup_boot_APIC_clock (void) | |||
974 | */ | 974 | */ |
975 | void __cpuinit check_boot_apic_timer_broadcast(void) | 975 | void __cpuinit check_boot_apic_timer_broadcast(void) |
976 | { | 976 | { |
977 | struct clock_event_device *levt = &per_cpu(lapic_events, boot_cpu_id); | ||
978 | |||
979 | if (!disable_apic_timer || | 977 | if (!disable_apic_timer || |
980 | (lapic_clockevent.features & CLOCK_EVT_FEAT_DUMMY)) | 978 | (lapic_clockevent.features & CLOCK_EVT_FEAT_DUMMY)) |
981 | return; | 979 | return; |
982 | 980 | ||
983 | printk(KERN_INFO "AMD C1E detected late. Force timer broadcast.\n"); | 981 | printk(KERN_INFO "AMD C1E detected late. Force timer broadcast.\n"); |
984 | lapic_clockevent.features |= CLOCK_EVT_FEAT_DUMMY; | 982 | lapic_clockevent.features |= CLOCK_EVT_FEAT_DUMMY; |
985 | levt->features |= CLOCK_EVT_FEAT_DUMMY; | ||
986 | 983 | ||
987 | local_irq_enable(); | 984 | local_irq_enable(); |
988 | clockevents_notify(CLOCK_EVT_NOTIFY_BROADCAST_FORCE, &boot_cpu_id); | 985 | clockevents_notify(CLOCK_EVT_NOTIFY_BROADCAST_FORCE, &boot_cpu_id); |
@@ -1143,6 +1140,7 @@ asmlinkage void smp_spurious_interrupt(void) | |||
1143 | if (v & (1 << (SPURIOUS_APIC_VECTOR & 0x1f))) | 1140 | if (v & (1 << (SPURIOUS_APIC_VECTOR & 0x1f))) |
1144 | ack_APIC_irq(); | 1141 | ack_APIC_irq(); |
1145 | 1142 | ||
1143 | add_pda(irq_spurious_count, 1); | ||
1146 | irq_exit(); | 1144 | irq_exit(); |
1147 | } | 1145 | } |
1148 | 1146 | ||
diff --git a/arch/x86/kernel/cpu/amd.c b/arch/x86/kernel/cpu/amd.c index dcf6bbb1c7c0..5f8af875f457 100644 --- a/arch/x86/kernel/cpu/amd.c +++ b/arch/x86/kernel/cpu/amd.c | |||
@@ -4,6 +4,7 @@ | |||
4 | #include <asm/io.h> | 4 | #include <asm/io.h> |
5 | #include <asm/processor.h> | 5 | #include <asm/processor.h> |
6 | #include <asm/apic.h> | 6 | #include <asm/apic.h> |
7 | #include <asm/mach_apic.h> | ||
7 | 8 | ||
8 | #include "cpu.h" | 9 | #include "cpu.h" |
9 | 10 | ||
@@ -45,13 +46,17 @@ static __cpuinit int amd_apic_timer_broken(void) | |||
45 | case CPUID_XFAM_10H: | 46 | case CPUID_XFAM_10H: |
46 | case CPUID_XFAM_11H: | 47 | case CPUID_XFAM_11H: |
47 | rdmsr(MSR_K8_ENABLE_C1E, lo, hi); | 48 | rdmsr(MSR_K8_ENABLE_C1E, lo, hi); |
48 | if (lo & ENABLE_C1E_MASK) | 49 | if (lo & ENABLE_C1E_MASK) { |
50 | if (smp_processor_id() != boot_cpu_physical_apicid) | ||
51 | printk(KERN_INFO "AMD C1E detected late. " | ||
52 | " Force timer broadcast.\n"); | ||
49 | return 1; | 53 | return 1; |
50 | break; | 54 | } |
51 | default: | 55 | break; |
52 | /* err on the side of caution */ | 56 | default: |
57 | /* err on the side of caution */ | ||
53 | return 1; | 58 | return 1; |
54 | } | 59 | } |
55 | return 0; | 60 | return 0; |
56 | } | 61 | } |
57 | #endif | 62 | #endif |
diff --git a/arch/x86/kernel/cpu/cpufreq/powernow-k7.c b/arch/x86/kernel/cpu/cpufreq/powernow-k7.c index 7decd6a50ffa..f3686a5f2308 100644 --- a/arch/x86/kernel/cpu/cpufreq/powernow-k7.c +++ b/arch/x86/kernel/cpu/cpufreq/powernow-k7.c | |||
@@ -565,7 +565,7 @@ static unsigned int powernow_get(unsigned int cpu) | |||
565 | } | 565 | } |
566 | 566 | ||
567 | 567 | ||
568 | static int __init acer_cpufreq_pst(struct dmi_system_id *d) | 568 | static int __init acer_cpufreq_pst(const struct dmi_system_id *d) |
569 | { | 569 | { |
570 | printk(KERN_WARNING "%s laptop with broken PST tables in BIOS detected.\n", d->ident); | 570 | printk(KERN_WARNING "%s laptop with broken PST tables in BIOS detected.\n", d->ident); |
571 | printk(KERN_WARNING "You need to downgrade to 3A21 (09/09/2002), or try a newer BIOS than 3A71 (01/20/2003)\n"); | 571 | printk(KERN_WARNING "You need to downgrade to 3A21 (09/09/2002), or try a newer BIOS than 3A71 (01/20/2003)\n"); |
diff --git a/arch/x86/kernel/cpu/intel.c b/arch/x86/kernel/cpu/intel.c index dc4e08147b1f..cc8c501b9f39 100644 --- a/arch/x86/kernel/cpu/intel.c +++ b/arch/x86/kernel/cpu/intel.c | |||
@@ -8,6 +8,7 @@ | |||
8 | #include <linux/module.h> | 8 | #include <linux/module.h> |
9 | 9 | ||
10 | #include <asm/processor.h> | 10 | #include <asm/processor.h> |
11 | #include <asm/pgtable.h> | ||
11 | #include <asm/msr.h> | 12 | #include <asm/msr.h> |
12 | #include <asm/uaccess.h> | 13 | #include <asm/uaccess.h> |
13 | 14 | ||
@@ -19,8 +20,6 @@ | |||
19 | #include <mach_apic.h> | 20 | #include <mach_apic.h> |
20 | #endif | 21 | #endif |
21 | 22 | ||
22 | extern int trap_init_f00f_bug(void); | ||
23 | |||
24 | #ifdef CONFIG_X86_INTEL_USERCOPY | 23 | #ifdef CONFIG_X86_INTEL_USERCOPY |
25 | /* | 24 | /* |
26 | * Alignment at which movsl is preferred for bulk memory copies. | 25 | * Alignment at which movsl is preferred for bulk memory copies. |
@@ -95,6 +94,20 @@ static int __cpuinit num_cpu_cores(struct cpuinfo_x86 *c) | |||
95 | return 1; | 94 | return 1; |
96 | } | 95 | } |
97 | 96 | ||
97 | #ifdef CONFIG_X86_F00F_BUG | ||
98 | static void __cpuinit trap_init_f00f_bug(void) | ||
99 | { | ||
100 | __set_fixmap(FIX_F00F_IDT, __pa(&idt_table), PAGE_KERNEL_RO); | ||
101 | |||
102 | /* | ||
103 | * Update the IDT descriptor and reload the IDT so that | ||
104 | * it uses the read-only mapped virtual address. | ||
105 | */ | ||
106 | idt_descr.address = fix_to_virt(FIX_F00F_IDT); | ||
107 | load_idt(&idt_descr); | ||
108 | } | ||
109 | #endif | ||
110 | |||
98 | static void __cpuinit init_intel(struct cpuinfo_x86 *c) | 111 | static void __cpuinit init_intel(struct cpuinfo_x86 *c) |
99 | { | 112 | { |
100 | unsigned int l2 = 0; | 113 | unsigned int l2 = 0; |
diff --git a/arch/x86/kernel/cpu/intel_cacheinfo.c b/arch/x86/kernel/cpu/intel_cacheinfo.c index db6c25aa5776..1826395ebeeb 100644 --- a/arch/x86/kernel/cpu/intel_cacheinfo.c +++ b/arch/x86/kernel/cpu/intel_cacheinfo.c | |||
@@ -170,15 +170,15 @@ union l3_cache { | |||
170 | unsigned val; | 170 | unsigned val; |
171 | }; | 171 | }; |
172 | 172 | ||
173 | static const unsigned short assocs[] = { | 173 | static unsigned short assocs[] __cpuinitdata = { |
174 | [1] = 1, [2] = 2, [4] = 4, [6] = 8, | 174 | [1] = 1, [2] = 2, [4] = 4, [6] = 8, |
175 | [8] = 16, [0xa] = 32, [0xb] = 48, | 175 | [8] = 16, [0xa] = 32, [0xb] = 48, |
176 | [0xc] = 64, | 176 | [0xc] = 64, |
177 | [0xf] = 0xffff // ?? | 177 | [0xf] = 0xffff // ?? |
178 | }; | 178 | }; |
179 | 179 | ||
180 | static const unsigned char levels[] = { 1, 1, 2, 3 }; | 180 | static unsigned char levels[] __cpuinitdata = { 1, 1, 2, 3 }; |
181 | static const unsigned char types[] = { 1, 2, 3, 3 }; | 181 | static unsigned char types[] __cpuinitdata = { 1, 2, 3, 3 }; |
182 | 182 | ||
183 | static void __cpuinit amd_cpuid4(int leaf, union _cpuid4_leaf_eax *eax, | 183 | static void __cpuinit amd_cpuid4(int leaf, union _cpuid4_leaf_eax *eax, |
184 | union _cpuid4_leaf_ebx *ebx, | 184 | union _cpuid4_leaf_ebx *ebx, |
@@ -493,8 +493,8 @@ static void __cpuinit cache_remove_shared_cpu_map(unsigned int cpu, int index) | |||
493 | } | 493 | } |
494 | } | 494 | } |
495 | #else | 495 | #else |
496 | static void __init cache_shared_cpu_map_setup(unsigned int cpu, int index) {} | 496 | static void __cpuinit cache_shared_cpu_map_setup(unsigned int cpu, int index) {} |
497 | static void __init cache_remove_shared_cpu_map(unsigned int cpu, int index) {} | 497 | static void __cpuinit cache_remove_shared_cpu_map(unsigned int cpu, int index) {} |
498 | #endif | 498 | #endif |
499 | 499 | ||
500 | static void free_cache_attributes(unsigned int cpu) | 500 | static void free_cache_attributes(unsigned int cpu) |
@@ -794,8 +794,9 @@ static int __cpuinit cache_sysfs_init(void) | |||
794 | register_hotcpu_notifier(&cacheinfo_cpu_notifier); | 794 | register_hotcpu_notifier(&cacheinfo_cpu_notifier); |
795 | 795 | ||
796 | for_each_online_cpu(i) { | 796 | for_each_online_cpu(i) { |
797 | cacheinfo_cpu_callback(&cacheinfo_cpu_notifier, CPU_ONLINE, | 797 | struct sys_device *sys_dev = get_cpu_sysdev((unsigned int)i); |
798 | (void *)(long)i); | 798 | |
799 | cache_add_dev(sys_dev); | ||
799 | } | 800 | } |
800 | 801 | ||
801 | return 0; | 802 | return 0; |
diff --git a/arch/x86/kernel/cpu/mcheck/p4.c b/arch/x86/kernel/cpu/mcheck/p4.c index 1509edfb2313..be4dabfee1f5 100644 --- a/arch/x86/kernel/cpu/mcheck/p4.c +++ b/arch/x86/kernel/cpu/mcheck/p4.c | |||
@@ -61,6 +61,7 @@ fastcall void smp_thermal_interrupt(struct pt_regs *regs) | |||
61 | { | 61 | { |
62 | irq_enter(); | 62 | irq_enter(); |
63 | vendor_thermal_interrupt(regs); | 63 | vendor_thermal_interrupt(regs); |
64 | __get_cpu_var(irq_stat).irq_thermal_count++; | ||
64 | irq_exit(); | 65 | irq_exit(); |
65 | } | 66 | } |
66 | 67 | ||
diff --git a/arch/x86/kernel/cpu/mcheck/therm_throt.c b/arch/x86/kernel/cpu/mcheck/therm_throt.c index 1203dc5ab87a..494d320d909b 100644 --- a/arch/x86/kernel/cpu/mcheck/therm_throt.c +++ b/arch/x86/kernel/cpu/mcheck/therm_throt.c | |||
@@ -152,7 +152,7 @@ static __cpuinit int thermal_throttle_cpu_callback(struct notifier_block *nfb, | |||
152 | return NOTIFY_OK; | 152 | return NOTIFY_OK; |
153 | } | 153 | } |
154 | 154 | ||
155 | static struct notifier_block thermal_throttle_cpu_notifier = | 155 | static struct notifier_block thermal_throttle_cpu_notifier __cpuinitdata = |
156 | { | 156 | { |
157 | .notifier_call = thermal_throttle_cpu_callback, | 157 | .notifier_call = thermal_throttle_cpu_callback, |
158 | }; | 158 | }; |
diff --git a/arch/x86/kernel/cpu/mtrr/main.c b/arch/x86/kernel/cpu/mtrr/main.c index c48b6fea5ab4..5e4be30ff903 100644 --- a/arch/x86/kernel/cpu/mtrr/main.c +++ b/arch/x86/kernel/cpu/mtrr/main.c | |||
@@ -738,13 +738,7 @@ void mtrr_ap_init(void) | |||
738 | */ | 738 | */ |
739 | void mtrr_save_state(void) | 739 | void mtrr_save_state(void) |
740 | { | 740 | { |
741 | int cpu = get_cpu(); | 741 | smp_call_function_single(0, mtrr_save_fixed_ranges, NULL, 1, 1); |
742 | |||
743 | if (cpu == 0) | ||
744 | mtrr_save_fixed_ranges(NULL); | ||
745 | else | ||
746 | smp_call_function_single(0, mtrr_save_fixed_ranges, NULL, 1, 1); | ||
747 | put_cpu(); | ||
748 | } | 742 | } |
749 | 743 | ||
750 | static int __init mtrr_init_finialize(void) | 744 | static int __init mtrr_init_finialize(void) |
diff --git a/arch/x86/kernel/cpu/perfctr-watchdog.c b/arch/x86/kernel/cpu/perfctr-watchdog.c index 93fecd4b03de..54cdbf1a40f1 100644 --- a/arch/x86/kernel/cpu/perfctr-watchdog.c +++ b/arch/x86/kernel/cpu/perfctr-watchdog.c | |||
@@ -34,7 +34,7 @@ struct wd_ops { | |||
34 | u64 checkbit; | 34 | u64 checkbit; |
35 | }; | 35 | }; |
36 | 36 | ||
37 | static struct wd_ops *wd_ops; | 37 | static const struct wd_ops *wd_ops; |
38 | 38 | ||
39 | /* this number is calculated from Intel's MSR_P4_CRU_ESCR5 register and it's | 39 | /* this number is calculated from Intel's MSR_P4_CRU_ESCR5 register and it's |
40 | * offset from MSR_P4_BSU_ESCR0. It will be the max for all platforms (for now) | 40 | * offset from MSR_P4_BSU_ESCR0. It will be the max for all platforms (for now) |
@@ -317,7 +317,7 @@ static void single_msr_rearm(struct nmi_watchdog_ctlblk *wd, unsigned nmi_hz) | |||
317 | write_watchdog_counter(wd->perfctr_msr, NULL, nmi_hz); | 317 | write_watchdog_counter(wd->perfctr_msr, NULL, nmi_hz); |
318 | } | 318 | } |
319 | 319 | ||
320 | static struct wd_ops k7_wd_ops = { | 320 | static const struct wd_ops k7_wd_ops = { |
321 | .reserve = single_msr_reserve, | 321 | .reserve = single_msr_reserve, |
322 | .unreserve = single_msr_unreserve, | 322 | .unreserve = single_msr_unreserve, |
323 | .setup = setup_k7_watchdog, | 323 | .setup = setup_k7_watchdog, |
@@ -380,7 +380,7 @@ static void p6_rearm(struct nmi_watchdog_ctlblk *wd, unsigned nmi_hz) | |||
380 | write_watchdog_counter32(wd->perfctr_msr, NULL,nmi_hz); | 380 | write_watchdog_counter32(wd->perfctr_msr, NULL,nmi_hz); |
381 | } | 381 | } |
382 | 382 | ||
383 | static struct wd_ops p6_wd_ops = { | 383 | static const struct wd_ops p6_wd_ops = { |
384 | .reserve = single_msr_reserve, | 384 | .reserve = single_msr_reserve, |
385 | .unreserve = single_msr_unreserve, | 385 | .unreserve = single_msr_unreserve, |
386 | .setup = setup_p6_watchdog, | 386 | .setup = setup_p6_watchdog, |
@@ -532,7 +532,7 @@ static void p4_rearm(struct nmi_watchdog_ctlblk *wd, unsigned nmi_hz) | |||
532 | write_watchdog_counter(wd->perfctr_msr, NULL, nmi_hz); | 532 | write_watchdog_counter(wd->perfctr_msr, NULL, nmi_hz); |
533 | } | 533 | } |
534 | 534 | ||
535 | static struct wd_ops p4_wd_ops = { | 535 | static const struct wd_ops p4_wd_ops = { |
536 | .reserve = p4_reserve, | 536 | .reserve = p4_reserve, |
537 | .unreserve = p4_unreserve, | 537 | .unreserve = p4_unreserve, |
538 | .setup = setup_p4_watchdog, | 538 | .setup = setup_p4_watchdog, |
@@ -550,6 +550,8 @@ static struct wd_ops p4_wd_ops = { | |||
550 | #define ARCH_PERFMON_NMI_EVENT_SEL ARCH_PERFMON_UNHALTED_CORE_CYCLES_SEL | 550 | #define ARCH_PERFMON_NMI_EVENT_SEL ARCH_PERFMON_UNHALTED_CORE_CYCLES_SEL |
551 | #define ARCH_PERFMON_NMI_EVENT_UMASK ARCH_PERFMON_UNHALTED_CORE_CYCLES_UMASK | 551 | #define ARCH_PERFMON_NMI_EVENT_UMASK ARCH_PERFMON_UNHALTED_CORE_CYCLES_UMASK |
552 | 552 | ||
553 | static struct wd_ops intel_arch_wd_ops; | ||
554 | |||
553 | static int setup_intel_arch_watchdog(unsigned nmi_hz) | 555 | static int setup_intel_arch_watchdog(unsigned nmi_hz) |
554 | { | 556 | { |
555 | unsigned int ebx; | 557 | unsigned int ebx; |
@@ -591,11 +593,11 @@ static int setup_intel_arch_watchdog(unsigned nmi_hz) | |||
591 | wd->perfctr_msr = perfctr_msr; | 593 | wd->perfctr_msr = perfctr_msr; |
592 | wd->evntsel_msr = evntsel_msr; | 594 | wd->evntsel_msr = evntsel_msr; |
593 | wd->cccr_msr = 0; //unused | 595 | wd->cccr_msr = 0; //unused |
594 | wd_ops->checkbit = 1ULL << (eax.split.bit_width - 1); | 596 | intel_arch_wd_ops.checkbit = 1ULL << (eax.split.bit_width - 1); |
595 | return 1; | 597 | return 1; |
596 | } | 598 | } |
597 | 599 | ||
598 | static struct wd_ops intel_arch_wd_ops = { | 600 | static struct wd_ops intel_arch_wd_ops __read_mostly = { |
599 | .reserve = single_msr_reserve, | 601 | .reserve = single_msr_reserve, |
600 | .unreserve = single_msr_unreserve, | 602 | .unreserve = single_msr_unreserve, |
601 | .setup = setup_intel_arch_watchdog, | 603 | .setup = setup_intel_arch_watchdog, |
diff --git a/arch/x86/kernel/cpuid.c b/arch/x86/kernel/cpuid.c index f4548c93ccf5..70dcf912d9fb 100644 --- a/arch/x86/kernel/cpuid.c +++ b/arch/x86/kernel/cpuid.c | |||
@@ -43,8 +43,6 @@ | |||
43 | 43 | ||
44 | static struct class *cpuid_class; | 44 | static struct class *cpuid_class; |
45 | 45 | ||
46 | #ifdef CONFIG_SMP | ||
47 | |||
48 | struct cpuid_command { | 46 | struct cpuid_command { |
49 | u32 reg; | 47 | u32 reg; |
50 | u32 *data; | 48 | u32 *data; |
@@ -62,25 +60,11 @@ static inline void do_cpuid(int cpu, u32 reg, u32 * data) | |||
62 | { | 60 | { |
63 | struct cpuid_command cmd; | 61 | struct cpuid_command cmd; |
64 | 62 | ||
65 | preempt_disable(); | 63 | cmd.reg = reg; |
66 | if (cpu == smp_processor_id()) { | 64 | cmd.data = data; |
67 | cpuid(reg, &data[0], &data[1], &data[2], &data[3]); | ||
68 | } else { | ||
69 | cmd.reg = reg; | ||
70 | cmd.data = data; | ||
71 | 65 | ||
72 | smp_call_function_single(cpu, cpuid_smp_cpuid, &cmd, 1, 1); | 66 | smp_call_function_single(cpu, cpuid_smp_cpuid, &cmd, 1, 1); |
73 | } | ||
74 | preempt_enable(); | ||
75 | } | 67 | } |
76 | #else /* ! CONFIG_SMP */ | ||
77 | |||
78 | static inline void do_cpuid(int cpu, u32 reg, u32 * data) | ||
79 | { | ||
80 | cpuid(reg, &data[0], &data[1], &data[2], &data[3]); | ||
81 | } | ||
82 | |||
83 | #endif /* ! CONFIG_SMP */ | ||
84 | 68 | ||
85 | static loff_t cpuid_seek(struct file *file, loff_t offset, int orig) | 69 | static loff_t cpuid_seek(struct file *file, loff_t offset, int orig) |
86 | { | 70 | { |
@@ -150,7 +134,7 @@ static const struct file_operations cpuid_fops = { | |||
150 | .open = cpuid_open, | 134 | .open = cpuid_open, |
151 | }; | 135 | }; |
152 | 136 | ||
153 | static int cpuid_device_create(int i) | 137 | static int __cpuinit cpuid_device_create(int i) |
154 | { | 138 | { |
155 | int err = 0; | 139 | int err = 0; |
156 | struct device *dev; | 140 | struct device *dev; |
@@ -161,7 +145,9 @@ static int cpuid_device_create(int i) | |||
161 | return err; | 145 | return err; |
162 | } | 146 | } |
163 | 147 | ||
164 | static int cpuid_class_cpu_callback(struct notifier_block *nfb, unsigned long action, void *hcpu) | 148 | static int __cpuinit cpuid_class_cpu_callback(struct notifier_block *nfb, |
149 | unsigned long action, | ||
150 | void *hcpu) | ||
165 | { | 151 | { |
166 | unsigned int cpu = (unsigned long)hcpu; | 152 | unsigned int cpu = (unsigned long)hcpu; |
167 | 153 | ||
diff --git a/arch/x86/kernel/entry_64.S b/arch/x86/kernel/entry_64.S index f1cacd4897f7..3a058bb16409 100644 --- a/arch/x86/kernel/entry_64.S +++ b/arch/x86/kernel/entry_64.S | |||
@@ -988,7 +988,7 @@ child_rip: | |||
988 | movq %rsi, %rdi | 988 | movq %rsi, %rdi |
989 | call *%rax | 989 | call *%rax |
990 | # exit | 990 | # exit |
991 | xorl %edi, %edi | 991 | mov %eax, %edi |
992 | call do_exit | 992 | call do_exit |
993 | CFI_ENDPROC | 993 | CFI_ENDPROC |
994 | ENDPROC(child_rip) | 994 | ENDPROC(child_rip) |
diff --git a/arch/x86/kernel/genapic_64.c b/arch/x86/kernel/genapic_64.c index 47496a40e84f..4ae03e3e8294 100644 --- a/arch/x86/kernel/genapic_64.c +++ b/arch/x86/kernel/genapic_64.c | |||
@@ -29,8 +29,6 @@ u8 x86_cpu_to_apicid[NR_CPUS] __read_mostly | |||
29 | = { [0 ... NR_CPUS-1] = BAD_APICID }; | 29 | = { [0 ... NR_CPUS-1] = BAD_APICID }; |
30 | EXPORT_SYMBOL(x86_cpu_to_apicid); | 30 | EXPORT_SYMBOL(x86_cpu_to_apicid); |
31 | 31 | ||
32 | u8 x86_cpu_to_log_apicid[NR_CPUS] = { [0 ... NR_CPUS-1] = BAD_APICID }; | ||
33 | |||
34 | struct genapic __read_mostly *genapic = &apic_flat; | 32 | struct genapic __read_mostly *genapic = &apic_flat; |
35 | 33 | ||
36 | /* | 34 | /* |
diff --git a/arch/x86/kernel/genapic_flat_64.c b/arch/x86/kernel/genapic_flat_64.c index ecb01eefdd27..91c7526768ee 100644 --- a/arch/x86/kernel/genapic_flat_64.c +++ b/arch/x86/kernel/genapic_flat_64.c | |||
@@ -52,7 +52,6 @@ static void flat_init_apic_ldr(void) | |||
52 | 52 | ||
53 | num = smp_processor_id(); | 53 | num = smp_processor_id(); |
54 | id = 1UL << num; | 54 | id = 1UL << num; |
55 | x86_cpu_to_log_apicid[num] = id; | ||
56 | apic_write(APIC_DFR, APIC_DFR_FLAT); | 55 | apic_write(APIC_DFR, APIC_DFR_FLAT); |
57 | val = apic_read(APIC_LDR) & ~APIC_LDR_MASK; | 56 | val = apic_read(APIC_LDR) & ~APIC_LDR_MASK; |
58 | val |= SET_APIC_LOGICAL_ID(id); | 57 | val |= SET_APIC_LOGICAL_ID(id); |
diff --git a/arch/x86/kernel/head_32.S b/arch/x86/kernel/head_32.S index 9150ca9b5f80..39677965e161 100644 --- a/arch/x86/kernel/head_32.S +++ b/arch/x86/kernel/head_32.S | |||
@@ -51,6 +51,15 @@ | |||
51 | */ | 51 | */ |
52 | LOW_PAGES = 1<<(32-PAGE_SHIFT_asm) | 52 | LOW_PAGES = 1<<(32-PAGE_SHIFT_asm) |
53 | 53 | ||
54 | /* | ||
55 | * To preserve the DMA pool in PAGEALLOC kernels, we'll allocate | ||
56 | * pagetables from above the 16MB DMA limit, so we'll have to set | ||
57 | * up pagetables 16MB more (worst-case): | ||
58 | */ | ||
59 | #ifdef CONFIG_DEBUG_PAGEALLOC | ||
60 | LOW_PAGES = LOW_PAGES + 0x1000000 | ||
61 | #endif | ||
62 | |||
54 | #if PTRS_PER_PMD > 1 | 63 | #if PTRS_PER_PMD > 1 |
55 | PAGE_TABLE_SIZE = (LOW_PAGES / PTRS_PER_PMD) + PTRS_PER_PGD | 64 | PAGE_TABLE_SIZE = (LOW_PAGES / PTRS_PER_PMD) + PTRS_PER_PGD |
56 | #else | 65 | #else |
@@ -443,6 +452,7 @@ early_page_fault: | |||
443 | early_fault: | 452 | early_fault: |
444 | cld | 453 | cld |
445 | #ifdef CONFIG_PRINTK | 454 | #ifdef CONFIG_PRINTK |
455 | pusha | ||
446 | movl $(__KERNEL_DS),%eax | 456 | movl $(__KERNEL_DS),%eax |
447 | movl %eax,%ds | 457 | movl %eax,%ds |
448 | movl %eax,%es | 458 | movl %eax,%es |
@@ -534,8 +544,15 @@ int_msg: | |||
534 | .asciz "Unknown interrupt or fault at EIP %p %p %p\n" | 544 | .asciz "Unknown interrupt or fault at EIP %p %p %p\n" |
535 | 545 | ||
536 | fault_msg: | 546 | fault_msg: |
537 | .ascii "Int %d: CR2 %p err %p EIP %p CS %p flags %p\n" | 547 | .ascii \ |
538 | .asciz "Stack: %p %p %p %p %p %p %p %p\n" | 548 | /* fault info: */ "BUG: Int %d: CR2 %p\n" \ |
549 | /* pusha regs: */ " EDI %p ESI %p EBP %p ESP %p\n" \ | ||
550 | " EBX %p EDX %p ECX %p EAX %p\n" \ | ||
551 | /* fault frame: */ " err %p EIP %p CS %p flg %p\n" \ | ||
552 | \ | ||
553 | "Stack: %p %p %p %p %p %p %p %p\n" \ | ||
554 | " %p %p %p %p %p %p %p %p\n" \ | ||
555 | " %p %p %p %p %p %p %p %p\n" | ||
539 | 556 | ||
540 | #include "../../x86/xen/xen-head.S" | 557 | #include "../../x86/xen/xen-head.S" |
541 | 558 | ||
diff --git a/arch/x86/kernel/i386_ksyms_32.c b/arch/x86/kernel/i386_ksyms_32.c index e3d4b73bfdb0..edd39ccf139e 100644 --- a/arch/x86/kernel/i386_ksyms_32.c +++ b/arch/x86/kernel/i386_ksyms_32.c | |||
@@ -1,4 +1,5 @@ | |||
1 | #include <linux/module.h> | 1 | #include <linux/module.h> |
2 | #include <asm/semaphore.h> | ||
2 | #include <asm/checksum.h> | 3 | #include <asm/checksum.h> |
3 | #include <asm/desc.h> | 4 | #include <asm/desc.h> |
4 | 5 | ||
diff --git a/arch/x86/kernel/i8259_32.c b/arch/x86/kernel/i8259_32.c index 679bb33acbf1..d34a10cc13a7 100644 --- a/arch/x86/kernel/i8259_32.c +++ b/arch/x86/kernel/i8259_32.c | |||
@@ -349,7 +349,11 @@ static irqreturn_t math_error_irq(int cpl, void *dev_id) | |||
349 | * New motherboards sometimes make IRQ 13 be a PCI interrupt, | 349 | * New motherboards sometimes make IRQ 13 be a PCI interrupt, |
350 | * so allow interrupt sharing. | 350 | * so allow interrupt sharing. |
351 | */ | 351 | */ |
352 | static struct irqaction fpu_irq = { math_error_irq, 0, CPU_MASK_NONE, "fpu", NULL, NULL }; | 352 | static struct irqaction fpu_irq = { |
353 | .handler = math_error_irq, | ||
354 | .mask = CPU_MASK_NONE, | ||
355 | .name = "fpu", | ||
356 | }; | ||
353 | 357 | ||
354 | void __init init_ISA_irqs (void) | 358 | void __init init_ISA_irqs (void) |
355 | { | 359 | { |
diff --git a/arch/x86/kernel/i8259_64.c b/arch/x86/kernel/i8259_64.c index eb72976cc13c..3f27ea0b9816 100644 --- a/arch/x86/kernel/i8259_64.c +++ b/arch/x86/kernel/i8259_64.c | |||
@@ -395,7 +395,11 @@ device_initcall(i8259A_init_sysfs); | |||
395 | * IRQ2 is cascade interrupt to second interrupt controller | 395 | * IRQ2 is cascade interrupt to second interrupt controller |
396 | */ | 396 | */ |
397 | 397 | ||
398 | static struct irqaction irq2 = { no_action, 0, CPU_MASK_NONE, "cascade", NULL, NULL}; | 398 | static struct irqaction irq2 = { |
399 | .handler = no_action, | ||
400 | .mask = CPU_MASK_NONE, | ||
401 | .name = "cascade", | ||
402 | }; | ||
399 | DEFINE_PER_CPU(vector_irq_t, vector_irq) = { | 403 | DEFINE_PER_CPU(vector_irq_t, vector_irq) = { |
400 | [0 ... IRQ0_VECTOR - 1] = -1, | 404 | [0 ... IRQ0_VECTOR - 1] = -1, |
401 | [IRQ0_VECTOR] = 0, | 405 | [IRQ0_VECTOR] = 0, |
diff --git a/arch/x86/kernel/io_apic_32.c b/arch/x86/kernel/io_apic_32.c index 4ee1e5ee9b57..5f10c7189534 100644 --- a/arch/x86/kernel/io_apic_32.c +++ b/arch/x86/kernel/io_apic_32.c | |||
@@ -1296,6 +1296,11 @@ static void __init setup_IO_APIC_irqs(void) | |||
1296 | continue; | 1296 | continue; |
1297 | } | 1297 | } |
1298 | 1298 | ||
1299 | if (!first_notcon) { | ||
1300 | apic_printk(APIC_VERBOSE, " not connected.\n"); | ||
1301 | first_notcon = 1; | ||
1302 | } | ||
1303 | |||
1299 | entry.trigger = irq_trigger(idx); | 1304 | entry.trigger = irq_trigger(idx); |
1300 | entry.polarity = irq_polarity(idx); | 1305 | entry.polarity = irq_polarity(idx); |
1301 | 1306 | ||
diff --git a/arch/x86/kernel/io_apic_64.c b/arch/x86/kernel/io_apic_64.c index 966fa1062491..1c2c7bf6a9d3 100644 --- a/arch/x86/kernel/io_apic_64.c +++ b/arch/x86/kernel/io_apic_64.c | |||
@@ -875,6 +875,10 @@ static void __init setup_IO_APIC_irqs(void) | |||
875 | apic_printk(APIC_VERBOSE, ", %d-%d", mp_ioapics[apic].mpc_apicid, pin); | 875 | apic_printk(APIC_VERBOSE, ", %d-%d", mp_ioapics[apic].mpc_apicid, pin); |
876 | continue; | 876 | continue; |
877 | } | 877 | } |
878 | if (!first_notcon) { | ||
879 | apic_printk(APIC_VERBOSE, " not connected.\n"); | ||
880 | first_notcon = 1; | ||
881 | } | ||
878 | 882 | ||
879 | irq = pin_2_irq(idx, apic, pin); | 883 | irq = pin_2_irq(idx, apic, pin); |
880 | add_pin_to_irq(irq, apic, pin); | 884 | add_pin_to_irq(irq, apic, pin); |
@@ -885,7 +889,7 @@ static void __init setup_IO_APIC_irqs(void) | |||
885 | } | 889 | } |
886 | 890 | ||
887 | if (!first_notcon) | 891 | if (!first_notcon) |
888 | apic_printk(APIC_VERBOSE," not connected.\n"); | 892 | apic_printk(APIC_VERBOSE, " not connected.\n"); |
889 | } | 893 | } |
890 | 894 | ||
891 | /* | 895 | /* |
@@ -1845,7 +1849,7 @@ static struct sysdev_class ioapic_sysdev_class = { | |||
1845 | static int __init ioapic_init_sysfs(void) | 1849 | static int __init ioapic_init_sysfs(void) |
1846 | { | 1850 | { |
1847 | struct sys_device * dev; | 1851 | struct sys_device * dev; |
1848 | int i, size, error = 0; | 1852 | int i, size, error; |
1849 | 1853 | ||
1850 | error = sysdev_class_register(&ioapic_sysdev_class); | 1854 | error = sysdev_class_register(&ioapic_sysdev_class); |
1851 | if (error) | 1855 | if (error) |
@@ -1854,12 +1858,11 @@ static int __init ioapic_init_sysfs(void) | |||
1854 | for (i = 0; i < nr_ioapics; i++ ) { | 1858 | for (i = 0; i < nr_ioapics; i++ ) { |
1855 | size = sizeof(struct sys_device) + nr_ioapic_registers[i] | 1859 | size = sizeof(struct sys_device) + nr_ioapic_registers[i] |
1856 | * sizeof(struct IO_APIC_route_entry); | 1860 | * sizeof(struct IO_APIC_route_entry); |
1857 | mp_ioapic_data[i] = kmalloc(size, GFP_KERNEL); | 1861 | mp_ioapic_data[i] = kzalloc(size, GFP_KERNEL); |
1858 | if (!mp_ioapic_data[i]) { | 1862 | if (!mp_ioapic_data[i]) { |
1859 | printk(KERN_ERR "Can't suspend/resume IOAPIC %d\n", i); | 1863 | printk(KERN_ERR "Can't suspend/resume IOAPIC %d\n", i); |
1860 | continue; | 1864 | continue; |
1861 | } | 1865 | } |
1862 | memset(mp_ioapic_data[i], 0, size); | ||
1863 | dev = &mp_ioapic_data[i]->dev; | 1866 | dev = &mp_ioapic_data[i]->dev; |
1864 | dev->id = i; | 1867 | dev->id = i; |
1865 | dev->cls = &ioapic_sysdev_class; | 1868 | dev->cls = &ioapic_sysdev_class; |
diff --git a/arch/x86/kernel/irq_32.c b/arch/x86/kernel/irq_32.c index e173b763f148..d3fde94f7345 100644 --- a/arch/x86/kernel/irq_32.c +++ b/arch/x86/kernel/irq_32.c | |||
@@ -255,9 +255,17 @@ int show_interrupts(struct seq_file *p, void *v) | |||
255 | } | 255 | } |
256 | 256 | ||
257 | if (i < NR_IRQS) { | 257 | if (i < NR_IRQS) { |
258 | unsigned any_count = 0; | ||
259 | |||
258 | spin_lock_irqsave(&irq_desc[i].lock, flags); | 260 | spin_lock_irqsave(&irq_desc[i].lock, flags); |
261 | #ifndef CONFIG_SMP | ||
262 | any_count = kstat_irqs(i); | ||
263 | #else | ||
264 | for_each_online_cpu(j) | ||
265 | any_count |= kstat_cpu(j).irqs[i]; | ||
266 | #endif | ||
259 | action = irq_desc[i].action; | 267 | action = irq_desc[i].action; |
260 | if (!action) | 268 | if (!action && !any_count) |
261 | goto skip; | 269 | goto skip; |
262 | seq_printf(p, "%3d: ",i); | 270 | seq_printf(p, "%3d: ",i); |
263 | #ifndef CONFIG_SMP | 271 | #ifndef CONFIG_SMP |
@@ -268,10 +276,12 @@ int show_interrupts(struct seq_file *p, void *v) | |||
268 | #endif | 276 | #endif |
269 | seq_printf(p, " %8s", irq_desc[i].chip->name); | 277 | seq_printf(p, " %8s", irq_desc[i].chip->name); |
270 | seq_printf(p, "-%-8s", irq_desc[i].name); | 278 | seq_printf(p, "-%-8s", irq_desc[i].name); |
271 | seq_printf(p, " %s", action->name); | ||
272 | 279 | ||
273 | for (action=action->next; action; action = action->next) | 280 | if (action) { |
274 | seq_printf(p, ", %s", action->name); | 281 | seq_printf(p, " %s", action->name); |
282 | while ((action = action->next) != NULL) | ||
283 | seq_printf(p, ", %s", action->name); | ||
284 | } | ||
275 | 285 | ||
276 | seq_putc(p, '\n'); | 286 | seq_putc(p, '\n'); |
277 | skip: | 287 | skip: |
@@ -280,14 +290,41 @@ skip: | |||
280 | seq_printf(p, "NMI: "); | 290 | seq_printf(p, "NMI: "); |
281 | for_each_online_cpu(j) | 291 | for_each_online_cpu(j) |
282 | seq_printf(p, "%10u ", nmi_count(j)); | 292 | seq_printf(p, "%10u ", nmi_count(j)); |
283 | seq_putc(p, '\n'); | 293 | seq_printf(p, " Non-maskable interrupts\n"); |
284 | #ifdef CONFIG_X86_LOCAL_APIC | 294 | #ifdef CONFIG_X86_LOCAL_APIC |
285 | seq_printf(p, "LOC: "); | 295 | seq_printf(p, "LOC: "); |
286 | for_each_online_cpu(j) | 296 | for_each_online_cpu(j) |
287 | seq_printf(p, "%10u ", | 297 | seq_printf(p, "%10u ", |
288 | per_cpu(irq_stat,j).apic_timer_irqs); | 298 | per_cpu(irq_stat,j).apic_timer_irqs); |
289 | seq_putc(p, '\n'); | 299 | seq_printf(p, " Local timer interrupts\n"); |
290 | #endif | 300 | #endif |
301 | #ifdef CONFIG_SMP | ||
302 | seq_printf(p, "RES: "); | ||
303 | for_each_online_cpu(j) | ||
304 | seq_printf(p, "%10u ", | ||
305 | per_cpu(irq_stat,j).irq_resched_count); | ||
306 | seq_printf(p, " Rescheduling interrupts\n"); | ||
307 | seq_printf(p, "CAL: "); | ||
308 | for_each_online_cpu(j) | ||
309 | seq_printf(p, "%10u ", | ||
310 | per_cpu(irq_stat,j).irq_call_count); | ||
311 | seq_printf(p, " function call interrupts\n"); | ||
312 | seq_printf(p, "TLB: "); | ||
313 | for_each_online_cpu(j) | ||
314 | seq_printf(p, "%10u ", | ||
315 | per_cpu(irq_stat,j).irq_tlb_count); | ||
316 | seq_printf(p, " TLB shootdowns\n"); | ||
317 | #endif | ||
318 | seq_printf(p, "TRM: "); | ||
319 | for_each_online_cpu(j) | ||
320 | seq_printf(p, "%10u ", | ||
321 | per_cpu(irq_stat,j).irq_thermal_count); | ||
322 | seq_printf(p, " Thermal event interrupts\n"); | ||
323 | seq_printf(p, "SPU: "); | ||
324 | for_each_online_cpu(j) | ||
325 | seq_printf(p, "%10u ", | ||
326 | per_cpu(irq_stat,j).irq_spurious_count); | ||
327 | seq_printf(p, " Spurious interrupts\n"); | ||
291 | seq_printf(p, "ERR: %10u\n", atomic_read(&irq_err_count)); | 328 | seq_printf(p, "ERR: %10u\n", atomic_read(&irq_err_count)); |
292 | #if defined(CONFIG_X86_IO_APIC) | 329 | #if defined(CONFIG_X86_IO_APIC) |
293 | seq_printf(p, "MIS: %10u\n", atomic_read(&irq_mis_count)); | 330 | seq_printf(p, "MIS: %10u\n", atomic_read(&irq_mis_count)); |
diff --git a/arch/x86/kernel/irq_64.c b/arch/x86/kernel/irq_64.c index 865669efc540..6b5c730d67b9 100644 --- a/arch/x86/kernel/irq_64.c +++ b/arch/x86/kernel/irq_64.c | |||
@@ -62,9 +62,17 @@ int show_interrupts(struct seq_file *p, void *v) | |||
62 | } | 62 | } |
63 | 63 | ||
64 | if (i < NR_IRQS) { | 64 | if (i < NR_IRQS) { |
65 | unsigned any_count = 0; | ||
66 | |||
65 | spin_lock_irqsave(&irq_desc[i].lock, flags); | 67 | spin_lock_irqsave(&irq_desc[i].lock, flags); |
68 | #ifndef CONFIG_SMP | ||
69 | any_count = kstat_irqs(i); | ||
70 | #else | ||
71 | for_each_online_cpu(j) | ||
72 | any_count |= kstat_cpu(j).irqs[i]; | ||
73 | #endif | ||
66 | action = irq_desc[i].action; | 74 | action = irq_desc[i].action; |
67 | if (!action) | 75 | if (!action && !any_count) |
68 | goto skip; | 76 | goto skip; |
69 | seq_printf(p, "%3d: ",i); | 77 | seq_printf(p, "%3d: ",i); |
70 | #ifndef CONFIG_SMP | 78 | #ifndef CONFIG_SMP |
@@ -76,9 +84,11 @@ int show_interrupts(struct seq_file *p, void *v) | |||
76 | seq_printf(p, " %8s", irq_desc[i].chip->name); | 84 | seq_printf(p, " %8s", irq_desc[i].chip->name); |
77 | seq_printf(p, "-%-8s", irq_desc[i].name); | 85 | seq_printf(p, "-%-8s", irq_desc[i].name); |
78 | 86 | ||
79 | seq_printf(p, " %s", action->name); | 87 | if (action) { |
80 | for (action=action->next; action; action = action->next) | 88 | seq_printf(p, " %s", action->name); |
81 | seq_printf(p, ", %s", action->name); | 89 | while ((action = action->next) != NULL) |
90 | seq_printf(p, ", %s", action->name); | ||
91 | } | ||
82 | seq_putc(p, '\n'); | 92 | seq_putc(p, '\n'); |
83 | skip: | 93 | skip: |
84 | spin_unlock_irqrestore(&irq_desc[i].lock, flags); | 94 | spin_unlock_irqrestore(&irq_desc[i].lock, flags); |
@@ -86,11 +96,37 @@ skip: | |||
86 | seq_printf(p, "NMI: "); | 96 | seq_printf(p, "NMI: "); |
87 | for_each_online_cpu(j) | 97 | for_each_online_cpu(j) |
88 | seq_printf(p, "%10u ", cpu_pda(j)->__nmi_count); | 98 | seq_printf(p, "%10u ", cpu_pda(j)->__nmi_count); |
89 | seq_putc(p, '\n'); | 99 | seq_printf(p, " Non-maskable interrupts\n"); |
90 | seq_printf(p, "LOC: "); | 100 | seq_printf(p, "LOC: "); |
91 | for_each_online_cpu(j) | 101 | for_each_online_cpu(j) |
92 | seq_printf(p, "%10u ", cpu_pda(j)->apic_timer_irqs); | 102 | seq_printf(p, "%10u ", cpu_pda(j)->apic_timer_irqs); |
93 | seq_putc(p, '\n'); | 103 | seq_printf(p, " Local timer interrupts\n"); |
104 | #ifdef CONFIG_SMP | ||
105 | seq_printf(p, "RES: "); | ||
106 | for_each_online_cpu(j) | ||
107 | seq_printf(p, "%10u ", cpu_pda(j)->irq_resched_count); | ||
108 | seq_printf(p, " Rescheduling interrupts\n"); | ||
109 | seq_printf(p, "CAL: "); | ||
110 | for_each_online_cpu(j) | ||
111 | seq_printf(p, "%10u ", cpu_pda(j)->irq_call_count); | ||
112 | seq_printf(p, " function call interrupts\n"); | ||
113 | seq_printf(p, "TLB: "); | ||
114 | for_each_online_cpu(j) | ||
115 | seq_printf(p, "%10u ", cpu_pda(j)->irq_tlb_count); | ||
116 | seq_printf(p, " TLB shootdowns\n"); | ||
117 | #endif | ||
118 | seq_printf(p, "TRM: "); | ||
119 | for_each_online_cpu(j) | ||
120 | seq_printf(p, "%10u ", cpu_pda(j)->irq_thermal_count); | ||
121 | seq_printf(p, " Thermal event interrupts\n"); | ||
122 | seq_printf(p, "THR: "); | ||
123 | for_each_online_cpu(j) | ||
124 | seq_printf(p, "%10u ", cpu_pda(j)->irq_threshold_count); | ||
125 | seq_printf(p, " Threshold APIC interrupts\n"); | ||
126 | seq_printf(p, "SPU: "); | ||
127 | for_each_online_cpu(j) | ||
128 | seq_printf(p, "%10u ", cpu_pda(j)->irq_spurious_count); | ||
129 | seq_printf(p, " Spurious interrupts\n"); | ||
94 | seq_printf(p, "ERR: %10u\n", atomic_read(&irq_err_count)); | 130 | seq_printf(p, "ERR: %10u\n", atomic_read(&irq_err_count)); |
95 | } | 131 | } |
96 | return 0; | 132 | return 0; |
diff --git a/arch/x86/kernel/ldt_32.c b/arch/x86/kernel/ldt_32.c index a8b18421863a..9ff90a27c45f 100644 --- a/arch/x86/kernel/ldt_32.c +++ b/arch/x86/kernel/ldt_32.c | |||
@@ -92,13 +92,13 @@ int init_new_context(struct task_struct *tsk, struct mm_struct *mm) | |||
92 | struct mm_struct * old_mm; | 92 | struct mm_struct * old_mm; |
93 | int retval = 0; | 93 | int retval = 0; |
94 | 94 | ||
95 | init_MUTEX(&mm->context.sem); | 95 | mutex_init(&mm->context.lock); |
96 | mm->context.size = 0; | 96 | mm->context.size = 0; |
97 | old_mm = current->mm; | 97 | old_mm = current->mm; |
98 | if (old_mm && old_mm->context.size > 0) { | 98 | if (old_mm && old_mm->context.size > 0) { |
99 | down(&old_mm->context.sem); | 99 | mutex_lock(&old_mm->context.lock); |
100 | retval = copy_ldt(&mm->context, &old_mm->context); | 100 | retval = copy_ldt(&mm->context, &old_mm->context); |
101 | up(&old_mm->context.sem); | 101 | mutex_unlock(&old_mm->context.lock); |
102 | } | 102 | } |
103 | return retval; | 103 | return retval; |
104 | } | 104 | } |
@@ -130,7 +130,7 @@ static int read_ldt(void __user * ptr, unsigned long bytecount) | |||
130 | if (bytecount > LDT_ENTRY_SIZE*LDT_ENTRIES) | 130 | if (bytecount > LDT_ENTRY_SIZE*LDT_ENTRIES) |
131 | bytecount = LDT_ENTRY_SIZE*LDT_ENTRIES; | 131 | bytecount = LDT_ENTRY_SIZE*LDT_ENTRIES; |
132 | 132 | ||
133 | down(&mm->context.sem); | 133 | mutex_lock(&mm->context.lock); |
134 | size = mm->context.size*LDT_ENTRY_SIZE; | 134 | size = mm->context.size*LDT_ENTRY_SIZE; |
135 | if (size > bytecount) | 135 | if (size > bytecount) |
136 | size = bytecount; | 136 | size = bytecount; |
@@ -138,7 +138,7 @@ static int read_ldt(void __user * ptr, unsigned long bytecount) | |||
138 | err = 0; | 138 | err = 0; |
139 | if (copy_to_user(ptr, mm->context.ldt, size)) | 139 | if (copy_to_user(ptr, mm->context.ldt, size)) |
140 | err = -EFAULT; | 140 | err = -EFAULT; |
141 | up(&mm->context.sem); | 141 | mutex_unlock(&mm->context.lock); |
142 | if (err < 0) | 142 | if (err < 0) |
143 | goto error_return; | 143 | goto error_return; |
144 | if (size != bytecount) { | 144 | if (size != bytecount) { |
@@ -194,7 +194,7 @@ static int write_ldt(void __user * ptr, unsigned long bytecount, int oldmode) | |||
194 | goto out; | 194 | goto out; |
195 | } | 195 | } |
196 | 196 | ||
197 | down(&mm->context.sem); | 197 | mutex_lock(&mm->context.lock); |
198 | if (ldt_info.entry_number >= mm->context.size) { | 198 | if (ldt_info.entry_number >= mm->context.size) { |
199 | error = alloc_ldt(¤t->mm->context, ldt_info.entry_number+1, 1); | 199 | error = alloc_ldt(¤t->mm->context, ldt_info.entry_number+1, 1); |
200 | if (error < 0) | 200 | if (error < 0) |
@@ -221,7 +221,7 @@ install: | |||
221 | error = 0; | 221 | error = 0; |
222 | 222 | ||
223 | out_unlock: | 223 | out_unlock: |
224 | up(&mm->context.sem); | 224 | mutex_unlock(&mm->context.lock); |
225 | out: | 225 | out: |
226 | return error; | 226 | return error; |
227 | } | 227 | } |
diff --git a/arch/x86/kernel/ldt_64.c b/arch/x86/kernel/ldt_64.c index 3796523d616a..60e57abb8e90 100644 --- a/arch/x86/kernel/ldt_64.c +++ b/arch/x86/kernel/ldt_64.c | |||
@@ -96,13 +96,13 @@ int init_new_context(struct task_struct *tsk, struct mm_struct *mm) | |||
96 | struct mm_struct * old_mm; | 96 | struct mm_struct * old_mm; |
97 | int retval = 0; | 97 | int retval = 0; |
98 | 98 | ||
99 | init_MUTEX(&mm->context.sem); | 99 | mutex_init(&mm->context.lock); |
100 | mm->context.size = 0; | 100 | mm->context.size = 0; |
101 | old_mm = current->mm; | 101 | old_mm = current->mm; |
102 | if (old_mm && old_mm->context.size > 0) { | 102 | if (old_mm && old_mm->context.size > 0) { |
103 | down(&old_mm->context.sem); | 103 | mutex_lock(&old_mm->context.lock); |
104 | retval = copy_ldt(&mm->context, &old_mm->context); | 104 | retval = copy_ldt(&mm->context, &old_mm->context); |
105 | up(&old_mm->context.sem); | 105 | mutex_unlock(&old_mm->context.lock); |
106 | } | 106 | } |
107 | return retval; | 107 | return retval; |
108 | } | 108 | } |
@@ -133,7 +133,7 @@ static int read_ldt(void __user * ptr, unsigned long bytecount) | |||
133 | if (bytecount > LDT_ENTRY_SIZE*LDT_ENTRIES) | 133 | if (bytecount > LDT_ENTRY_SIZE*LDT_ENTRIES) |
134 | bytecount = LDT_ENTRY_SIZE*LDT_ENTRIES; | 134 | bytecount = LDT_ENTRY_SIZE*LDT_ENTRIES; |
135 | 135 | ||
136 | down(&mm->context.sem); | 136 | mutex_lock(&mm->context.lock); |
137 | size = mm->context.size*LDT_ENTRY_SIZE; | 137 | size = mm->context.size*LDT_ENTRY_SIZE; |
138 | if (size > bytecount) | 138 | if (size > bytecount) |
139 | size = bytecount; | 139 | size = bytecount; |
@@ -141,7 +141,7 @@ static int read_ldt(void __user * ptr, unsigned long bytecount) | |||
141 | err = 0; | 141 | err = 0; |
142 | if (copy_to_user(ptr, mm->context.ldt, size)) | 142 | if (copy_to_user(ptr, mm->context.ldt, size)) |
143 | err = -EFAULT; | 143 | err = -EFAULT; |
144 | up(&mm->context.sem); | 144 | mutex_unlock(&mm->context.lock); |
145 | if (err < 0) | 145 | if (err < 0) |
146 | goto error_return; | 146 | goto error_return; |
147 | if (size != bytecount) { | 147 | if (size != bytecount) { |
@@ -193,7 +193,7 @@ static int write_ldt(void __user * ptr, unsigned long bytecount, int oldmode) | |||
193 | goto out; | 193 | goto out; |
194 | } | 194 | } |
195 | 195 | ||
196 | down(&mm->context.sem); | 196 | mutex_lock(&mm->context.lock); |
197 | if (ldt_info.entry_number >= (unsigned)mm->context.size) { | 197 | if (ldt_info.entry_number >= (unsigned)mm->context.size) { |
198 | error = alloc_ldt(¤t->mm->context, ldt_info.entry_number+1, 1); | 198 | error = alloc_ldt(¤t->mm->context, ldt_info.entry_number+1, 1); |
199 | if (error < 0) | 199 | if (error < 0) |
@@ -223,7 +223,7 @@ install: | |||
223 | error = 0; | 223 | error = 0; |
224 | 224 | ||
225 | out_unlock: | 225 | out_unlock: |
226 | up(&mm->context.sem); | 226 | mutex_unlock(&mm->context.lock); |
227 | out: | 227 | out: |
228 | return error; | 228 | return error; |
229 | } | 229 | } |
diff --git a/arch/x86/kernel/mce_64.c b/arch/x86/kernel/mce_64.c index 97d2b757d6bd..8ca8f8648969 100644 --- a/arch/x86/kernel/mce_64.c +++ b/arch/x86/kernel/mce_64.c | |||
@@ -695,8 +695,6 @@ static int __init mcheck_disable(char *str) | |||
695 | mce=nobootlog Don't log MCEs from before booting. */ | 695 | mce=nobootlog Don't log MCEs from before booting. */ |
696 | static int __init mcheck_enable(char *str) | 696 | static int __init mcheck_enable(char *str) |
697 | { | 697 | { |
698 | if (*str == '=') | ||
699 | str++; | ||
700 | if (!strcmp(str, "off")) | 698 | if (!strcmp(str, "off")) |
701 | mce_dont_init = 1; | 699 | mce_dont_init = 1; |
702 | else if (!strcmp(str, "bootlog") || !strcmp(str,"nobootlog")) | 700 | else if (!strcmp(str, "bootlog") || !strcmp(str,"nobootlog")) |
@@ -709,7 +707,7 @@ static int __init mcheck_enable(char *str) | |||
709 | } | 707 | } |
710 | 708 | ||
711 | __setup("nomce", mcheck_disable); | 709 | __setup("nomce", mcheck_disable); |
712 | __setup("mce", mcheck_enable); | 710 | __setup("mce=", mcheck_enable); |
713 | 711 | ||
714 | /* | 712 | /* |
715 | * Sysfs support | 713 | * Sysfs support |
diff --git a/arch/x86/kernel/mce_amd_64.c b/arch/x86/kernel/mce_amd_64.c index 805b62b1e0df..0d2afd96aca4 100644 --- a/arch/x86/kernel/mce_amd_64.c +++ b/arch/x86/kernel/mce_amd_64.c | |||
@@ -237,6 +237,7 @@ asmlinkage void mce_threshold_interrupt(void) | |||
237 | } | 237 | } |
238 | } | 238 | } |
239 | out: | 239 | out: |
240 | add_pda(irq_threshold_count, 1); | ||
240 | irq_exit(); | 241 | irq_exit(); |
241 | } | 242 | } |
242 | 243 | ||
diff --git a/arch/x86/kernel/mce_intel_64.c b/arch/x86/kernel/mce_intel_64.c index 6551505d8a2c..c17eaf5dd6dd 100644 --- a/arch/x86/kernel/mce_intel_64.c +++ b/arch/x86/kernel/mce_intel_64.c | |||
@@ -26,6 +26,7 @@ asmlinkage void smp_thermal_interrupt(void) | |||
26 | if (therm_throt_process(msr_val & 1)) | 26 | if (therm_throt_process(msr_val & 1)) |
27 | mce_log_therm_throt_event(smp_processor_id(), msr_val); | 27 | mce_log_therm_throt_event(smp_processor_id(), msr_val); |
28 | 28 | ||
29 | add_pda(irq_thermal_count, 1); | ||
29 | irq_exit(); | 30 | irq_exit(); |
30 | } | 31 | } |
31 | 32 | ||
diff --git a/arch/x86/kernel/msr.c b/arch/x86/kernel/msr.c index c044de310b69..df85c9c13601 100644 --- a/arch/x86/kernel/msr.c +++ b/arch/x86/kernel/msr.c | |||
@@ -133,7 +133,7 @@ static const struct file_operations msr_fops = { | |||
133 | .open = msr_open, | 133 | .open = msr_open, |
134 | }; | 134 | }; |
135 | 135 | ||
136 | static int msr_device_create(int i) | 136 | static int __cpuinit msr_device_create(int i) |
137 | { | 137 | { |
138 | int err = 0; | 138 | int err = 0; |
139 | struct device *dev; | 139 | struct device *dev; |
@@ -144,7 +144,7 @@ static int msr_device_create(int i) | |||
144 | return err; | 144 | return err; |
145 | } | 145 | } |
146 | 146 | ||
147 | static int msr_class_cpu_callback(struct notifier_block *nfb, | 147 | static int __cpuinit msr_class_cpu_callback(struct notifier_block *nfb, |
148 | unsigned long action, void *hcpu) | 148 | unsigned long action, void *hcpu) |
149 | { | 149 | { |
150 | unsigned int cpu = (unsigned long)hcpu; | 150 | unsigned int cpu = (unsigned long)hcpu; |
diff --git a/arch/x86/kernel/pci-calgary_64.c b/arch/x86/kernel/pci-calgary_64.c index a50b787b3bfa..5098f58063a5 100644 --- a/arch/x86/kernel/pci-calgary_64.c +++ b/arch/x86/kernel/pci-calgary_64.c | |||
@@ -222,10 +222,10 @@ static inline unsigned int num_dma_pages(unsigned long dma, unsigned int dmalen) | |||
222 | return npages; | 222 | return npages; |
223 | } | 223 | } |
224 | 224 | ||
225 | static inline int translate_phb(struct pci_dev* dev) | 225 | static inline int translation_enabled(struct iommu_table *tbl) |
226 | { | 226 | { |
227 | int disabled = bus_info[dev->bus->number].translation_disabled; | 227 | /* only PHBs with translation enabled have an IOMMU table */ |
228 | return !disabled; | 228 | return (tbl != NULL); |
229 | } | 229 | } |
230 | 230 | ||
231 | static void iommu_range_reserve(struct iommu_table *tbl, | 231 | static void iommu_range_reserve(struct iommu_table *tbl, |
@@ -388,7 +388,7 @@ static void calgary_unmap_sg(struct device *dev, | |||
388 | struct scatterlist *s; | 388 | struct scatterlist *s; |
389 | int i; | 389 | int i; |
390 | 390 | ||
391 | if (!translate_phb(to_pci_dev(dev))) | 391 | if (!translation_enabled(tbl)) |
392 | return; | 392 | return; |
393 | 393 | ||
394 | for_each_sg(sglist, s, nelems, i) { | 394 | for_each_sg(sglist, s, nelems, i) { |
@@ -428,7 +428,7 @@ static int calgary_map_sg(struct device *dev, struct scatterlist *sg, | |||
428 | unsigned long entry; | 428 | unsigned long entry; |
429 | int i; | 429 | int i; |
430 | 430 | ||
431 | if (!translate_phb(to_pci_dev(dev))) | 431 | if (!translation_enabled(tbl)) |
432 | return calgary_nontranslate_map_sg(dev, sg, nelems, direction); | 432 | return calgary_nontranslate_map_sg(dev, sg, nelems, direction); |
433 | 433 | ||
434 | for_each_sg(sg, s, nelems, i) { | 434 | for_each_sg(sg, s, nelems, i) { |
@@ -474,7 +474,7 @@ static dma_addr_t calgary_map_single(struct device *dev, void *vaddr, | |||
474 | uaddr = (unsigned long)vaddr; | 474 | uaddr = (unsigned long)vaddr; |
475 | npages = num_dma_pages(uaddr, size); | 475 | npages = num_dma_pages(uaddr, size); |
476 | 476 | ||
477 | if (translate_phb(to_pci_dev(dev))) | 477 | if (translation_enabled(tbl)) |
478 | dma_handle = iommu_alloc(tbl, vaddr, npages, direction); | 478 | dma_handle = iommu_alloc(tbl, vaddr, npages, direction); |
479 | else | 479 | else |
480 | dma_handle = virt_to_bus(vaddr); | 480 | dma_handle = virt_to_bus(vaddr); |
@@ -488,7 +488,7 @@ static void calgary_unmap_single(struct device *dev, dma_addr_t dma_handle, | |||
488 | struct iommu_table *tbl = find_iommu_table(dev); | 488 | struct iommu_table *tbl = find_iommu_table(dev); |
489 | unsigned int npages; | 489 | unsigned int npages; |
490 | 490 | ||
491 | if (!translate_phb(to_pci_dev(dev))) | 491 | if (!translation_enabled(tbl)) |
492 | return; | 492 | return; |
493 | 493 | ||
494 | npages = num_dma_pages(dma_handle, size); | 494 | npages = num_dma_pages(dma_handle, size); |
@@ -513,7 +513,7 @@ static void* calgary_alloc_coherent(struct device *dev, size_t size, | |||
513 | goto error; | 513 | goto error; |
514 | memset(ret, 0, size); | 514 | memset(ret, 0, size); |
515 | 515 | ||
516 | if (translate_phb(to_pci_dev(dev))) { | 516 | if (translation_enabled(tbl)) { |
517 | /* set up tces to cover the allocated range */ | 517 | /* set up tces to cover the allocated range */ |
518 | mapping = iommu_alloc(tbl, ret, npages, DMA_BIDIRECTIONAL); | 518 | mapping = iommu_alloc(tbl, ret, npages, DMA_BIDIRECTIONAL); |
519 | if (mapping == bad_dma_address) | 519 | if (mapping == bad_dma_address) |
@@ -1194,7 +1194,7 @@ static int __init calgary_init(void) | |||
1194 | { | 1194 | { |
1195 | int ret; | 1195 | int ret; |
1196 | struct pci_dev *dev = NULL; | 1196 | struct pci_dev *dev = NULL; |
1197 | void *tce_space; | 1197 | struct calgary_bus_info *info; |
1198 | 1198 | ||
1199 | ret = calgary_locate_bbars(); | 1199 | ret = calgary_locate_bbars(); |
1200 | if (ret) | 1200 | if (ret) |
@@ -1206,12 +1206,14 @@ static int __init calgary_init(void) | |||
1206 | break; | 1206 | break; |
1207 | if (!is_cal_pci_dev(dev->device)) | 1207 | if (!is_cal_pci_dev(dev->device)) |
1208 | continue; | 1208 | continue; |
1209 | if (!translate_phb(dev)) { | 1209 | |
1210 | info = &bus_info[dev->bus->number]; | ||
1211 | if (info->translation_disabled) { | ||
1210 | calgary_init_one_nontraslated(dev); | 1212 | calgary_init_one_nontraslated(dev); |
1211 | continue; | 1213 | continue; |
1212 | } | 1214 | } |
1213 | tce_space = bus_info[dev->bus->number].tce_space; | 1215 | |
1214 | if (!tce_space && !translate_empty_slots) | 1216 | if (!info->tce_space && !translate_empty_slots) |
1215 | continue; | 1217 | continue; |
1216 | 1218 | ||
1217 | ret = calgary_init_one(dev); | 1219 | ret = calgary_init_one(dev); |
@@ -1229,11 +1231,13 @@ error: | |||
1229 | break; | 1231 | break; |
1230 | if (!is_cal_pci_dev(dev->device)) | 1232 | if (!is_cal_pci_dev(dev->device)) |
1231 | continue; | 1233 | continue; |
1232 | if (!translate_phb(dev)) { | 1234 | |
1235 | info = &bus_info[dev->bus->number]; | ||
1236 | if (info->translation_disabled) { | ||
1233 | pci_dev_put(dev); | 1237 | pci_dev_put(dev); |
1234 | continue; | 1238 | continue; |
1235 | } | 1239 | } |
1236 | if (!bus_info[dev->bus->number].tce_space && !translate_empty_slots) | 1240 | if (!info->tce_space && !translate_empty_slots) |
1237 | continue; | 1241 | continue; |
1238 | 1242 | ||
1239 | calgary_disable_translation(dev); | 1243 | calgary_disable_translation(dev); |
@@ -1546,7 +1550,7 @@ static void __init calgary_fixup_one_tce_space(struct pci_dev *dev) | |||
1546 | static int __init calgary_fixup_tce_spaces(void) | 1550 | static int __init calgary_fixup_tce_spaces(void) |
1547 | { | 1551 | { |
1548 | struct pci_dev *dev = NULL; | 1552 | struct pci_dev *dev = NULL; |
1549 | void *tce_space; | 1553 | struct calgary_bus_info *info; |
1550 | 1554 | ||
1551 | if (no_iommu || swiotlb || !calgary_detected) | 1555 | if (no_iommu || swiotlb || !calgary_detected) |
1552 | return -ENODEV; | 1556 | return -ENODEV; |
@@ -1559,11 +1563,12 @@ static int __init calgary_fixup_tce_spaces(void) | |||
1559 | break; | 1563 | break; |
1560 | if (!is_cal_pci_dev(dev->device)) | 1564 | if (!is_cal_pci_dev(dev->device)) |
1561 | continue; | 1565 | continue; |
1562 | if (!translate_phb(dev)) | 1566 | |
1567 | info = &bus_info[dev->bus->number]; | ||
1568 | if (info->translation_disabled) | ||
1563 | continue; | 1569 | continue; |
1564 | 1570 | ||
1565 | tce_space = bus_info[dev->bus->number].tce_space; | 1571 | if (!info->tce_space) |
1566 | if (!tce_space) | ||
1567 | continue; | 1572 | continue; |
1568 | 1573 | ||
1569 | calgary_fixup_one_tce_space(dev); | 1574 | calgary_fixup_one_tce_space(dev); |
diff --git a/arch/x86/kernel/pci-dma_32.c b/arch/x86/kernel/pci-dma_32.c index 0aae2f3847a5..51330321a5d3 100644 --- a/arch/x86/kernel/pci-dma_32.c +++ b/arch/x86/kernel/pci-dma_32.c | |||
@@ -12,7 +12,6 @@ | |||
12 | #include <linux/string.h> | 12 | #include <linux/string.h> |
13 | #include <linux/pci.h> | 13 | #include <linux/pci.h> |
14 | #include <linux/module.h> | 14 | #include <linux/module.h> |
15 | #include <linux/pci.h> | ||
16 | #include <asm/io.h> | 15 | #include <asm/io.h> |
17 | 16 | ||
18 | struct dma_coherent_mem { | 17 | struct dma_coherent_mem { |
diff --git a/arch/x86/kernel/pci-dma_64.c b/arch/x86/kernel/pci-dma_64.c index 9576a2eb375e..b2b42bdb0a15 100644 --- a/arch/x86/kernel/pci-dma_64.c +++ b/arch/x86/kernel/pci-dma_64.c | |||
@@ -51,11 +51,9 @@ dma_alloc_pages(struct device *dev, gfp_t gfp, unsigned order) | |||
51 | { | 51 | { |
52 | struct page *page; | 52 | struct page *page; |
53 | int node; | 53 | int node; |
54 | #ifdef CONFIG_PCI | 54 | |
55 | if (dev->bus == &pci_bus_type) | 55 | node = dev_to_node(dev); |
56 | node = pcibus_to_node(to_pci_dev(dev)->bus); | 56 | if (node == -1) |
57 | else | ||
58 | #endif | ||
59 | node = numa_node_id(); | 57 | node = numa_node_id(); |
60 | 58 | ||
61 | if (node < first_node(node_online_map)) | 59 | if (node < first_node(node_online_map)) |
diff --git a/arch/x86/kernel/pci-gart_64.c b/arch/x86/kernel/pci-gart_64.c index cfcc84e6c350..5cdfab65e93f 100644 --- a/arch/x86/kernel/pci-gart_64.c +++ b/arch/x86/kernel/pci-gart_64.c | |||
@@ -8,6 +8,7 @@ | |||
8 | * See Documentation/DMA-mapping.txt for the interface specification. | 8 | * See Documentation/DMA-mapping.txt for the interface specification. |
9 | * | 9 | * |
10 | * Copyright 2002 Andi Kleen, SuSE Labs. | 10 | * Copyright 2002 Andi Kleen, SuSE Labs. |
11 | * Subject to the GNU General Public License v2 only. | ||
11 | */ | 12 | */ |
12 | 13 | ||
13 | #include <linux/types.h> | 14 | #include <linux/types.h> |
@@ -375,7 +376,8 @@ static inline int dma_map_cont(struct scatterlist *start, int nelems, | |||
375 | * DMA map all entries in a scatterlist. | 376 | * DMA map all entries in a scatterlist. |
376 | * Merge chunks that have page aligned sizes into a continuous mapping. | 377 | * Merge chunks that have page aligned sizes into a continuous mapping. |
377 | */ | 378 | */ |
378 | int gart_map_sg(struct device *dev, struct scatterlist *sg, int nents, int dir) | 379 | static int gart_map_sg(struct device *dev, struct scatterlist *sg, int nents, |
380 | int dir) | ||
379 | { | 381 | { |
380 | int i; | 382 | int i; |
381 | int out; | 383 | int out; |
diff --git a/arch/x86/kernel/ptrace_32.c b/arch/x86/kernel/ptrace_32.c index 8622b9cd3e38..99102ec5fade 100644 --- a/arch/x86/kernel/ptrace_32.c +++ b/arch/x86/kernel/ptrace_32.c | |||
@@ -165,7 +165,7 @@ static unsigned long convert_eip_to_linear(struct task_struct *child, struct pt_ | |||
165 | 165 | ||
166 | seg &= ~7UL; | 166 | seg &= ~7UL; |
167 | 167 | ||
168 | down(&child->mm->context.sem); | 168 | mutex_lock(&child->mm->context.lock); |
169 | if (unlikely((seg >> 3) >= child->mm->context.size)) | 169 | if (unlikely((seg >> 3) >= child->mm->context.size)) |
170 | addr = -1L; /* bogus selector, access would fault */ | 170 | addr = -1L; /* bogus selector, access would fault */ |
171 | else { | 171 | else { |
@@ -179,7 +179,7 @@ static unsigned long convert_eip_to_linear(struct task_struct *child, struct pt_ | |||
179 | addr &= 0xffff; | 179 | addr &= 0xffff; |
180 | addr += base; | 180 | addr += base; |
181 | } | 181 | } |
182 | up(&child->mm->context.sem); | 182 | mutex_unlock(&child->mm->context.lock); |
183 | } | 183 | } |
184 | return addr; | 184 | return addr; |
185 | } | 185 | } |
diff --git a/arch/x86/kernel/ptrace_64.c b/arch/x86/kernel/ptrace_64.c index 86321ee6da93..607085f3f08a 100644 --- a/arch/x86/kernel/ptrace_64.c +++ b/arch/x86/kernel/ptrace_64.c | |||
@@ -103,7 +103,7 @@ unsigned long convert_rip_to_linear(struct task_struct *child, struct pt_regs *r | |||
103 | 103 | ||
104 | seg &= ~7UL; | 104 | seg &= ~7UL; |
105 | 105 | ||
106 | down(&child->mm->context.sem); | 106 | mutex_lock(&child->mm->context.lock); |
107 | if (unlikely((seg >> 3) >= child->mm->context.size)) | 107 | if (unlikely((seg >> 3) >= child->mm->context.size)) |
108 | addr = -1L; /* bogus selector, access would fault */ | 108 | addr = -1L; /* bogus selector, access would fault */ |
109 | else { | 109 | else { |
@@ -117,7 +117,7 @@ unsigned long convert_rip_to_linear(struct task_struct *child, struct pt_regs *r | |||
117 | addr &= 0xffff; | 117 | addr &= 0xffff; |
118 | addr += base; | 118 | addr += base; |
119 | } | 119 | } |
120 | up(&child->mm->context.sem); | 120 | mutex_unlock(&child->mm->context.lock); |
121 | } | 121 | } |
122 | 122 | ||
123 | return addr; | 123 | return addr; |
diff --git a/arch/x86/kernel/setup_64.c b/arch/x86/kernel/setup_64.c index 8159bf0be17a..5a19f0cc5b67 100644 --- a/arch/x86/kernel/setup_64.c +++ b/arch/x86/kernel/setup_64.c | |||
@@ -604,7 +604,7 @@ static void __cpuinit init_amd(struct cpuinfo_x86 *c) | |||
604 | level = cpuid_eax(1); | 604 | level = cpuid_eax(1); |
605 | if (c->x86 == 15 && ((level >= 0x0f48 && level < 0x0f50) || level >= 0x0f58)) | 605 | if (c->x86 == 15 && ((level >= 0x0f48 && level < 0x0f50) || level >= 0x0f58)) |
606 | set_bit(X86_FEATURE_REP_GOOD, &c->x86_capability); | 606 | set_bit(X86_FEATURE_REP_GOOD, &c->x86_capability); |
607 | if (c->x86 == 0x10) | 607 | if (c->x86 == 0x10 || c->x86 == 0x11) |
608 | set_bit(X86_FEATURE_REP_GOOD, &c->x86_capability); | 608 | set_bit(X86_FEATURE_REP_GOOD, &c->x86_capability); |
609 | 609 | ||
610 | /* Enable workaround for FXSAVE leak */ | 610 | /* Enable workaround for FXSAVE leak */ |
@@ -968,7 +968,7 @@ static int show_cpuinfo(struct seq_file *m, void *v) | |||
968 | * applications want to get the raw CPUID data, they should access | 968 | * applications want to get the raw CPUID data, they should access |
969 | * /dev/cpu/<cpu_nr>/cpuid instead. | 969 | * /dev/cpu/<cpu_nr>/cpuid instead. |
970 | */ | 970 | */ |
971 | static char *x86_cap_flags[] = { | 971 | static const char *const x86_cap_flags[] = { |
972 | /* Intel-defined */ | 972 | /* Intel-defined */ |
973 | "fpu", "vme", "de", "pse", "tsc", "msr", "pae", "mce", | 973 | "fpu", "vme", "de", "pse", "tsc", "msr", "pae", "mce", |
974 | "cx8", "apic", NULL, "sep", "mtrr", "pge", "mca", "cmov", | 974 | "cx8", "apic", NULL, "sep", "mtrr", "pge", "mca", "cmov", |
@@ -1022,7 +1022,7 @@ static int show_cpuinfo(struct seq_file *m, void *v) | |||
1022 | NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, | 1022 | NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, |
1023 | NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, | 1023 | NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, |
1024 | }; | 1024 | }; |
1025 | static char *x86_power_flags[] = { | 1025 | static const char *const x86_power_flags[] = { |
1026 | "ts", /* temperature sensor */ | 1026 | "ts", /* temperature sensor */ |
1027 | "fid", /* frequency id control */ | 1027 | "fid", /* frequency id control */ |
1028 | "vid", /* voltage id control */ | 1028 | "vid", /* voltage id control */ |
diff --git a/arch/x86/kernel/signal_32.c b/arch/x86/kernel/signal_32.c index d01d51fcce2a..0d79df3c5631 100644 --- a/arch/x86/kernel/signal_32.c +++ b/arch/x86/kernel/signal_32.c | |||
@@ -385,7 +385,6 @@ static int setup_frame(int sig, struct k_sigaction *ka, | |||
385 | regs->edx = (unsigned long) 0; | 385 | regs->edx = (unsigned long) 0; |
386 | regs->ecx = (unsigned long) 0; | 386 | regs->ecx = (unsigned long) 0; |
387 | 387 | ||
388 | set_fs(USER_DS); | ||
389 | regs->xds = __USER_DS; | 388 | regs->xds = __USER_DS; |
390 | regs->xes = __USER_DS; | 389 | regs->xes = __USER_DS; |
391 | regs->xss = __USER_DS; | 390 | regs->xss = __USER_DS; |
@@ -479,7 +478,6 @@ static int setup_rt_frame(int sig, struct k_sigaction *ka, siginfo_t *info, | |||
479 | regs->edx = (unsigned long) &frame->info; | 478 | regs->edx = (unsigned long) &frame->info; |
480 | regs->ecx = (unsigned long) &frame->uc; | 479 | regs->ecx = (unsigned long) &frame->uc; |
481 | 480 | ||
482 | set_fs(USER_DS); | ||
483 | regs->xds = __USER_DS; | 481 | regs->xds = __USER_DS; |
484 | regs->xes = __USER_DS; | 482 | regs->xes = __USER_DS; |
485 | regs->xss = __USER_DS; | 483 | regs->xss = __USER_DS; |
diff --git a/arch/x86/kernel/smp_32.c b/arch/x86/kernel/smp_32.c index 2d35d8502029..791d9f8036ae 100644 --- a/arch/x86/kernel/smp_32.c +++ b/arch/x86/kernel/smp_32.c | |||
@@ -342,6 +342,7 @@ fastcall void smp_invalidate_interrupt(struct pt_regs *regs) | |||
342 | smp_mb__after_clear_bit(); | 342 | smp_mb__after_clear_bit(); |
343 | out: | 343 | out: |
344 | put_cpu_no_resched(); | 344 | put_cpu_no_resched(); |
345 | __get_cpu_var(irq_stat).irq_tlb_count++; | ||
345 | } | 346 | } |
346 | 347 | ||
347 | void native_flush_tlb_others(const cpumask_t *cpumaskp, struct mm_struct *mm, | 348 | void native_flush_tlb_others(const cpumask_t *cpumaskp, struct mm_struct *mm, |
@@ -640,6 +641,7 @@ static void native_smp_send_stop(void) | |||
640 | fastcall void smp_reschedule_interrupt(struct pt_regs *regs) | 641 | fastcall void smp_reschedule_interrupt(struct pt_regs *regs) |
641 | { | 642 | { |
642 | ack_APIC_irq(); | 643 | ack_APIC_irq(); |
644 | __get_cpu_var(irq_stat).irq_resched_count++; | ||
643 | } | 645 | } |
644 | 646 | ||
645 | fastcall void smp_call_function_interrupt(struct pt_regs *regs) | 647 | fastcall void smp_call_function_interrupt(struct pt_regs *regs) |
@@ -660,6 +662,7 @@ fastcall void smp_call_function_interrupt(struct pt_regs *regs) | |||
660 | */ | 662 | */ |
661 | irq_enter(); | 663 | irq_enter(); |
662 | (*func)(info); | 664 | (*func)(info); |
665 | __get_cpu_var(irq_stat).irq_call_count++; | ||
663 | irq_exit(); | 666 | irq_exit(); |
664 | 667 | ||
665 | if (wait) { | 668 | if (wait) { |
@@ -705,3 +708,10 @@ struct smp_ops smp_ops = { | |||
705 | .smp_send_reschedule = native_smp_send_reschedule, | 708 | .smp_send_reschedule = native_smp_send_reschedule, |
706 | .smp_call_function_mask = native_smp_call_function_mask, | 709 | .smp_call_function_mask = native_smp_call_function_mask, |
707 | }; | 710 | }; |
711 | |||
712 | int smp_call_function_mask(cpumask_t mask, void (*func) (void *info), | ||
713 | void *info, int wait) | ||
714 | { | ||
715 | return smp_ops.smp_call_function_mask(mask, func, info, wait); | ||
716 | } | ||
717 | EXPORT_SYMBOL(smp_call_function_mask); | ||
diff --git a/arch/x86/kernel/smp_64.c b/arch/x86/kernel/smp_64.c index df4a82812adb..5c2964727d19 100644 --- a/arch/x86/kernel/smp_64.c +++ b/arch/x86/kernel/smp_64.c | |||
@@ -163,6 +163,7 @@ asmlinkage void smp_invalidate_interrupt(struct pt_regs *regs) | |||
163 | out: | 163 | out: |
164 | ack_APIC_irq(); | 164 | ack_APIC_irq(); |
165 | cpu_clear(cpu, f->flush_cpumask); | 165 | cpu_clear(cpu, f->flush_cpumask); |
166 | add_pda(irq_tlb_count, 1); | ||
166 | } | 167 | } |
167 | 168 | ||
168 | static void flush_tlb_others(cpumask_t cpumask, struct mm_struct *mm, | 169 | static void flush_tlb_others(cpumask_t cpumask, struct mm_struct *mm, |
@@ -493,6 +494,7 @@ void smp_send_stop(void) | |||
493 | asmlinkage void smp_reschedule_interrupt(void) | 494 | asmlinkage void smp_reschedule_interrupt(void) |
494 | { | 495 | { |
495 | ack_APIC_irq(); | 496 | ack_APIC_irq(); |
497 | add_pda(irq_resched_count, 1); | ||
496 | } | 498 | } |
497 | 499 | ||
498 | asmlinkage void smp_call_function_interrupt(void) | 500 | asmlinkage void smp_call_function_interrupt(void) |
@@ -514,6 +516,7 @@ asmlinkage void smp_call_function_interrupt(void) | |||
514 | exit_idle(); | 516 | exit_idle(); |
515 | irq_enter(); | 517 | irq_enter(); |
516 | (*func)(info); | 518 | (*func)(info); |
519 | add_pda(irq_call_count, 1); | ||
517 | irq_exit(); | 520 | irq_exit(); |
518 | if (wait) { | 521 | if (wait) { |
519 | mb(); | 522 | mb(); |
diff --git a/arch/x86/kernel/smpboot_32.c b/arch/x86/kernel/smpboot_32.c index 31fc08bd15ef..be3faac04719 100644 --- a/arch/x86/kernel/smpboot_32.c +++ b/arch/x86/kernel/smpboot_32.c | |||
@@ -102,8 +102,8 @@ u8 apicid_2_node[MAX_APICID]; | |||
102 | * Trampoline 80x86 program as an array. | 102 | * Trampoline 80x86 program as an array. |
103 | */ | 103 | */ |
104 | 104 | ||
105 | extern unsigned char trampoline_data []; | 105 | extern const unsigned char trampoline_data []; |
106 | extern unsigned char trampoline_end []; | 106 | extern const unsigned char trampoline_end []; |
107 | static unsigned char *trampoline_base; | 107 | static unsigned char *trampoline_base; |
108 | static int trampoline_exec; | 108 | static int trampoline_exec; |
109 | 109 | ||
@@ -118,7 +118,7 @@ DEFINE_PER_CPU(int, cpu_state) = { 0 }; | |||
118 | * has made sure it's suitably aligned. | 118 | * has made sure it's suitably aligned. |
119 | */ | 119 | */ |
120 | 120 | ||
121 | static unsigned long __devinit setup_trampoline(void) | 121 | static unsigned long __cpuinit setup_trampoline(void) |
122 | { | 122 | { |
123 | memcpy(trampoline_base, trampoline_data, trampoline_end - trampoline_data); | 123 | memcpy(trampoline_base, trampoline_data, trampoline_end - trampoline_data); |
124 | return virt_to_phys(trampoline_base); | 124 | return virt_to_phys(trampoline_base); |
@@ -1021,6 +1021,12 @@ static void __init smp_boot_cpus(unsigned int max_cpus) | |||
1021 | if (!max_cpus) { | 1021 | if (!max_cpus) { |
1022 | smp_found_config = 0; | 1022 | smp_found_config = 0; |
1023 | printk(KERN_INFO "SMP mode deactivated, forcing use of dummy APIC emulation.\n"); | 1023 | printk(KERN_INFO "SMP mode deactivated, forcing use of dummy APIC emulation.\n"); |
1024 | |||
1025 | if (nmi_watchdog == NMI_LOCAL_APIC) { | ||
1026 | printk(KERN_INFO "activating minimal APIC for NMI watchdog use.\n"); | ||
1027 | connect_bsp_APIC(); | ||
1028 | setup_local_APIC(); | ||
1029 | } | ||
1024 | smpboot_clear_io_apic_irqs(); | 1030 | smpboot_clear_io_apic_irqs(); |
1025 | phys_cpu_present_map = physid_mask_of_physid(0); | 1031 | phys_cpu_present_map = physid_mask_of_physid(0); |
1026 | cpu_set(0, per_cpu(cpu_sibling_map, 0)); | 1032 | cpu_set(0, per_cpu(cpu_sibling_map, 0)); |
diff --git a/arch/x86/kernel/smpboot_64.c b/arch/x86/kernel/smpboot_64.c index 0faa0a0af272..e351ac4ab5b1 100644 --- a/arch/x86/kernel/smpboot_64.c +++ b/arch/x86/kernel/smpboot_64.c | |||
@@ -102,8 +102,8 @@ EXPORT_PER_CPU_SYMBOL(cpu_core_map); | |||
102 | * Trampoline 80x86 program as an array. | 102 | * Trampoline 80x86 program as an array. |
103 | */ | 103 | */ |
104 | 104 | ||
105 | extern unsigned char trampoline_data[]; | 105 | extern const unsigned char trampoline_data[]; |
106 | extern unsigned char trampoline_end[]; | 106 | extern const unsigned char trampoline_end[]; |
107 | 107 | ||
108 | /* State of each CPU */ | 108 | /* State of each CPU */ |
109 | DEFINE_PER_CPU(int, cpu_state) = { 0 }; | 109 | DEFINE_PER_CPU(int, cpu_state) = { 0 }; |
@@ -695,7 +695,6 @@ do_rest: | |||
695 | cpu_clear(cpu, cpu_present_map); | 695 | cpu_clear(cpu, cpu_present_map); |
696 | cpu_clear(cpu, cpu_possible_map); | 696 | cpu_clear(cpu, cpu_possible_map); |
697 | x86_cpu_to_apicid[cpu] = BAD_APICID; | 697 | x86_cpu_to_apicid[cpu] = BAD_APICID; |
698 | x86_cpu_to_log_apicid[cpu] = BAD_APICID; | ||
699 | return -EIO; | 698 | return -EIO; |
700 | } | 699 | } |
701 | 700 | ||
diff --git a/arch/x86/kernel/stacktrace.c b/arch/x86/kernel/stacktrace.c index 413e527cdeb9..6fa6cf036c70 100644 --- a/arch/x86/kernel/stacktrace.c +++ b/arch/x86/kernel/stacktrace.c | |||
@@ -33,7 +33,7 @@ static void save_stack_address(void *data, unsigned long addr) | |||
33 | trace->entries[trace->nr_entries++] = addr; | 33 | trace->entries[trace->nr_entries++] = addr; |
34 | } | 34 | } |
35 | 35 | ||
36 | static struct stacktrace_ops save_stack_ops = { | 36 | static const struct stacktrace_ops save_stack_ops = { |
37 | .warning = save_stack_warning, | 37 | .warning = save_stack_warning, |
38 | .warning_symbol = save_stack_warning_symbol, | 38 | .warning_symbol = save_stack_warning_symbol, |
39 | .stack = save_stack_stack, | 39 | .stack = save_stack_stack, |
diff --git a/arch/x86/kernel/tce_64.c b/arch/x86/kernel/tce_64.c index e3f2569b2c44..9e540fee7009 100644 --- a/arch/x86/kernel/tce_64.c +++ b/arch/x86/kernel/tce_64.c | |||
@@ -40,9 +40,9 @@ static inline void flush_tce(void* tceaddr) | |||
40 | { | 40 | { |
41 | /* a single tce can't cross a cache line */ | 41 | /* a single tce can't cross a cache line */ |
42 | if (cpu_has_clflush) | 42 | if (cpu_has_clflush) |
43 | asm volatile("clflush (%0)" :: "r" (tceaddr)); | 43 | clflush(tceaddr); |
44 | else | 44 | else |
45 | asm volatile("wbinvd":::"memory"); | 45 | wbinvd(); |
46 | } | 46 | } |
47 | 47 | ||
48 | void tce_build(struct iommu_table *tbl, unsigned long index, | 48 | void tce_build(struct iommu_table *tbl, unsigned long index, |
diff --git a/arch/x86/kernel/topology.c b/arch/x86/kernel/topology.c index c25f23eb397c..8caa0b777466 100644 --- a/arch/x86/kernel/topology.c +++ b/arch/x86/kernel/topology.c | |||
@@ -44,15 +44,15 @@ int arch_register_cpu(int num) | |||
44 | * Also certain PCI quirks require not to enable hotplug control | 44 | * Also certain PCI quirks require not to enable hotplug control |
45 | * for all CPU's. | 45 | * for all CPU's. |
46 | */ | 46 | */ |
47 | if (num && enable_cpu_hotplug) | 47 | #ifdef CONFIG_HOTPLUG_CPU |
48 | if (num) | ||
48 | cpu_devices[num].cpu.hotpluggable = 1; | 49 | cpu_devices[num].cpu.hotpluggable = 1; |
50 | #endif | ||
49 | 51 | ||
50 | return register_cpu(&cpu_devices[num].cpu, num); | 52 | return register_cpu(&cpu_devices[num].cpu, num); |
51 | } | 53 | } |
52 | 54 | ||
53 | #ifdef CONFIG_HOTPLUG_CPU | 55 | #ifdef CONFIG_HOTPLUG_CPU |
54 | int enable_cpu_hotplug = 1; | ||
55 | |||
56 | void arch_unregister_cpu(int num) { | 56 | void arch_unregister_cpu(int num) { |
57 | return unregister_cpu(&cpu_devices[num].cpu); | 57 | return unregister_cpu(&cpu_devices[num].cpu); |
58 | } | 58 | } |
diff --git a/arch/x86/kernel/trampoline_32.S b/arch/x86/kernel/trampoline_32.S index f62815f8d06a..9bcc1c6aca3d 100644 --- a/arch/x86/kernel/trampoline_32.S +++ b/arch/x86/kernel/trampoline_32.S | |||
@@ -36,11 +36,11 @@ | |||
36 | #include <asm/segment.h> | 36 | #include <asm/segment.h> |
37 | #include <asm/page.h> | 37 | #include <asm/page.h> |
38 | 38 | ||
39 | .data | ||
40 | |||
41 | /* We can free up trampoline after bootup if cpu hotplug is not supported. */ | 39 | /* We can free up trampoline after bootup if cpu hotplug is not supported. */ |
42 | #ifndef CONFIG_HOTPLUG_CPU | 40 | #ifndef CONFIG_HOTPLUG_CPU |
43 | .section ".init.data","aw",@progbits | 41 | .section ".init.data","aw",@progbits |
42 | #else | ||
43 | .section .rodata,"a",@progbits | ||
44 | #endif | 44 | #endif |
45 | 45 | ||
46 | .code16 | 46 | .code16 |
diff --git a/arch/x86/kernel/trampoline_64.S b/arch/x86/kernel/trampoline_64.S index 607983b0d27b..e30b67c6a9f5 100644 --- a/arch/x86/kernel/trampoline_64.S +++ b/arch/x86/kernel/trampoline_64.S | |||
@@ -33,7 +33,12 @@ | |||
33 | #include <asm/msr.h> | 33 | #include <asm/msr.h> |
34 | #include <asm/segment.h> | 34 | #include <asm/segment.h> |
35 | 35 | ||
36 | .data | 36 | /* We can free up trampoline after bootup if cpu hotplug is not supported. */ |
37 | #ifndef CONFIG_HOTPLUG_CPU | ||
38 | .section .init.data, "aw", @progbits | ||
39 | #else | ||
40 | .section .rodata, "a", @progbits | ||
41 | #endif | ||
37 | 42 | ||
38 | .code16 | 43 | .code16 |
39 | 44 | ||
diff --git a/arch/x86/kernel/traps_32.c b/arch/x86/kernel/traps_32.c index 05c27ecaf2a7..b132d3957dfc 100644 --- a/arch/x86/kernel/traps_32.c +++ b/arch/x86/kernel/traps_32.c | |||
@@ -112,7 +112,7 @@ struct stack_frame { | |||
112 | 112 | ||
113 | static inline unsigned long print_context_stack(struct thread_info *tinfo, | 113 | static inline unsigned long print_context_stack(struct thread_info *tinfo, |
114 | unsigned long *stack, unsigned long ebp, | 114 | unsigned long *stack, unsigned long ebp, |
115 | struct stacktrace_ops *ops, void *data) | 115 | const struct stacktrace_ops *ops, void *data) |
116 | { | 116 | { |
117 | #ifdef CONFIG_FRAME_POINTER | 117 | #ifdef CONFIG_FRAME_POINTER |
118 | struct stack_frame *frame = (struct stack_frame *)ebp; | 118 | struct stack_frame *frame = (struct stack_frame *)ebp; |
@@ -149,7 +149,7 @@ static inline unsigned long print_context_stack(struct thread_info *tinfo, | |||
149 | 149 | ||
150 | void dump_trace(struct task_struct *task, struct pt_regs *regs, | 150 | void dump_trace(struct task_struct *task, struct pt_regs *regs, |
151 | unsigned long *stack, | 151 | unsigned long *stack, |
152 | struct stacktrace_ops *ops, void *data) | 152 | const struct stacktrace_ops *ops, void *data) |
153 | { | 153 | { |
154 | unsigned long ebp = 0; | 154 | unsigned long ebp = 0; |
155 | 155 | ||
@@ -221,7 +221,7 @@ static void print_trace_address(void *data, unsigned long addr) | |||
221 | touch_nmi_watchdog(); | 221 | touch_nmi_watchdog(); |
222 | } | 222 | } |
223 | 223 | ||
224 | static struct stacktrace_ops print_trace_ops = { | 224 | static const struct stacktrace_ops print_trace_ops = { |
225 | .warning = print_trace_warning, | 225 | .warning = print_trace_warning, |
226 | .warning_symbol = print_trace_warning_symbol, | 226 | .warning_symbol = print_trace_warning_symbol, |
227 | .stack = print_trace_stack, | 227 | .stack = print_trace_stack, |
@@ -398,31 +398,24 @@ void die(const char * str, struct pt_regs * regs, long err) | |||
398 | local_save_flags(flags); | 398 | local_save_flags(flags); |
399 | 399 | ||
400 | if (++die.lock_owner_depth < 3) { | 400 | if (++die.lock_owner_depth < 3) { |
401 | int nl = 0; | ||
402 | unsigned long esp; | 401 | unsigned long esp; |
403 | unsigned short ss; | 402 | unsigned short ss; |
404 | 403 | ||
405 | report_bug(regs->eip, regs); | 404 | report_bug(regs->eip, regs); |
406 | 405 | ||
407 | printk(KERN_EMERG "%s: %04lx [#%d]\n", str, err & 0xffff, ++die_counter); | 406 | printk(KERN_EMERG "%s: %04lx [#%d] ", str, err & 0xffff, |
407 | ++die_counter); | ||
408 | #ifdef CONFIG_PREEMPT | 408 | #ifdef CONFIG_PREEMPT |
409 | printk(KERN_EMERG "PREEMPT "); | 409 | printk("PREEMPT "); |
410 | nl = 1; | ||
411 | #endif | 410 | #endif |
412 | #ifdef CONFIG_SMP | 411 | #ifdef CONFIG_SMP |
413 | if (!nl) | ||
414 | printk(KERN_EMERG); | ||
415 | printk("SMP "); | 412 | printk("SMP "); |
416 | nl = 1; | ||
417 | #endif | 413 | #endif |
418 | #ifdef CONFIG_DEBUG_PAGEALLOC | 414 | #ifdef CONFIG_DEBUG_PAGEALLOC |
419 | if (!nl) | ||
420 | printk(KERN_EMERG); | ||
421 | printk("DEBUG_PAGEALLOC"); | 415 | printk("DEBUG_PAGEALLOC"); |
422 | nl = 1; | ||
423 | #endif | 416 | #endif |
424 | if (nl) | 417 | printk("\n"); |
425 | printk("\n"); | 418 | |
426 | if (notify_die(DIE_OOPS, str, regs, err, | 419 | if (notify_die(DIE_OOPS, str, regs, err, |
427 | current->thread.trap_no, SIGSEGV) != | 420 | current->thread.trap_no, SIGSEGV) != |
428 | NOTIFY_STOP) { | 421 | NOTIFY_STOP) { |
@@ -1112,20 +1105,6 @@ asmlinkage void math_emulate(long arg) | |||
1112 | 1105 | ||
1113 | #endif /* CONFIG_MATH_EMULATION */ | 1106 | #endif /* CONFIG_MATH_EMULATION */ |
1114 | 1107 | ||
1115 | #ifdef CONFIG_X86_F00F_BUG | ||
1116 | void __init trap_init_f00f_bug(void) | ||
1117 | { | ||
1118 | __set_fixmap(FIX_F00F_IDT, __pa(&idt_table), PAGE_KERNEL_RO); | ||
1119 | |||
1120 | /* | ||
1121 | * Update the IDT descriptor and reload the IDT so that | ||
1122 | * it uses the read-only mapped virtual address. | ||
1123 | */ | ||
1124 | idt_descr.address = fix_to_virt(FIX_F00F_IDT); | ||
1125 | load_idt(&idt_descr); | ||
1126 | } | ||
1127 | #endif | ||
1128 | |||
1129 | /* | 1108 | /* |
1130 | * This needs to use 'idt_table' rather than 'idt', and | 1109 | * This needs to use 'idt_table' rather than 'idt', and |
1131 | * thus use the _nonmapped_ version of the IDT, as the | 1110 | * thus use the _nonmapped_ version of the IDT, as the |
diff --git a/arch/x86/kernel/traps_64.c b/arch/x86/kernel/traps_64.c index bc7116acf8ff..b4a9b3db1994 100644 --- a/arch/x86/kernel/traps_64.c +++ b/arch/x86/kernel/traps_64.c | |||
@@ -215,7 +215,7 @@ static inline int valid_stack_ptr(struct thread_info *tinfo, void *p) | |||
215 | 215 | ||
216 | void dump_trace(struct task_struct *tsk, struct pt_regs *regs, | 216 | void dump_trace(struct task_struct *tsk, struct pt_regs *regs, |
217 | unsigned long *stack, | 217 | unsigned long *stack, |
218 | struct stacktrace_ops *ops, void *data) | 218 | const struct stacktrace_ops *ops, void *data) |
219 | { | 219 | { |
220 | const unsigned cpu = get_cpu(); | 220 | const unsigned cpu = get_cpu(); |
221 | unsigned long *irqstack_end = (unsigned long*)cpu_pda(cpu)->irqstackptr; | 221 | unsigned long *irqstack_end = (unsigned long*)cpu_pda(cpu)->irqstackptr; |
@@ -336,7 +336,7 @@ static void print_trace_address(void *data, unsigned long addr) | |||
336 | printk_address(addr); | 336 | printk_address(addr); |
337 | } | 337 | } |
338 | 338 | ||
339 | static struct stacktrace_ops print_trace_ops = { | 339 | static const struct stacktrace_ops print_trace_ops = { |
340 | .warning = print_trace_warning, | 340 | .warning = print_trace_warning, |
341 | .warning_symbol = print_trace_warning_symbol, | 341 | .warning_symbol = print_trace_warning_symbol, |
342 | .stack = print_trace_stack, | 342 | .stack = print_trace_stack, |
diff --git a/arch/x86/kernel/tsc_32.c b/arch/x86/kernel/tsc_32.c index b85ad754f70e..e87a3939ed40 100644 --- a/arch/x86/kernel/tsc_32.c +++ b/arch/x86/kernel/tsc_32.c | |||
@@ -349,10 +349,10 @@ __cpuinit int unsynchronized_tsc(void) | |||
349 | 349 | ||
350 | static void __init check_geode_tsc_reliable(void) | 350 | static void __init check_geode_tsc_reliable(void) |
351 | { | 351 | { |
352 | unsigned long val; | 352 | unsigned long res_low, res_high; |
353 | 353 | ||
354 | rdmsrl(MSR_GEODE_BUSCONT_CONF0, val); | 354 | rdmsr_safe(MSR_GEODE_BUSCONT_CONF0, &res_low, &res_high); |
355 | if ((val & RTSC_SUSP)) | 355 | if (res_low & RTSC_SUSP) |
356 | clocksource_tsc.flags &= ~CLOCK_SOURCE_MUST_VERIFY; | 356 | clocksource_tsc.flags &= ~CLOCK_SOURCE_MUST_VERIFY; |
357 | } | 357 | } |
358 | #else | 358 | #else |
diff --git a/arch/x86/kernel/vsyscall_64.c b/arch/x86/kernel/vsyscall_64.c index 93847d848157..8a67e282cb5e 100644 --- a/arch/x86/kernel/vsyscall_64.c +++ b/arch/x86/kernel/vsyscall_64.c | |||
@@ -78,7 +78,6 @@ void update_vsyscall(struct timespec *wall_time, struct clocksource *clock) | |||
78 | vsyscall_gtod_data.wall_time_sec = wall_time->tv_sec; | 78 | vsyscall_gtod_data.wall_time_sec = wall_time->tv_sec; |
79 | vsyscall_gtod_data.wall_time_nsec = wall_time->tv_nsec; | 79 | vsyscall_gtod_data.wall_time_nsec = wall_time->tv_nsec; |
80 | vsyscall_gtod_data.sys_tz = sys_tz; | 80 | vsyscall_gtod_data.sys_tz = sys_tz; |
81 | vsyscall_gtod_data.wall_time_nsec = wall_time->tv_nsec; | ||
82 | vsyscall_gtod_data.wall_to_monotonic = wall_to_monotonic; | 81 | vsyscall_gtod_data.wall_to_monotonic = wall_to_monotonic; |
83 | write_sequnlock_irqrestore(&vsyscall_gtod_data.lock, flags); | 82 | write_sequnlock_irqrestore(&vsyscall_gtod_data.lock, flags); |
84 | } | 83 | } |
@@ -289,7 +288,7 @@ static void __cpuinit vsyscall_set_cpu(int cpu) | |||
289 | unsigned long *d; | 288 | unsigned long *d; |
290 | unsigned long node = 0; | 289 | unsigned long node = 0; |
291 | #ifdef CONFIG_NUMA | 290 | #ifdef CONFIG_NUMA |
292 | node = cpu_to_node[cpu]; | 291 | node = cpu_to_node(cpu); |
293 | #endif | 292 | #endif |
294 | if (cpu_has(&cpu_data[cpu], X86_FEATURE_RDTSCP)) | 293 | if (cpu_has(&cpu_data[cpu], X86_FEATURE_RDTSCP)) |
295 | write_rdtscp_aux((node << 12) | cpu); | 294 | write_rdtscp_aux((node << 12) | cpu); |