Skip to content

Commit

Permalink
[PATCH] i386: Vmi timer race
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Zachary Amsden authored and Andi Kleen committed Feb 13, 2007
1 parent ac3b6fa commit 90736e2
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions arch/i386/kernel/vmitime.c
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,9 @@ unsigned long long vmi_sched_clock(void)
void __init vmi_time_init(void)
{
unsigned long long cycles_per_sec, cycles_per_msec;
unsigned long flags;

local_irq_save(flags);
setup_irq(0, &vmi_timer_irq);
#ifdef CONFIG_X86_LOCAL_APIC
set_intr_gate(LOCAL_TIMER_VECTOR, apic_vmi_timer_interrupt);
Expand Down Expand Up @@ -224,6 +226,8 @@ void __init vmi_time_init(void)
VMI_ALARM_WIRED_IRQ0 | VMI_ALARM_IS_PERIODIC | VMI_CYCLES_AVAILABLE,
per_cpu(process_times_cycles_accounted_cpu, 0) + cycles_per_alarm,
cycles_per_alarm);

local_irq_restore(flags);
}

#ifdef CONFIG_X86_LOCAL_APIC
Expand Down

0 comments on commit 90736e2

Please sign in to comment.