From: Gary Grebus Subject: Problem with BIOS timer interrupts Date: Tue, 18 Nov 2008 13:50:22 -0500 Message-ID: <1227034222.17638.83.camel@ggrebus.katana-technology.com> Mime-Version: 1.0 Content-Type: text/plain Content-Transfer-Encoding: 7bit Return-path: List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xensource.com Errors-To: xen-devel-bounces@lists.xensource.com To: xen-devel List-Id: xen-devel@lists.xenproject.org Hi, While changing our Xen 3.2.x based HVM BIOS ROM to use gPXE instead of etherboot, I ran into an interesting behavior. The gPXE code, which runs in real mode, contains the following sequence: wait_for_tick: pushl %eax pushw %fs movw $0x40, %ax movw %ax, %fs movl %fs:(0x6c), %eax 1: pushf sti hlt popf cmpl %fs:(0x6c), %eax je 1b popw %fs popl %eax ret 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. /gary -- Gary Grebus Virtual Iron Software, Inc.