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

Re: [Xen-devel] [PATCH] add support for XCHG instruction accessing APIC

To: Keir Fraser <Keir.Fraser@xxxxxxxxxxxx>
Subject: Re: [Xen-devel] [PATCH] add support for XCHG instruction accessing APIC
From: Keir Fraser <Keir.Fraser@xxxxxxxxxxxx>
Date: Wed, 5 Apr 2006 11:17:58 +0100
Cc: xen-devel@xxxxxxxxxxxxxxxxxxx, Boris Ostrovsky <bostrovsky@xxxxxxxxxxxxxxx>
Delivery-date: Wed, 05 Apr 2006 03:17:44 -0700
Envelope-to: www-data@xxxxxxxxxxxxxxxxxx
In-reply-to: <d43f9d2296eda37cc78c872788f160d8@xxxxxxxxxxxx>
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/cgi-bin/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=unsubscribe>
References: <4432E412.1010200@xxxxxxxxxxxxxxx> <d43f9d2296eda37cc78c872788f160d8@xxxxxxxxxxxx>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx

On 5 Apr 2006, at 10:50, Keir Fraser wrote:

32-bit SMP Linux uses xchg instruction to access APIC (see
apic_write_atomic()). Attached is patch that adds support for
this instruction.

The patch also fixes missed dependencies (in xen/Rules.mk) on
header files in include/asm-x86/hvm.

I wonder if it is worth adding the locking? xchg is only used to write to broken APICs -- the OS does not care about the returned value. The APIC is implemented entirely in Xen, so the lock isn't held across an ioreq round-trip to qemu-dm, right?

In fact I'm pretty sure the locking is not needed even if we did care about atomicity. You're only protecting guest accesses from other guest accesses, and each VCPU has its own local APIC model, so there cannot be multiple simultaneous guest accesses to a single local APIC.

 -- Keir


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