diff options
Diffstat (limited to 'arch/x86/kernel')
-rw-r--r-- | arch/x86/kernel/Makefile | 2 | ||||
-rw-r--r-- | arch/x86/kernel/apic/apic_flat_64.c | 18 | ||||
-rw-r--r-- | arch/x86/kernel/apic/io_apic.c | 15 | ||||
-rw-r--r-- | arch/x86/kernel/cpu/cpu.h | 20 | ||||
-rw-r--r-- | arch/x86/kernel/e820.c | 10 | ||||
-rw-r--r-- | arch/x86/kernel/irq.c | 23 | ||||
-rw-r--r-- | arch/x86/kernel/vsmp_64.c | 12 |
7 files changed, 43 insertions, 57 deletions
diff --git a/arch/x86/kernel/Makefile b/arch/x86/kernel/Makefile index 339ce35648e..6e9c1f320ac 100644 --- a/arch/x86/kernel/Makefile +++ b/arch/x86/kernel/Makefile | |||
@@ -70,7 +70,6 @@ obj-$(CONFIG_FUNCTION_GRAPH_TRACER) += ftrace.o | |||
70 | obj-$(CONFIG_KEXEC) += machine_kexec_$(BITS).o | 70 | obj-$(CONFIG_KEXEC) += machine_kexec_$(BITS).o |
71 | obj-$(CONFIG_KEXEC) += relocate_kernel_$(BITS).o crash.o | 71 | obj-$(CONFIG_KEXEC) += relocate_kernel_$(BITS).o crash.o |
72 | obj-$(CONFIG_CRASH_DUMP) += crash_dump_$(BITS).o | 72 | obj-$(CONFIG_CRASH_DUMP) += crash_dump_$(BITS).o |
73 | obj-$(CONFIG_X86_VSMP) += vsmp_64.o | ||
74 | obj-$(CONFIG_KPROBES) += kprobes.o | 73 | obj-$(CONFIG_KPROBES) += kprobes.o |
75 | obj-$(CONFIG_MODULES) += module_$(BITS).o | 74 | obj-$(CONFIG_MODULES) += module_$(BITS).o |
76 | obj-$(CONFIG_EFI) += efi.o efi_$(BITS).o efi_stub_$(BITS).o | 75 | obj-$(CONFIG_EFI) += efi.o efi_$(BITS).o efi_stub_$(BITS).o |
@@ -120,4 +119,5 @@ ifeq ($(CONFIG_X86_64),y) | |||
120 | obj-$(CONFIG_AMD_IOMMU) += amd_iommu_init.o amd_iommu.o | 119 | obj-$(CONFIG_AMD_IOMMU) += amd_iommu_init.o amd_iommu.o |
121 | 120 | ||
122 | obj-$(CONFIG_PCI_MMCONFIG) += mmconf-fam10h_64.o | 121 | obj-$(CONFIG_PCI_MMCONFIG) += mmconf-fam10h_64.o |
122 | obj-y += vsmp_64.o | ||
123 | endif | 123 | endif |
diff --git a/arch/x86/kernel/apic/apic_flat_64.c b/arch/x86/kernel/apic/apic_flat_64.c index f933822dba1..0014714ea97 100644 --- a/arch/x86/kernel/apic/apic_flat_64.c +++ b/arch/x86/kernel/apic/apic_flat_64.c | |||
@@ -159,20 +159,6 @@ static int flat_apic_id_registered(void) | |||
159 | return physid_isset(read_xapic_id(), phys_cpu_present_map); | 159 | return physid_isset(read_xapic_id(), phys_cpu_present_map); |
160 | } | 160 | } |
161 | 161 | ||
162 | static unsigned int flat_cpu_mask_to_apicid(const struct cpumask *cpumask) | ||
163 | { | ||
164 | return cpumask_bits(cpumask)[0] & APIC_ALL_CPUS; | ||
165 | } | ||
166 | |||
167 | static unsigned int flat_cpu_mask_to_apicid_and(const struct cpumask *cpumask, | ||
168 | const struct cpumask *andmask) | ||
169 | { | ||
170 | unsigned long mask1 = cpumask_bits(cpumask)[0] & APIC_ALL_CPUS; | ||
171 | unsigned long mask2 = cpumask_bits(andmask)[0] & APIC_ALL_CPUS; | ||
172 | |||
173 | return mask1 & mask2; | ||
174 | } | ||
175 | |||
176 | static int flat_phys_pkg_id(int initial_apic_id, int index_msb) | 162 | static int flat_phys_pkg_id(int initial_apic_id, int index_msb) |
177 | { | 163 | { |
178 | return hard_smp_processor_id() >> index_msb; | 164 | return hard_smp_processor_id() >> index_msb; |
@@ -213,8 +199,8 @@ struct apic apic_flat = { | |||
213 | .set_apic_id = set_apic_id, | 199 | .set_apic_id = set_apic_id, |
214 | .apic_id_mask = 0xFFu << 24, | 200 | .apic_id_mask = 0xFFu << 24, |
215 | 201 | ||
216 | .cpu_mask_to_apicid = flat_cpu_mask_to_apicid, | 202 | .cpu_mask_to_apicid = default_cpu_mask_to_apicid, |
217 | .cpu_mask_to_apicid_and = flat_cpu_mask_to_apicid_and, | 203 | .cpu_mask_to_apicid_and = default_cpu_mask_to_apicid_and, |
218 | 204 | ||
219 | .send_IPI_mask = flat_send_IPI_mask, | 205 | .send_IPI_mask = flat_send_IPI_mask, |
220 | .send_IPI_mask_allbutself = flat_send_IPI_mask_allbutself, | 206 | .send_IPI_mask_allbutself = flat_send_IPI_mask_allbutself, |
diff --git a/arch/x86/kernel/apic/io_apic.c b/arch/x86/kernel/apic/io_apic.c index 86827d85488..da99ffcdfde 100644 --- a/arch/x86/kernel/apic/io_apic.c +++ b/arch/x86/kernel/apic/io_apic.c | |||
@@ -592,10 +592,12 @@ set_desc_affinity(struct irq_desc *desc, const struct cpumask *mask) | |||
592 | if (assign_irq_vector(irq, cfg, mask)) | 592 | if (assign_irq_vector(irq, cfg, mask)) |
593 | return BAD_APICID; | 593 | return BAD_APICID; |
594 | 594 | ||
595 | cpumask_and(desc->affinity, cfg->domain, mask); | 595 | /* check that before desc->addinity get updated */ |
596 | set_extra_move_desc(desc, mask); | 596 | set_extra_move_desc(desc, mask); |
597 | 597 | ||
598 | return apic->cpu_mask_to_apicid_and(desc->affinity, cpu_online_mask); | 598 | cpumask_copy(desc->affinity, mask); |
599 | |||
600 | return apic->cpu_mask_to_apicid_and(desc->affinity, cfg->domain); | ||
599 | } | 601 | } |
600 | 602 | ||
601 | static void | 603 | static void |
@@ -1428,7 +1430,6 @@ void __setup_vector_irq(int cpu) | |||
1428 | 1430 | ||
1429 | static struct irq_chip ioapic_chip; | 1431 | static struct irq_chip ioapic_chip; |
1430 | static struct irq_chip ir_ioapic_chip; | 1432 | static struct irq_chip ir_ioapic_chip; |
1431 | static struct irq_chip msi_ir_chip; | ||
1432 | 1433 | ||
1433 | #define IOAPIC_AUTO -1 | 1434 | #define IOAPIC_AUTO -1 |
1434 | #define IOAPIC_EDGE 0 | 1435 | #define IOAPIC_EDGE 0 |
@@ -2663,20 +2664,20 @@ static struct irq_chip ioapic_chip __read_mostly = { | |||
2663 | .retrigger = ioapic_retrigger_irq, | 2664 | .retrigger = ioapic_retrigger_irq, |
2664 | }; | 2665 | }; |
2665 | 2666 | ||
2666 | #ifdef CONFIG_INTR_REMAP | ||
2667 | static struct irq_chip ir_ioapic_chip __read_mostly = { | 2667 | static struct irq_chip ir_ioapic_chip __read_mostly = { |
2668 | .name = "IR-IO-APIC", | 2668 | .name = "IR-IO-APIC", |
2669 | .startup = startup_ioapic_irq, | 2669 | .startup = startup_ioapic_irq, |
2670 | .mask = mask_IO_APIC_irq, | 2670 | .mask = mask_IO_APIC_irq, |
2671 | .unmask = unmask_IO_APIC_irq, | 2671 | .unmask = unmask_IO_APIC_irq, |
2672 | #ifdef CONFIG_INTR_REMAP | ||
2672 | .ack = ack_x2apic_edge, | 2673 | .ack = ack_x2apic_edge, |
2673 | .eoi = ack_x2apic_level, | 2674 | .eoi = ack_x2apic_level, |
2674 | #ifdef CONFIG_SMP | 2675 | #ifdef CONFIG_SMP |
2675 | .set_affinity = set_ir_ioapic_affinity_irq, | 2676 | .set_affinity = set_ir_ioapic_affinity_irq, |
2676 | #endif | 2677 | #endif |
2678 | #endif | ||
2677 | .retrigger = ioapic_retrigger_irq, | 2679 | .retrigger = ioapic_retrigger_irq, |
2678 | }; | 2680 | }; |
2679 | #endif | ||
2680 | 2681 | ||
2681 | static inline void init_IO_APIC_traps(void) | 2682 | static inline void init_IO_APIC_traps(void) |
2682 | { | 2683 | { |
@@ -3391,18 +3392,18 @@ static struct irq_chip msi_chip = { | |||
3391 | .retrigger = ioapic_retrigger_irq, | 3392 | .retrigger = ioapic_retrigger_irq, |
3392 | }; | 3393 | }; |
3393 | 3394 | ||
3394 | #ifdef CONFIG_INTR_REMAP | ||
3395 | static struct irq_chip msi_ir_chip = { | 3395 | static struct irq_chip msi_ir_chip = { |
3396 | .name = "IR-PCI-MSI", | 3396 | .name = "IR-PCI-MSI", |
3397 | .unmask = unmask_msi_irq, | 3397 | .unmask = unmask_msi_irq, |
3398 | .mask = mask_msi_irq, | 3398 | .mask = mask_msi_irq, |
3399 | #ifdef CONFIG_INTR_REMAP | ||
3399 | .ack = ack_x2apic_edge, | 3400 | .ack = ack_x2apic_edge, |
3400 | #ifdef CONFIG_SMP | 3401 | #ifdef CONFIG_SMP |
3401 | .set_affinity = ir_set_msi_irq_affinity, | 3402 | .set_affinity = ir_set_msi_irq_affinity, |
3402 | #endif | 3403 | #endif |
3404 | #endif | ||
3403 | .retrigger = ioapic_retrigger_irq, | 3405 | .retrigger = ioapic_retrigger_irq, |
3404 | }; | 3406 | }; |
3405 | #endif | ||
3406 | 3407 | ||
3407 | /* | 3408 | /* |
3408 | * Map the PCI dev to the corresponding remapping hardware unit | 3409 | * Map the PCI dev to the corresponding remapping hardware unit |
diff --git a/arch/x86/kernel/cpu/cpu.h b/arch/x86/kernel/cpu/cpu.h index 9469ecb5aeb..6de9a908e40 100644 --- a/arch/x86/kernel/cpu/cpu.h +++ b/arch/x86/kernel/cpu/cpu.h | |||
@@ -3,25 +3,25 @@ | |||
3 | #define ARCH_X86_CPU_H | 3 | #define ARCH_X86_CPU_H |
4 | 4 | ||
5 | struct cpu_model_info { | 5 | struct cpu_model_info { |
6 | int vendor; | 6 | int vendor; |
7 | int family; | 7 | int family; |
8 | const char *model_names[16]; | 8 | const char *model_names[16]; |
9 | }; | 9 | }; |
10 | 10 | ||
11 | /* attempt to consolidate cpu attributes */ | 11 | /* attempt to consolidate cpu attributes */ |
12 | struct cpu_dev { | 12 | struct cpu_dev { |
13 | const char * c_vendor; | 13 | const char *c_vendor; |
14 | 14 | ||
15 | /* some have two possibilities for cpuid string */ | 15 | /* some have two possibilities for cpuid string */ |
16 | const char * c_ident[2]; | 16 | const char *c_ident[2]; |
17 | 17 | ||
18 | struct cpu_model_info c_models[4]; | 18 | struct cpu_model_info c_models[4]; |
19 | 19 | ||
20 | void (*c_early_init)(struct cpuinfo_x86 *c); | 20 | void (*c_early_init)(struct cpuinfo_x86 *); |
21 | void (*c_init)(struct cpuinfo_x86 * c); | 21 | void (*c_init)(struct cpuinfo_x86 *); |
22 | void (*c_identify)(struct cpuinfo_x86 * c); | 22 | void (*c_identify)(struct cpuinfo_x86 *); |
23 | unsigned int (*c_size_cache)(struct cpuinfo_x86 * c, unsigned int size); | 23 | unsigned int (*c_size_cache)(struct cpuinfo_x86 *, unsigned int); |
24 | int c_x86_vendor; | 24 | int c_x86_vendor; |
25 | }; | 25 | }; |
26 | 26 | ||
27 | #define cpu_dev_register(cpu_devX) \ | 27 | #define cpu_dev_register(cpu_devX) \ |
diff --git a/arch/x86/kernel/e820.c b/arch/x86/kernel/e820.c index fb638d9ce6d..ef2c3563357 100644 --- a/arch/x86/kernel/e820.c +++ b/arch/x86/kernel/e820.c | |||
@@ -233,7 +233,7 @@ void __init e820_print_map(char *who) | |||
233 | */ | 233 | */ |
234 | 234 | ||
235 | int __init sanitize_e820_map(struct e820entry *biosmap, int max_nr_map, | 235 | int __init sanitize_e820_map(struct e820entry *biosmap, int max_nr_map, |
236 | int *pnr_map) | 236 | u32 *pnr_map) |
237 | { | 237 | { |
238 | struct change_member { | 238 | struct change_member { |
239 | struct e820entry *pbios; /* pointer to original bios entry */ | 239 | struct e820entry *pbios; /* pointer to original bios entry */ |
@@ -552,7 +552,7 @@ u64 __init e820_remove_range(u64 start, u64 size, unsigned old_type, | |||
552 | 552 | ||
553 | void __init update_e820(void) | 553 | void __init update_e820(void) |
554 | { | 554 | { |
555 | int nr_map; | 555 | u32 nr_map; |
556 | 556 | ||
557 | nr_map = e820.nr_map; | 557 | nr_map = e820.nr_map; |
558 | if (sanitize_e820_map(e820.map, ARRAY_SIZE(e820.map), &nr_map)) | 558 | if (sanitize_e820_map(e820.map, ARRAY_SIZE(e820.map), &nr_map)) |
@@ -563,7 +563,7 @@ void __init update_e820(void) | |||
563 | } | 563 | } |
564 | static void __init update_e820_saved(void) | 564 | static void __init update_e820_saved(void) |
565 | { | 565 | { |
566 | int nr_map; | 566 | u32 nr_map; |
567 | 567 | ||
568 | nr_map = e820_saved.nr_map; | 568 | nr_map = e820_saved.nr_map; |
569 | if (sanitize_e820_map(e820_saved.map, ARRAY_SIZE(e820_saved.map), &nr_map)) | 569 | if (sanitize_e820_map(e820_saved.map, ARRAY_SIZE(e820_saved.map), &nr_map)) |
@@ -1303,7 +1303,7 @@ early_param("memmap", parse_memmap_opt); | |||
1303 | void __init finish_e820_parsing(void) | 1303 | void __init finish_e820_parsing(void) |
1304 | { | 1304 | { |
1305 | if (userdef) { | 1305 | if (userdef) { |
1306 | int nr = e820.nr_map; | 1306 | u32 nr = e820.nr_map; |
1307 | 1307 | ||
1308 | if (sanitize_e820_map(e820.map, ARRAY_SIZE(e820.map), &nr) < 0) | 1308 | if (sanitize_e820_map(e820.map, ARRAY_SIZE(e820.map), &nr) < 0) |
1309 | early_panic("Invalid user supplied memory map"); | 1309 | early_panic("Invalid user supplied memory map"); |
@@ -1386,7 +1386,7 @@ void __init e820_reserve_resources_late(void) | |||
1386 | char *__init default_machine_specific_memory_setup(void) | 1386 | char *__init default_machine_specific_memory_setup(void) |
1387 | { | 1387 | { |
1388 | char *who = "BIOS-e820"; | 1388 | char *who = "BIOS-e820"; |
1389 | int new_nr; | 1389 | u32 new_nr; |
1390 | /* | 1390 | /* |
1391 | * Try to copy the BIOS-supplied E820-map. | 1391 | * Try to copy the BIOS-supplied E820-map. |
1392 | * | 1392 | * |
diff --git a/arch/x86/kernel/irq.c b/arch/x86/kernel/irq.c index b8ac3b6cf77..3aaf7b9e3a8 100644 --- a/arch/x86/kernel/irq.c +++ b/arch/x86/kernel/irq.c | |||
@@ -58,6 +58,11 @@ static int show_other_interrupts(struct seq_file *p, int prec) | |||
58 | for_each_online_cpu(j) | 58 | for_each_online_cpu(j) |
59 | seq_printf(p, "%10u ", irq_stats(j)->apic_timer_irqs); | 59 | seq_printf(p, "%10u ", irq_stats(j)->apic_timer_irqs); |
60 | seq_printf(p, " Local timer interrupts\n"); | 60 | seq_printf(p, " Local timer interrupts\n"); |
61 | |||
62 | seq_printf(p, "%*s: ", prec, "SPU"); | ||
63 | for_each_online_cpu(j) | ||
64 | seq_printf(p, "%10u ", irq_stats(j)->irq_spurious_count); | ||
65 | seq_printf(p, " Spurious interrupts\n"); | ||
61 | #endif | 66 | #endif |
62 | if (generic_interrupt_extension) { | 67 | if (generic_interrupt_extension) { |
63 | seq_printf(p, "PLT: "); | 68 | seq_printf(p, "PLT: "); |
@@ -91,12 +96,6 @@ static int show_other_interrupts(struct seq_file *p, int prec) | |||
91 | seq_printf(p, " Threshold APIC interrupts\n"); | 96 | seq_printf(p, " Threshold APIC interrupts\n"); |
92 | # endif | 97 | # endif |
93 | #endif | 98 | #endif |
94 | #ifdef CONFIG_X86_LOCAL_APIC | ||
95 | seq_printf(p, "%*s: ", prec, "SPU"); | ||
96 | for_each_online_cpu(j) | ||
97 | seq_printf(p, "%10u ", irq_stats(j)->irq_spurious_count); | ||
98 | seq_printf(p, " Spurious interrupts\n"); | ||
99 | #endif | ||
100 | seq_printf(p, "%*s: %10u\n", prec, "ERR", atomic_read(&irq_err_count)); | 99 | seq_printf(p, "%*s: %10u\n", prec, "ERR", atomic_read(&irq_err_count)); |
101 | #if defined(CONFIG_X86_IO_APIC) | 100 | #if defined(CONFIG_X86_IO_APIC) |
102 | seq_printf(p, "%*s: %10u\n", prec, "MIS", atomic_read(&irq_mis_count)); | 101 | seq_printf(p, "%*s: %10u\n", prec, "MIS", atomic_read(&irq_mis_count)); |
@@ -133,23 +132,15 @@ int show_interrupts(struct seq_file *p, void *v) | |||
133 | return 0; | 132 | return 0; |
134 | 133 | ||
135 | spin_lock_irqsave(&desc->lock, flags); | 134 | spin_lock_irqsave(&desc->lock, flags); |
136 | #ifndef CONFIG_SMP | ||
137 | any_count = kstat_irqs(i); | ||
138 | #else | ||
139 | for_each_online_cpu(j) | 135 | for_each_online_cpu(j) |
140 | any_count |= kstat_irqs_cpu(i, j); | 136 | any_count |= kstat_irqs_cpu(i, j); |
141 | #endif | ||
142 | action = desc->action; | 137 | action = desc->action; |
143 | if (!action && !any_count) | 138 | if (!action && !any_count) |
144 | goto out; | 139 | goto out; |
145 | 140 | ||
146 | seq_printf(p, "%*d: ", prec, i); | 141 | seq_printf(p, "%*d: ", prec, i); |
147 | #ifndef CONFIG_SMP | ||
148 | seq_printf(p, "%10u ", kstat_irqs(i)); | ||
149 | #else | ||
150 | for_each_online_cpu(j) | 142 | for_each_online_cpu(j) |
151 | seq_printf(p, "%10u ", kstat_irqs_cpu(i, j)); | 143 | seq_printf(p, "%10u ", kstat_irqs_cpu(i, j)); |
152 | #endif | ||
153 | seq_printf(p, " %8s", desc->chip->name); | 144 | seq_printf(p, " %8s", desc->chip->name); |
154 | seq_printf(p, "-%-8s", desc->name); | 145 | seq_printf(p, "-%-8s", desc->name); |
155 | 146 | ||
@@ -174,6 +165,7 @@ u64 arch_irq_stat_cpu(unsigned int cpu) | |||
174 | 165 | ||
175 | #ifdef CONFIG_X86_LOCAL_APIC | 166 | #ifdef CONFIG_X86_LOCAL_APIC |
176 | sum += irq_stats(cpu)->apic_timer_irqs; | 167 | sum += irq_stats(cpu)->apic_timer_irqs; |
168 | sum += irq_stats(cpu)->irq_spurious_count; | ||
177 | #endif | 169 | #endif |
178 | if (generic_interrupt_extension) | 170 | if (generic_interrupt_extension) |
179 | sum += irq_stats(cpu)->generic_irqs; | 171 | sum += irq_stats(cpu)->generic_irqs; |
@@ -188,9 +180,6 @@ u64 arch_irq_stat_cpu(unsigned int cpu) | |||
188 | sum += irq_stats(cpu)->irq_threshold_count; | 180 | sum += irq_stats(cpu)->irq_threshold_count; |
189 | #endif | 181 | #endif |
190 | #endif | 182 | #endif |
191 | #ifdef CONFIG_X86_LOCAL_APIC | ||
192 | sum += irq_stats(cpu)->irq_spurious_count; | ||
193 | #endif | ||
194 | return sum; | 183 | return sum; |
195 | } | 184 | } |
196 | 185 | ||
diff --git a/arch/x86/kernel/vsmp_64.c b/arch/x86/kernel/vsmp_64.c index 74de562812c..a1d804bcd48 100644 --- a/arch/x86/kernel/vsmp_64.c +++ b/arch/x86/kernel/vsmp_64.c | |||
@@ -22,7 +22,7 @@ | |||
22 | #include <asm/paravirt.h> | 22 | #include <asm/paravirt.h> |
23 | #include <asm/setup.h> | 23 | #include <asm/setup.h> |
24 | 24 | ||
25 | #ifdef CONFIG_PARAVIRT | 25 | #if defined CONFIG_PCI && defined CONFIG_PARAVIRT |
26 | /* | 26 | /* |
27 | * Interrupt control on vSMPowered systems: | 27 | * Interrupt control on vSMPowered systems: |
28 | * ~AC is a shadow of IF. If IF is 'on' AC should be 'off' | 28 | * ~AC is a shadow of IF. If IF is 'on' AC should be 'off' |
@@ -114,6 +114,7 @@ static void __init set_vsmp_pv_ops(void) | |||
114 | } | 114 | } |
115 | #endif | 115 | #endif |
116 | 116 | ||
117 | #ifdef CONFIG_PCI | ||
117 | static int is_vsmp = -1; | 118 | static int is_vsmp = -1; |
118 | 119 | ||
119 | static void __init detect_vsmp_box(void) | 120 | static void __init detect_vsmp_box(void) |
@@ -139,6 +140,15 @@ int is_vsmp_box(void) | |||
139 | } | 140 | } |
140 | } | 141 | } |
141 | 142 | ||
143 | #else | ||
144 | static void __init detect_vsmp_box(void) | ||
145 | { | ||
146 | } | ||
147 | int is_vsmp_box(void) | ||
148 | { | ||
149 | return 0; | ||
150 | } | ||
151 | #endif | ||
142 | void __init vsmp_init(void) | 152 | void __init vsmp_init(void) |
143 | { | 153 | { |
144 | detect_vsmp_box(); | 154 | detect_vsmp_box(); |