From: Keir Fraser Subject: Re: Problem with BIOS timer interrupts Date: Tue, 18 Nov 2008 20:02:18 +0000 Message-ID: References: <1227034222.17638.83.camel@ggrebus.katana-technology.com> Mime-Version: 1.0 Content-Type: text/plain; charset="US-ASCII" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <1227034222.17638.83.camel@ggrebus.katana-technology.com> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xensource.com Errors-To: xen-devel-bounces@lists.xensource.com To: Gary Grebus , xen-devel List-Id: xen-devel@lists.xenproject.org On 18/11/08 18:50, "Gary Grebus" wrote: > It uses this to timeout waiting for a key press. The expected interrupt > is from the BIOS timer implemented in rombios. But in fact, the loop > hangs. However, if I insert a nop instruction between the sti and hlt, > then things work as expected. > > Is there something wrong with this sequence? This happens on AMD, so > it's not a quirk of the real mode emulations on Intel. > > I notice that in the gPXE code currently in xen-unstable, the path that > uses this code is patched out. As a data point, I commented it out because the delay's annoying rather than because it caused a boot hang for me. I was testing on Intel though. Inserting the nop is obviously bogus (I expect you're aware of that :-), since it raises the opportunity of a wakeup-waiting race. That it fixes this issue is very weird. I expect we have some issue to do with leaving an interrupt shadow during HLT emulation -- why this would only trigger in real mode I cannot guess. Wei's erratum is not applicable, for three reasons: 1. We disable C1 clock ramping 2. We always intercept HLT 3. STI; HLT is a standard x86 idiom used in all OSes, and this is the only place we're seeing a problem. Also the erratum would lead to rare non-deterministic hangs, not a hang every time (which is what you're seeing?). I would say it's a good idea to see if you can repro this on xen-unstable. -- Keir