aboutsummaryrefslogtreecommitdiffstats
path: root/arch
diff options
context:
space:
mode:
authorZachary Amsden <zach@vmware.com>2007-02-13 07:26:21 -0500
committerAndi Kleen <andi@basil.nowhere.org>2007-02-13 07:26:21 -0500
commit90736e20e3805dd1ffff60e4750495944956cd44 (patch)
tree700df54aaa675a6afbcf256c771c3ba452f9ea4c /arch
parentac3b6faff961dd52fde71fb199ec3cf68ba35052 (diff)
[PATCH] i386: Vmi timer race
Because timer code moves around, and we might eventually move our init to a late_time_init hook, save and restore IRQs around this code because it is definitely not interrupt safe. Signed-off-by: Zachary Amsden <zach@vmware.com> Signed-off-by: Andi Kleen <ak@suse.de>
Diffstat (limited to 'arch')
-rw-r--r--arch/i386/kernel/vmitime.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/arch/i386/kernel/vmitime.c b/arch/i386/kernel/vmitime.c
index 7c3033dbe5f5..2e2d8dbcbd68 100644
--- a/arch/i386/kernel/vmitime.c
+++ b/arch/i386/kernel/vmitime.c
@@ -180,7 +180,9 @@ unsigned long long vmi_sched_clock(void)
180void __init vmi_time_init(void) 180void __init vmi_time_init(void)
181{ 181{
182 unsigned long long cycles_per_sec, cycles_per_msec; 182 unsigned long long cycles_per_sec, cycles_per_msec;
183 unsigned long flags;
183 184
185 local_irq_save(flags);
184 setup_irq(0, &vmi_timer_irq); 186 setup_irq(0, &vmi_timer_irq);
185#ifdef CONFIG_X86_LOCAL_APIC 187#ifdef CONFIG_X86_LOCAL_APIC
186 set_intr_gate(LOCAL_TIMER_VECTOR, apic_vmi_timer_interrupt); 188 set_intr_gate(LOCAL_TIMER_VECTOR, apic_vmi_timer_interrupt);
@@ -224,6 +226,8 @@ void __init vmi_time_init(void)
224 VMI_ALARM_WIRED_IRQ0 | VMI_ALARM_IS_PERIODIC | VMI_CYCLES_AVAILABLE, 226 VMI_ALARM_WIRED_IRQ0 | VMI_ALARM_IS_PERIODIC | VMI_CYCLES_AVAILABLE,
225 per_cpu(process_times_cycles_accounted_cpu, 0) + cycles_per_alarm, 227 per_cpu(process_times_cycles_accounted_cpu, 0) + cycles_per_alarm,
226 cycles_per_alarm); 228 cycles_per_alarm);
229
230 local_irq_restore(flags);
227} 231}
228 232
229#ifdef CONFIG_X86_LOCAL_APIC 233#ifdef CONFIG_X86_LOCAL_APIC