aboutsummaryrefslogtreecommitdiffstats
path: root/arch
diff options
context:
space:
mode:
authorThomas Gleixner <tglx@linutronix.de>2009-08-19 06:35:53 -0400
committerThomas Gleixner <tglx@linutronix.de>2009-08-31 03:35:46 -0400
commit736decac643e8982655e22ac7f0e5e61c5b7f9bd (patch)
tree779e2a12713a27de723b0f600a13c746aa4615ad /arch
parentf1d7062a235d057e5d85ed2860bef609e0160cde (diff)
x86: Move percpu clockevents setup to x86_init_ops
paravirt overrides the setup of the default apic timers as per cpu timers. Moorestown needs to override that as well. Move it to x86_init_ops setup and create a separate x86_cpuinit struct which holds the function for the secondary evtl. hotplugabble CPUs. Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Diffstat (limited to 'arch')
-rw-r--r--arch/x86/include/asm/apic.h5
-rw-r--r--arch/x86/include/asm/paravirt.h12
-rw-r--r--arch/x86/include/asm/paravirt_types.h3
-rw-r--r--arch/x86/include/asm/x86_init.h19
-rw-r--r--arch/x86/kernel/apic/apic.c3
-rw-r--r--arch/x86/kernel/kvmclock.c5
-rw-r--r--arch/x86/kernel/paravirt.c2
-rw-r--r--arch/x86/kernel/smpboot.c4
-rw-r--r--arch/x86/kernel/vmi_32.c4
-rw-r--r--arch/x86/kernel/x86_init.c9
-rw-r--r--arch/x86/xen/enlighten.c4
11 files changed, 42 insertions, 28 deletions
diff --git a/arch/x86/include/asm/apic.h b/arch/x86/include/asm/apic.h
index bb7d47925847..6f15b29005a1 100644
--- a/arch/x86/include/asm/apic.h
+++ b/arch/x86/include/asm/apic.h
@@ -70,9 +70,6 @@ static inline void default_inquire_remote_apic(int apicid)
70 */ 70 */
71#ifdef CONFIG_PARAVIRT 71#ifdef CONFIG_PARAVIRT
72#include <asm/paravirt.h> 72#include <asm/paravirt.h>
73#else
74#define setup_boot_clock setup_boot_APIC_clock
75#define setup_secondary_clock setup_secondary_APIC_clock
76#endif 73#endif
77 74
78#ifdef CONFIG_X86_64 75#ifdef CONFIG_X86_64
@@ -245,6 +242,8 @@ static inline void lapic_shutdown(void) { }
245static inline void init_apic_mappings(void) { } 242static inline void init_apic_mappings(void) { }
246static inline void disable_local_APIC(void) { } 243static inline void disable_local_APIC(void) { }
247static inline void apic_disable(void) { } 244static inline void apic_disable(void) { }
245# define setup_boot_APIC_clock x86_init_noop
246# define setup_secondary_APIC_clock x86_init_noop
248#endif /* !CONFIG_X86_LOCAL_APIC */ 247#endif /* !CONFIG_X86_LOCAL_APIC */
249 248
250#ifdef CONFIG_X86_64 249#ifdef CONFIG_X86_64
diff --git a/arch/x86/include/asm/paravirt.h b/arch/x86/include/asm/paravirt.h
index 7ce415e844b6..825674a968d1 100644
--- a/arch/x86/include/asm/paravirt.h
+++ b/arch/x86/include/asm/paravirt.h
@@ -333,18 +333,6 @@ static inline void slow_down_io(void)
333#endif 333#endif
334} 334}
335 335
336#ifdef CONFIG_X86_LOCAL_APIC
337static inline void setup_boot_clock(void)
338{
339 PVOP_VCALL0(pv_apic_ops.setup_boot_clock);
340}
341
342static inline void setup_secondary_clock(void)
343{
344 PVOP_VCALL0(pv_apic_ops.setup_secondary_clock);
345}
346#endif
347
348#ifdef CONFIG_SMP 336#ifdef CONFIG_SMP
349static inline void startup_ipi_hook(int phys_apicid, unsigned long start_eip, 337static inline void startup_ipi_hook(int phys_apicid, unsigned long start_eip,
350 unsigned long start_esp) 338 unsigned long start_esp)
diff --git a/arch/x86/include/asm/paravirt_types.h b/arch/x86/include/asm/paravirt_types.h
index ecc74e5ad407..1da89276d142 100644
--- a/arch/x86/include/asm/paravirt_types.h
+++ b/arch/x86/include/asm/paravirt_types.h
@@ -218,9 +218,6 @@ struct pv_irq_ops {
218 218
219struct pv_apic_ops { 219struct pv_apic_ops {
220#ifdef CONFIG_X86_LOCAL_APIC 220#ifdef CONFIG_X86_LOCAL_APIC
221 void (*setup_boot_clock)(void);
222 void (*setup_secondary_clock)(void);
223
224 void (*startup_ipi_hook)(int phys_apicid, 221 void (*startup_ipi_hook)(int phys_apicid,
225 unsigned long start_eip, 222 unsigned long start_eip,
226 unsigned long start_esp); 223 unsigned long start_esp);
diff --git a/arch/x86/include/asm/x86_init.h b/arch/x86/include/asm/x86_init.h
index b9bb4faefc48..b7d258f4c401 100644
--- a/arch/x86/include/asm/x86_init.h
+++ b/arch/x86/include/asm/x86_init.h
@@ -79,6 +79,15 @@ struct x86_init_paging {
79}; 79};
80 80
81/** 81/**
82 * struct x86_init_timers - platform specific timer setup
83 * @setup_perpcu_clockev: set up the per cpu clock event device for the
84 * boot cpu
85 */
86struct x86_init_timers {
87 void (*setup_percpu_clockev)(void);
88};
89
90/**
82 * struct x86_init_ops - functions for platform specific setup 91 * struct x86_init_ops - functions for platform specific setup
83 * 92 *
84 */ 93 */
@@ -88,9 +97,19 @@ struct x86_init_ops {
88 struct x86_init_irqs irqs; 97 struct x86_init_irqs irqs;
89 struct x86_init_oem oem; 98 struct x86_init_oem oem;
90 struct x86_init_paging paging; 99 struct x86_init_paging paging;
100 struct x86_init_timers timers;
101};
102
103/**
104 * struct x86_cpuinit_ops - platform specific cpu hotplug setups
105 * @setup_percpu_clockev: set up the per cpu clock event device
106 */
107struct x86_cpuinit_ops {
108 void (*setup_percpu_clockev)(void);
91}; 109};
92 110
93extern struct x86_init_ops x86_init; 111extern struct x86_init_ops x86_init;
112extern struct x86_cpuinit_ops x86_cpuinit;
94 113
95extern void x86_init_noop(void); 114extern void x86_init_noop(void);
96extern void x86_init_uint_noop(unsigned int unused); 115extern void x86_init_uint_noop(unsigned int unused);
diff --git a/arch/x86/kernel/apic/apic.c b/arch/x86/kernel/apic/apic.c
index 0a1c2830ec66..ce0098066e91 100644
--- a/arch/x86/kernel/apic/apic.c
+++ b/arch/x86/kernel/apic/apic.c
@@ -36,6 +36,7 @@
36#include <linux/mm.h> 36#include <linux/mm.h>
37 37
38#include <asm/perf_counter.h> 38#include <asm/perf_counter.h>
39#include <asm/x86_init.h>
39#include <asm/pgalloc.h> 40#include <asm/pgalloc.h>
40#include <asm/atomic.h> 41#include <asm/atomic.h>
41#include <asm/mpspec.h> 42#include <asm/mpspec.h>
@@ -1701,7 +1702,7 @@ int __init APIC_init_uniprocessor(void)
1701 localise_nmi_watchdog(); 1702 localise_nmi_watchdog();
1702#endif 1703#endif
1703 1704
1704 setup_boot_clock(); 1705 x86_init.timers.setup_percpu_clockev();
1705#ifdef CONFIG_X86_64 1706#ifdef CONFIG_X86_64
1706 check_nmi_watchdog(); 1707 check_nmi_watchdog();
1707#endif 1708#endif
diff --git a/arch/x86/kernel/kvmclock.c b/arch/x86/kernel/kvmclock.c
index 223af43f1526..64e9b5f59d2d 100644
--- a/arch/x86/kernel/kvmclock.c
+++ b/arch/x86/kernel/kvmclock.c
@@ -22,6 +22,8 @@
22#include <asm/msr.h> 22#include <asm/msr.h>
23#include <asm/apic.h> 23#include <asm/apic.h>
24#include <linux/percpu.h> 24#include <linux/percpu.h>
25
26#include <asm/x86_init.h>
25#include <asm/reboot.h> 27#include <asm/reboot.h>
26 28
27#define KVM_SCALE 22 29#define KVM_SCALE 22
@@ -187,7 +189,8 @@ void __init kvmclock_init(void)
187 pv_time_ops.sched_clock = kvm_clock_read; 189 pv_time_ops.sched_clock = kvm_clock_read;
188 pv_time_ops.get_tsc_khz = kvm_get_tsc_khz; 190 pv_time_ops.get_tsc_khz = kvm_get_tsc_khz;
189#ifdef CONFIG_X86_LOCAL_APIC 191#ifdef CONFIG_X86_LOCAL_APIC
190 pv_apic_ops.setup_secondary_clock = kvm_setup_secondary_clock; 192 x86_cpuinit.setup_percpu_clockev =
193 kvm_setup_secondary_clock;
191#endif 194#endif
192#ifdef CONFIG_SMP 195#ifdef CONFIG_SMP
193 smp_ops.smp_prepare_boot_cpu = kvm_smp_prepare_boot_cpu; 196 smp_ops.smp_prepare_boot_cpu = kvm_smp_prepare_boot_cpu;
diff --git a/arch/x86/kernel/paravirt.c b/arch/x86/kernel/paravirt.c
index 8167be0b68ca..1ed32c79679d 100644
--- a/arch/x86/kernel/paravirt.c
+++ b/arch/x86/kernel/paravirt.c
@@ -387,8 +387,6 @@ struct pv_cpu_ops pv_cpu_ops = {
387 387
388struct pv_apic_ops pv_apic_ops = { 388struct pv_apic_ops pv_apic_ops = {
389#ifdef CONFIG_X86_LOCAL_APIC 389#ifdef CONFIG_X86_LOCAL_APIC
390 .setup_boot_clock = setup_boot_APIC_clock,
391 .setup_secondary_clock = setup_secondary_APIC_clock,
392 .startup_ipi_hook = paravirt_nop, 390 .startup_ipi_hook = paravirt_nop,
393#endif 391#endif
394}; 392};
diff --git a/arch/x86/kernel/smpboot.c b/arch/x86/kernel/smpboot.c
index 2fecda69ee64..6eb81a87b4b7 100644
--- a/arch/x86/kernel/smpboot.c
+++ b/arch/x86/kernel/smpboot.c
@@ -323,7 +323,7 @@ notrace static void __cpuinit start_secondary(void *unused)
323 /* enable local interrupts */ 323 /* enable local interrupts */
324 local_irq_enable(); 324 local_irq_enable();
325 325
326 setup_secondary_clock(); 326 x86_cpuinit.setup_percpu_clockev();
327 327
328 wmb(); 328 wmb();
329 cpu_idle(); 329 cpu_idle();
@@ -1112,7 +1112,7 @@ void __init native_smp_prepare_cpus(unsigned int max_cpus)
1112 1112
1113 printk(KERN_INFO "CPU%d: ", 0); 1113 printk(KERN_INFO "CPU%d: ", 0);
1114 print_cpu_info(&cpu_data(0)); 1114 print_cpu_info(&cpu_data(0));
1115 setup_boot_clock(); 1115 x86_init.timers.setup_percpu_clockev();
1116 1116
1117 if (is_uv_system()) 1117 if (is_uv_system())
1118 uv_system_init(); 1118 uv_system_init();
diff --git a/arch/x86/kernel/vmi_32.c b/arch/x86/kernel/vmi_32.c
index 95a7289e4b0c..b43b6685cae1 100644
--- a/arch/x86/kernel/vmi_32.c
+++ b/arch/x86/kernel/vmi_32.c
@@ -821,8 +821,8 @@ static inline int __init activate_vmi(void)
821 pv_time_ops.get_wallclock = vmi_get_wallclock; 821 pv_time_ops.get_wallclock = vmi_get_wallclock;
822 pv_time_ops.set_wallclock = vmi_set_wallclock; 822 pv_time_ops.set_wallclock = vmi_set_wallclock;
823#ifdef CONFIG_X86_LOCAL_APIC 823#ifdef CONFIG_X86_LOCAL_APIC
824 pv_apic_ops.setup_boot_clock = vmi_time_bsp_init; 824 x86_init.timers.setup_percpu_clockev = vmi_time_bsp_init;
825 pv_apic_ops.setup_secondary_clock = vmi_time_ap_init; 825 x86_cpuinit.setup_percpu_clockev = vmi_time_ap_init;
826#endif 826#endif
827 pv_time_ops.sched_clock = vmi_sched_clock; 827 pv_time_ops.sched_clock = vmi_sched_clock;
828 pv_time_ops.get_tsc_khz = vmi_tsc_khz; 828 pv_time_ops.get_tsc_khz = vmi_tsc_khz;
diff --git a/arch/x86/kernel/x86_init.c b/arch/x86/kernel/x86_init.c
index 7df020e6740d..e666a98db7cd 100644
--- a/arch/x86/kernel/x86_init.c
+++ b/arch/x86/kernel/x86_init.c
@@ -9,6 +9,7 @@
9#include <asm/paravirt.h> 9#include <asm/paravirt.h>
10#include <asm/mpspec.h> 10#include <asm/mpspec.h>
11#include <asm/setup.h> 11#include <asm/setup.h>
12#include <asm/apic.h>
12#include <asm/e820.h> 13#include <asm/e820.h>
13#include <asm/irq.h> 14#include <asm/irq.h>
14 15
@@ -54,4 +55,12 @@ struct __initdata x86_init_ops x86_init = {
54 .pagetable_setup_start = native_pagetable_setup_start, 55 .pagetable_setup_start = native_pagetable_setup_start,
55 .pagetable_setup_done = native_pagetable_setup_done, 56 .pagetable_setup_done = native_pagetable_setup_done,
56 }, 57 },
58
59 .timers = {
60 .setup_percpu_clockev = setup_boot_APIC_clock,
61 },
62};
63
64__cpuinitdata struct x86_cpuinit_ops x86_cpuinit = {
65 .setup_percpu_clockev = setup_secondary_APIC_clock,
57}; 66};
diff --git a/arch/x86/xen/enlighten.c b/arch/x86/xen/enlighten.c
index a924caa168dd..14e597e0c160 100644
--- a/arch/x86/xen/enlighten.c
+++ b/arch/x86/xen/enlighten.c
@@ -912,8 +912,6 @@ static const struct pv_cpu_ops xen_cpu_ops __initdata = {
912 912
913static const struct pv_apic_ops xen_apic_ops __initdata = { 913static const struct pv_apic_ops xen_apic_ops __initdata = {
914#ifdef CONFIG_X86_LOCAL_APIC 914#ifdef CONFIG_X86_LOCAL_APIC
915 .setup_boot_clock = paravirt_nop,
916 .setup_secondary_clock = paravirt_nop,
917 .startup_ipi_hook = paravirt_nop, 915 .startup_ipi_hook = paravirt_nop,
918#endif 916#endif
919}; 917};
@@ -979,6 +977,8 @@ asmlinkage void __init xen_start_kernel(void)
979 x86_init.resources.memory_setup = xen_memory_setup; 977 x86_init.resources.memory_setup = xen_memory_setup;
980 x86_init.oem.arch_setup = xen_arch_setup; 978 x86_init.oem.arch_setup = xen_arch_setup;
981 x86_init.oem.banner = xen_banner; 979 x86_init.oem.banner = xen_banner;
980 x86_init.timers.setup_percpu_clockev = x86_init_noop;
981 x86_cpuinit.setup_percpu_clockev = x86_init_noop;
982 982
983#ifdef CONFIG_X86_64 983#ifdef CONFIG_X86_64
984 /* 984 /*