diff options
author | Jens Axboe <jens.axboe@oracle.com> | 2008-06-26 05:21:54 -0400 |
---|---|---|
committer | Jens Axboe <jens.axboe@oracle.com> | 2008-06-26 05:21:54 -0400 |
commit | 3b16cf874861436725c43ba0b68bdd799297be7c (patch) | |
tree | 8e48647e3dce5dde6917f260f93c4b9f19945c55 /include/asm-x86 | |
parent | 3d4422332711ef48ef0f132f1fcbfcbd56c7f3d1 (diff) |
x86: convert to generic helpers for IPI function calls
This converts x86, x86-64, and xen to use the new helpers for
smp_call_function() and friends, and adds support for
smp_call_function_single().
Acked-by: Ingo Molnar <mingo@elte.hu>
Acked-by: Jeremy Fitzhardinge <jeremy.fitzhardinge@citrix.com>
Signed-off-by: Jens Axboe <jens.axboe@oracle.com>
Diffstat (limited to 'include/asm-x86')
-rw-r--r-- | include/asm-x86/hw_irq_32.h | 1 | ||||
-rw-r--r-- | include/asm-x86/hw_irq_64.h | 2 | ||||
-rw-r--r-- | include/asm-x86/mach-default/entry_arch.h | 1 | ||||
-rw-r--r-- | include/asm-x86/mach-default/irq_vectors.h | 1 | ||||
-rw-r--r-- | include/asm-x86/mach-voyager/entry_arch.h | 2 | ||||
-rw-r--r-- | include/asm-x86/mach-voyager/irq_vectors.h | 4 | ||||
-rw-r--r-- | include/asm-x86/smp.h | 21 | ||||
-rw-r--r-- | include/asm-x86/xen/events.h | 1 |
8 files changed, 22 insertions, 11 deletions
diff --git a/include/asm-x86/hw_irq_32.h b/include/asm-x86/hw_irq_32.h index ea88054e03f3..a87b1320c78f 100644 --- a/include/asm-x86/hw_irq_32.h +++ b/include/asm-x86/hw_irq_32.h | |||
@@ -32,6 +32,7 @@ extern void (*const interrupt[NR_IRQS])(void); | |||
32 | void reschedule_interrupt(void); | 32 | void reschedule_interrupt(void); |
33 | void invalidate_interrupt(void); | 33 | void invalidate_interrupt(void); |
34 | void call_function_interrupt(void); | 34 | void call_function_interrupt(void); |
35 | void call_function_single_interrupt(void); | ||
35 | #endif | 36 | #endif |
36 | 37 | ||
37 | #ifdef CONFIG_X86_LOCAL_APIC | 38 | #ifdef CONFIG_X86_LOCAL_APIC |
diff --git a/include/asm-x86/hw_irq_64.h b/include/asm-x86/hw_irq_64.h index 0062ef390f67..fe657812d4df 100644 --- a/include/asm-x86/hw_irq_64.h +++ b/include/asm-x86/hw_irq_64.h | |||
@@ -68,6 +68,7 @@ | |||
68 | #define ERROR_APIC_VECTOR 0xfe | 68 | #define ERROR_APIC_VECTOR 0xfe |
69 | #define RESCHEDULE_VECTOR 0xfd | 69 | #define RESCHEDULE_VECTOR 0xfd |
70 | #define CALL_FUNCTION_VECTOR 0xfc | 70 | #define CALL_FUNCTION_VECTOR 0xfc |
71 | #define CALL_FUNCTION_SINGLE_VECTOR 0xfb | ||
71 | /* fb free - please don't readd KDB here because it's useless | 72 | /* fb free - please don't readd KDB here because it's useless |
72 | (hint - think what a NMI bit does to a vector) */ | 73 | (hint - think what a NMI bit does to a vector) */ |
73 | #define THERMAL_APIC_VECTOR 0xfa | 74 | #define THERMAL_APIC_VECTOR 0xfa |
@@ -102,6 +103,7 @@ void spurious_interrupt(void); | |||
102 | void error_interrupt(void); | 103 | void error_interrupt(void); |
103 | void reschedule_interrupt(void); | 104 | void reschedule_interrupt(void); |
104 | void call_function_interrupt(void); | 105 | void call_function_interrupt(void); |
106 | void call_function_single_interrupt(void); | ||
105 | void irq_move_cleanup_interrupt(void); | 107 | void irq_move_cleanup_interrupt(void); |
106 | void invalidate_interrupt0(void); | 108 | void invalidate_interrupt0(void); |
107 | void invalidate_interrupt1(void); | 109 | void invalidate_interrupt1(void); |
diff --git a/include/asm-x86/mach-default/entry_arch.h b/include/asm-x86/mach-default/entry_arch.h index bc861469bdba..9283b60a1dd2 100644 --- a/include/asm-x86/mach-default/entry_arch.h +++ b/include/asm-x86/mach-default/entry_arch.h | |||
@@ -13,6 +13,7 @@ | |||
13 | BUILD_INTERRUPT(reschedule_interrupt,RESCHEDULE_VECTOR) | 13 | BUILD_INTERRUPT(reschedule_interrupt,RESCHEDULE_VECTOR) |
14 | BUILD_INTERRUPT(invalidate_interrupt,INVALIDATE_TLB_VECTOR) | 14 | BUILD_INTERRUPT(invalidate_interrupt,INVALIDATE_TLB_VECTOR) |
15 | BUILD_INTERRUPT(call_function_interrupt,CALL_FUNCTION_VECTOR) | 15 | BUILD_INTERRUPT(call_function_interrupt,CALL_FUNCTION_VECTOR) |
16 | BUILD_INTERRUPT(call_function_single_interrupt,CALL_FUNCTION_SINGLE_VECTOR) | ||
16 | #endif | 17 | #endif |
17 | 18 | ||
18 | /* | 19 | /* |
diff --git a/include/asm-x86/mach-default/irq_vectors.h b/include/asm-x86/mach-default/irq_vectors.h index 881c63ca61ad..ed7d4955c653 100644 --- a/include/asm-x86/mach-default/irq_vectors.h +++ b/include/asm-x86/mach-default/irq_vectors.h | |||
@@ -48,6 +48,7 @@ | |||
48 | #define INVALIDATE_TLB_VECTOR 0xfd | 48 | #define INVALIDATE_TLB_VECTOR 0xfd |
49 | #define RESCHEDULE_VECTOR 0xfc | 49 | #define RESCHEDULE_VECTOR 0xfc |
50 | #define CALL_FUNCTION_VECTOR 0xfb | 50 | #define CALL_FUNCTION_VECTOR 0xfb |
51 | #define CALL_FUNCTION_SINGLE_VECTOR 0xfa | ||
51 | 52 | ||
52 | #define THERMAL_APIC_VECTOR 0xf0 | 53 | #define THERMAL_APIC_VECTOR 0xf0 |
53 | /* | 54 | /* |
diff --git a/include/asm-x86/mach-voyager/entry_arch.h b/include/asm-x86/mach-voyager/entry_arch.h index 4a1e1e8c10b6..ae52624b5937 100644 --- a/include/asm-x86/mach-voyager/entry_arch.h +++ b/include/asm-x86/mach-voyager/entry_arch.h | |||
@@ -23,4 +23,4 @@ BUILD_INTERRUPT(qic_invalidate_interrupt, QIC_INVALIDATE_CPI); | |||
23 | BUILD_INTERRUPT(qic_reschedule_interrupt, QIC_RESCHEDULE_CPI); | 23 | BUILD_INTERRUPT(qic_reschedule_interrupt, QIC_RESCHEDULE_CPI); |
24 | BUILD_INTERRUPT(qic_enable_irq_interrupt, QIC_ENABLE_IRQ_CPI); | 24 | BUILD_INTERRUPT(qic_enable_irq_interrupt, QIC_ENABLE_IRQ_CPI); |
25 | BUILD_INTERRUPT(qic_call_function_interrupt, QIC_CALL_FUNCTION_CPI); | 25 | BUILD_INTERRUPT(qic_call_function_interrupt, QIC_CALL_FUNCTION_CPI); |
26 | 26 | BUILD_INTERRUPT(qic_call_function_single_interrupt, QIC_CALL_FUNCTION_SINGLE_CPI); | |
diff --git a/include/asm-x86/mach-voyager/irq_vectors.h b/include/asm-x86/mach-voyager/irq_vectors.h index 165421f5821c..fda57ad37b5d 100644 --- a/include/asm-x86/mach-voyager/irq_vectors.h +++ b/include/asm-x86/mach-voyager/irq_vectors.h | |||
@@ -33,6 +33,7 @@ | |||
33 | #define VIC_RESCHEDULE_CPI 4 | 33 | #define VIC_RESCHEDULE_CPI 4 |
34 | #define VIC_ENABLE_IRQ_CPI 5 | 34 | #define VIC_ENABLE_IRQ_CPI 5 |
35 | #define VIC_CALL_FUNCTION_CPI 6 | 35 | #define VIC_CALL_FUNCTION_CPI 6 |
36 | #define VIC_CALL_FUNCTION_SINGLE_CPI 7 | ||
36 | 37 | ||
37 | /* Now the QIC CPIs: Since we don't need the two initial levels, | 38 | /* Now the QIC CPIs: Since we don't need the two initial levels, |
38 | * these are 2 less than the VIC CPIs */ | 39 | * these are 2 less than the VIC CPIs */ |
@@ -42,9 +43,10 @@ | |||
42 | #define QIC_RESCHEDULE_CPI (VIC_RESCHEDULE_CPI - QIC_CPI_OFFSET) | 43 | #define QIC_RESCHEDULE_CPI (VIC_RESCHEDULE_CPI - QIC_CPI_OFFSET) |
43 | #define QIC_ENABLE_IRQ_CPI (VIC_ENABLE_IRQ_CPI - QIC_CPI_OFFSET) | 44 | #define QIC_ENABLE_IRQ_CPI (VIC_ENABLE_IRQ_CPI - QIC_CPI_OFFSET) |
44 | #define QIC_CALL_FUNCTION_CPI (VIC_CALL_FUNCTION_CPI - QIC_CPI_OFFSET) | 45 | #define QIC_CALL_FUNCTION_CPI (VIC_CALL_FUNCTION_CPI - QIC_CPI_OFFSET) |
46 | #define QIC_CALL_FUNCTION_SINGLE_CPI (VIC_CALL_FUNCTION_SINGLE_CPI - QIC_CPI_OFFSET) | ||
45 | 47 | ||
46 | #define VIC_START_FAKE_CPI VIC_TIMER_CPI | 48 | #define VIC_START_FAKE_CPI VIC_TIMER_CPI |
47 | #define VIC_END_FAKE_CPI VIC_CALL_FUNCTION_CPI | 49 | #define VIC_END_FAKE_CPI VIC_CALL_FUNCTION_SINGLE_CPI |
48 | 50 | ||
49 | /* this is the SYS_INT CPI. */ | 51 | /* this is the SYS_INT CPI. */ |
50 | #define VIC_SYS_INT 8 | 52 | #define VIC_SYS_INT 8 |
diff --git a/include/asm-x86/smp.h b/include/asm-x86/smp.h index 1ebaa5cd3112..e3c24807b59b 100644 --- a/include/asm-x86/smp.h +++ b/include/asm-x86/smp.h | |||
@@ -59,9 +59,9 @@ struct smp_ops { | |||
59 | 59 | ||
60 | void (*smp_send_stop)(void); | 60 | void (*smp_send_stop)(void); |
61 | void (*smp_send_reschedule)(int cpu); | 61 | void (*smp_send_reschedule)(int cpu); |
62 | int (*smp_call_function_mask)(cpumask_t mask, | 62 | |
63 | void (*func)(void *info), void *info, | 63 | void (*send_call_func_ipi)(cpumask_t mask); |
64 | int wait); | 64 | void (*send_call_func_single_ipi)(int cpu); |
65 | }; | 65 | }; |
66 | 66 | ||
67 | /* Globals due to paravirt */ | 67 | /* Globals due to paravirt */ |
@@ -103,17 +103,22 @@ static inline void smp_send_reschedule(int cpu) | |||
103 | smp_ops.smp_send_reschedule(cpu); | 103 | smp_ops.smp_send_reschedule(cpu); |
104 | } | 104 | } |
105 | 105 | ||
106 | static inline int smp_call_function_mask(cpumask_t mask, | 106 | static inline void arch_send_call_function_single_ipi(int cpu) |
107 | void (*func) (void *info), void *info, | 107 | { |
108 | int wait) | 108 | smp_ops.send_call_func_single_ipi(cpu); |
109 | } | ||
110 | |||
111 | static inline void arch_send_call_function_ipi(cpumask_t mask) | ||
109 | { | 112 | { |
110 | return smp_ops.smp_call_function_mask(mask, func, info, wait); | 113 | smp_ops.send_call_func_ipi(mask); |
111 | } | 114 | } |
112 | 115 | ||
113 | void native_smp_prepare_boot_cpu(void); | 116 | void native_smp_prepare_boot_cpu(void); |
114 | void native_smp_prepare_cpus(unsigned int max_cpus); | 117 | void native_smp_prepare_cpus(unsigned int max_cpus); |
115 | void native_smp_cpus_done(unsigned int max_cpus); | 118 | void native_smp_cpus_done(unsigned int max_cpus); |
116 | int native_cpu_up(unsigned int cpunum); | 119 | int native_cpu_up(unsigned int cpunum); |
120 | void native_send_call_func_ipi(cpumask_t mask); | ||
121 | void native_send_call_func_single_ipi(int cpu); | ||
117 | 122 | ||
118 | extern int __cpu_disable(void); | 123 | extern int __cpu_disable(void); |
119 | extern void __cpu_die(unsigned int cpu); | 124 | extern void __cpu_die(unsigned int cpu); |
@@ -202,7 +207,5 @@ extern void cpu_uninit(void); | |||
202 | #endif | 207 | #endif |
203 | 208 | ||
204 | extern void smp_alloc_memory(void); | 209 | extern void smp_alloc_memory(void); |
205 | extern void lock_ipi_call_lock(void); | ||
206 | extern void unlock_ipi_call_lock(void); | ||
207 | #endif /* __ASSEMBLY__ */ | 210 | #endif /* __ASSEMBLY__ */ |
208 | #endif | 211 | #endif |
diff --git a/include/asm-x86/xen/events.h b/include/asm-x86/xen/events.h index 596312a7bfc9..f8d57ea1f05f 100644 --- a/include/asm-x86/xen/events.h +++ b/include/asm-x86/xen/events.h | |||
@@ -4,6 +4,7 @@ | |||
4 | enum ipi_vector { | 4 | enum ipi_vector { |
5 | XEN_RESCHEDULE_VECTOR, | 5 | XEN_RESCHEDULE_VECTOR, |
6 | XEN_CALL_FUNCTION_VECTOR, | 6 | XEN_CALL_FUNCTION_VECTOR, |
7 | XEN_CALL_FUNCTION_SINGLE_VECTOR, | ||
7 | 8 | ||
8 | XEN_NR_IPIS, | 9 | XEN_NR_IPIS, |
9 | }; | 10 | }; |