From mboxrd@z Thu Jan 1 00:00:00 1970 From: Keir Fraser Subject: Re: [PATCH 2/4] CPUIDLE: Avoid remnant LAPIC timerintr while force hpetbroadcast Date: Thu, 11 Sep 2008 12:06:55 +0100 Message-ID: References: Mime-Version: 1.0 Content-Type: text/plain; charset="US-ASCII" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xensource.com Errors-To: xen-devel-bounces@lists.xensource.com To: "Tian, Kevin" , "Wei, Gang" , xen-devel@lists.xensource.com List-Id: xen-devel@lists.xenproject.org On 11/9/08 11:59, "Tian, Kevin" wrote: >> Also, in your patch, you unmask LVTT after reprogramming the >> LAPIC counter. >> Isn't there a race where the LAPIC timer generates an >> interrupt event before >> you unmask the LVTT and hence you lose the interrupt (since I >> assume the >> LAPIC interrupt is basically an internal one-shot signal which >> does not get >> latched in any way)? So you'd probably need to reprogram_timer(0), then >> enable the timer, then reprogram_timer(). >> > > You're correct. It will be fixed. Thanks. I'm not sure whether the reprogram_timer(0) before re-enabling is really required. It looks like Linux doesn't do similar (although if course it does re-programming after re-enabling to avoid the above race). I suppose repogram_timer(0) is cheap so you might choose to do it anyway. It's up to you... -- Keir