WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-devel

[Xen-devel] Problem with BIOS timer interrupts

To: xen-devel <xen-devel@xxxxxxxxxxxxxxxxxxx>
Subject: [Xen-devel] Problem with BIOS timer interrupts
From: Gary Grebus <ggrebus@xxxxxxxxxxxxxxx>
Date: Tue, 18 Nov 2008 13:50:22 -0500
Delivery-date: Tue, 18 Nov 2008 10:50:44 -0800
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
List-help: <mailto:xen-devel-request@lists.xensource.com?subject=help>
List-id: Xen developer discussion <xen-devel.lists.xensource.com>
List-post: <mailto:xen-devel@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=unsubscribe>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
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.



_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-devel