Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752699AbXBFDz7 (ORCPT ); Mon, 5 Feb 2007 22:55:59 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1752732AbXBFDzj (ORCPT ); Mon, 5 Feb 2007 22:55:39 -0500 Received: from smtp-outbound-1.vmware.com ([65.113.40.141]:40381 "EHLO smtp-outbound-1.vmware.com" rhost-flags-OK-FAIL-OK-FAIL) by vger.kernel.org with ESMTP id S1752700AbXBFDxR (ORCPT ); Mon, 5 Feb 2007 22:53:17 -0500 Date: Mon, 5 Feb 2007 19:53:16 -0800 Message-Id: <200702060353.l163rGFV000757@zach-dev.vmware.com> Subject: [PATCH 7/11] Vmi timer race From: Zachary Amsden To: Linux Kernel Mailing List , Andrew Morton , Andi Kleen , Rusty Russell , Jeremy Fitzhardinge , Chris Wright , Zachary Amsden X-OriginalArrivalTime: 06 Feb 2007 03:53:16.0399 (UTC) FILETIME=[550FFFF0:01C749A2] Sender: linux-kernel-owner@vger.kernel.org X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1269 Lines: 34 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 diff -r dd4d4324a5b3 arch/i386/kernel/vmitime.c --- a/arch/i386/kernel/vmitime.c Thu Feb 01 23:53:06 2007 -0800 +++ b/arch/i386/kernel/vmitime.c Fri Feb 02 00:03:05 2007 -0800 @@ -178,7 +178,9 @@ void __init vmi_time_init(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); @@ -222,6 +224,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 - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/