diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2011-05-23 15:54:15 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2011-05-23 15:54:15 -0400 |
commit | ea2b50ef4c9e030749ae473e95258f477c3a68ca (patch) | |
tree | a8dcfd287a6fd2c497eaf2bbf3a83f6ae80dfebe /arch/x86/include/asm | |
parent | 15a3d11b0f2ebdfb3591e411e268aa81998d4723 (diff) | |
parent | b18bf0948e1037e7ed33378c80f1ecb8c77c30e9 (diff) |
Merge branch 'x86-apic-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip
* 'x86-apic-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip:
x86, apic: Include module.h header in apic_flat_64.c
x86, apic: Make apic drivers static
x86, apic: Clean up bigsmp apic selection code
x86, apic: Use .apicdrivers section for the apic drivers list
x86, apic: Introduce .apicdrivers section to find the list of apic drivers
x86, x2apic: Move the common bits to x2apic.h
x86, x2apic: Minimize IPI register writes using cluster groups
x86, x2apic: Track the x2apic cluster sibling map
x86, x2apic: Remove duplicate code for IPI mask routines
x86, apic: Use probe routines to simplify apic selection
x86, ioapic: Consolidate mp_ioapic_routing[] into 'struct ioapic'
x86, ioapic: Consolidate gsi routing info into 'struct ioapic'
x86, ioapic: Consolidate mp_ioapics[] into 'struct ioapic'
x86, ioapic: Consolidate ioapic_saved_data[] into 'struct ioapic'
x86, ioapic: Add struct ioapic
x86, ioapic: Remove duplicate code for saving/restoring RTEs
x86, ioapic: Use ioapic_saved_data while enabling intr-remapping
x86, ioapic: Allocate ioapic_saved_data early
x86, ioapic: Fix potential resume deadlock
Diffstat (limited to 'arch/x86/include/asm')
-rw-r--r-- | arch/x86/include/asm/apic.h | 29 | ||||
-rw-r--r-- | arch/x86/include/asm/io_apic.h | 28 | ||||
-rw-r--r-- | arch/x86/include/asm/x2apic.h | 62 |
3 files changed, 93 insertions, 26 deletions
diff --git a/arch/x86/include/asm/apic.h b/arch/x86/include/asm/apic.h index a0c46f061210..4a0b7c7e2cce 100644 --- a/arch/x86/include/asm/apic.h +++ b/arch/x86/include/asm/apic.h | |||
@@ -381,6 +381,26 @@ struct apic { | |||
381 | extern struct apic *apic; | 381 | extern struct apic *apic; |
382 | 382 | ||
383 | /* | 383 | /* |
384 | * APIC drivers are probed based on how they are listed in the .apicdrivers | ||
385 | * section. So the order is important and enforced by the ordering | ||
386 | * of different apic driver files in the Makefile. | ||
387 | * | ||
388 | * For the files having two apic drivers, we use apic_drivers() | ||
389 | * to enforce the order with in them. | ||
390 | */ | ||
391 | #define apic_driver(sym) \ | ||
392 | static struct apic *__apicdrivers_##sym __used \ | ||
393 | __aligned(sizeof(struct apic *)) \ | ||
394 | __section(.apicdrivers) = { &sym } | ||
395 | |||
396 | #define apic_drivers(sym1, sym2) \ | ||
397 | static struct apic *__apicdrivers_##sym1##sym2[2] __used \ | ||
398 | __aligned(sizeof(struct apic *)) \ | ||
399 | __section(.apicdrivers) = { &sym1, &sym2 } | ||
400 | |||
401 | extern struct apic *__apicdrivers[], *__apicdrivers_end[]; | ||
402 | |||
403 | /* | ||
384 | * APIC functionality to boot other CPUs - only used on SMP: | 404 | * APIC functionality to boot other CPUs - only used on SMP: |
385 | */ | 405 | */ |
386 | #ifdef CONFIG_SMP | 406 | #ifdef CONFIG_SMP |
@@ -458,15 +478,10 @@ static inline unsigned default_get_apic_id(unsigned long x) | |||
458 | #define DEFAULT_TRAMPOLINE_PHYS_HIGH 0x469 | 478 | #define DEFAULT_TRAMPOLINE_PHYS_HIGH 0x469 |
459 | 479 | ||
460 | #ifdef CONFIG_X86_64 | 480 | #ifdef CONFIG_X86_64 |
461 | extern struct apic apic_flat; | ||
462 | extern struct apic apic_physflat; | ||
463 | extern struct apic apic_x2apic_cluster; | ||
464 | extern struct apic apic_x2apic_phys; | ||
465 | extern int default_acpi_madt_oem_check(char *, char *); | 481 | extern int default_acpi_madt_oem_check(char *, char *); |
466 | 482 | ||
467 | extern void apic_send_IPI_self(int vector); | 483 | extern void apic_send_IPI_self(int vector); |
468 | 484 | ||
469 | extern struct apic apic_x2apic_uv_x; | ||
470 | DECLARE_PER_CPU(int, x2apic_extra_bits); | 485 | DECLARE_PER_CPU(int, x2apic_extra_bits); |
471 | 486 | ||
472 | extern int default_cpu_present_to_apicid(int mps_cpu); | 487 | extern int default_cpu_present_to_apicid(int mps_cpu); |
@@ -480,7 +495,7 @@ static inline void default_wait_for_init_deassert(atomic_t *deassert) | |||
480 | return; | 495 | return; |
481 | } | 496 | } |
482 | 497 | ||
483 | extern void generic_bigsmp_probe(void); | 498 | extern struct apic *generic_bigsmp_probe(void); |
484 | 499 | ||
485 | 500 | ||
486 | #ifdef CONFIG_X86_LOCAL_APIC | 501 | #ifdef CONFIG_X86_LOCAL_APIC |
@@ -516,8 +531,6 @@ extern struct apic apic_noop; | |||
516 | 531 | ||
517 | #ifdef CONFIG_X86_32 | 532 | #ifdef CONFIG_X86_32 |
518 | 533 | ||
519 | extern struct apic apic_default; | ||
520 | |||
521 | static inline int noop_x86_32_early_logical_apicid(int cpu) | 534 | static inline int noop_x86_32_early_logical_apicid(int cpu) |
522 | { | 535 | { |
523 | return BAD_APICID; | 536 | return BAD_APICID; |
diff --git a/arch/x86/include/asm/io_apic.h b/arch/x86/include/asm/io_apic.h index a97a240f67f3..690d1cc9a877 100644 --- a/arch/x86/include/asm/io_apic.h +++ b/arch/x86/include/asm/io_apic.h | |||
@@ -105,12 +105,12 @@ struct IR_IO_APIC_route_entry { | |||
105 | * # of IO-APICs and # of IRQ routing registers | 105 | * # of IO-APICs and # of IRQ routing registers |
106 | */ | 106 | */ |
107 | extern int nr_ioapics; | 107 | extern int nr_ioapics; |
108 | extern int nr_ioapic_registers[MAX_IO_APICS]; | ||
109 | 108 | ||
110 | #define MP_MAX_IOAPIC_PIN 127 | 109 | extern int mpc_ioapic_id(int ioapic); |
110 | extern unsigned int mpc_ioapic_addr(int ioapic); | ||
111 | extern struct mp_ioapic_gsi *mp_ioapic_gsi_routing(int ioapic); | ||
111 | 112 | ||
112 | /* I/O APIC entries */ | 113 | #define MP_MAX_IOAPIC_PIN 127 |
113 | extern struct mpc_ioapic mp_ioapics[MAX_IO_APICS]; | ||
114 | 114 | ||
115 | /* # of MP IRQ source entries */ | 115 | /* # of MP IRQ source entries */ |
116 | extern int mp_irq_entries; | 116 | extern int mp_irq_entries; |
@@ -152,11 +152,9 @@ extern void ioapic_insert_resources(void); | |||
152 | 152 | ||
153 | int io_apic_setup_irq_pin_once(unsigned int irq, int node, struct io_apic_irq_attr *attr); | 153 | int io_apic_setup_irq_pin_once(unsigned int irq, int node, struct io_apic_irq_attr *attr); |
154 | 154 | ||
155 | extern struct IO_APIC_route_entry **alloc_ioapic_entries(void); | 155 | extern int save_ioapic_entries(void); |
156 | extern void free_ioapic_entries(struct IO_APIC_route_entry **ioapic_entries); | 156 | extern void mask_ioapic_entries(void); |
157 | extern int save_IO_APIC_setup(struct IO_APIC_route_entry **ioapic_entries); | 157 | extern int restore_ioapic_entries(void); |
158 | extern void mask_IO_APIC_setup(struct IO_APIC_route_entry **ioapic_entries); | ||
159 | extern int restore_IO_APIC_setup(struct IO_APIC_route_entry **ioapic_entries); | ||
160 | 158 | ||
161 | extern int get_nr_irqs_gsi(void); | 159 | extern int get_nr_irqs_gsi(void); |
162 | 160 | ||
@@ -192,19 +190,13 @@ struct io_apic_irq_attr; | |||
192 | static inline int io_apic_set_pci_routing(struct device *dev, int irq, | 190 | static inline int io_apic_set_pci_routing(struct device *dev, int irq, |
193 | struct io_apic_irq_attr *irq_attr) { return 0; } | 191 | struct io_apic_irq_attr *irq_attr) { return 0; } |
194 | 192 | ||
195 | static inline struct IO_APIC_route_entry **alloc_ioapic_entries(void) | 193 | static inline int save_ioapic_entries(void) |
196 | { | ||
197 | return NULL; | ||
198 | } | ||
199 | |||
200 | static inline void free_ioapic_entries(struct IO_APIC_route_entry **ent) { } | ||
201 | static inline int save_IO_APIC_setup(struct IO_APIC_route_entry **ent) | ||
202 | { | 194 | { |
203 | return -ENOMEM; | 195 | return -ENOMEM; |
204 | } | 196 | } |
205 | 197 | ||
206 | static inline void mask_IO_APIC_setup(struct IO_APIC_route_entry **ent) { } | 198 | static inline void mask_ioapic_entries(void) { } |
207 | static inline int restore_IO_APIC_setup(struct IO_APIC_route_entry **ent) | 199 | static inline int restore_ioapic_entries(void) |
208 | { | 200 | { |
209 | return -ENOMEM; | 201 | return -ENOMEM; |
210 | } | 202 | } |
diff --git a/arch/x86/include/asm/x2apic.h b/arch/x86/include/asm/x2apic.h new file mode 100644 index 000000000000..6bf5b8e478c0 --- /dev/null +++ b/arch/x86/include/asm/x2apic.h | |||
@@ -0,0 +1,62 @@ | |||
1 | /* | ||
2 | * Common bits for X2APIC cluster/physical modes. | ||
3 | */ | ||
4 | |||
5 | #ifndef _ASM_X86_X2APIC_H | ||
6 | #define _ASM_X86_X2APIC_H | ||
7 | |||
8 | #include <asm/apic.h> | ||
9 | #include <asm/ipi.h> | ||
10 | #include <linux/cpumask.h> | ||
11 | |||
12 | /* | ||
13 | * Need to use more than cpu 0, because we need more vectors | ||
14 | * when MSI-X are used. | ||
15 | */ | ||
16 | static const struct cpumask *x2apic_target_cpus(void) | ||
17 | { | ||
18 | return cpu_online_mask; | ||
19 | } | ||
20 | |||
21 | static int x2apic_apic_id_registered(void) | ||
22 | { | ||
23 | return 1; | ||
24 | } | ||
25 | |||
26 | /* | ||
27 | * For now each logical cpu is in its own vector allocation domain. | ||
28 | */ | ||
29 | static void x2apic_vector_allocation_domain(int cpu, struct cpumask *retmask) | ||
30 | { | ||
31 | cpumask_clear(retmask); | ||
32 | cpumask_set_cpu(cpu, retmask); | ||
33 | } | ||
34 | |||
35 | static void | ||
36 | __x2apic_send_IPI_dest(unsigned int apicid, int vector, unsigned int dest) | ||
37 | { | ||
38 | unsigned long cfg = __prepare_ICR(0, vector, dest); | ||
39 | native_x2apic_icr_write(cfg, apicid); | ||
40 | } | ||
41 | |||
42 | static unsigned int x2apic_get_apic_id(unsigned long id) | ||
43 | { | ||
44 | return id; | ||
45 | } | ||
46 | |||
47 | static unsigned long x2apic_set_apic_id(unsigned int id) | ||
48 | { | ||
49 | return id; | ||
50 | } | ||
51 | |||
52 | static int x2apic_phys_pkg_id(int initial_apicid, int index_msb) | ||
53 | { | ||
54 | return initial_apicid >> index_msb; | ||
55 | } | ||
56 | |||
57 | static void x2apic_send_IPI_self(int vector) | ||
58 | { | ||
59 | apic_write(APIC_SELF_IPI, vector); | ||
60 | } | ||
61 | |||
62 | #endif /* _ASM_X86_X2APIC_H */ | ||