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/
Home Products Support Community News


Re: [Xen-devel] [PATCH] hvm emul: fix cmpxchg emulation to use an atomic

To: Patrick Colp <Patrick.Colp@xxxxxxxxxx>, "xen-devel@xxxxxxxxxxxxxxxxxxx" <xen-devel@xxxxxxxxxxxxxxxxxxx>
Subject: Re: [Xen-devel] [PATCH] hvm emul: fix cmpxchg emulation to use an atomic operation
From: Keir Fraser <keir.fraser@xxxxxxxxxxxxx>
Date: Thu, 06 Aug 2009 11:55:57 +0100
Delivery-date: Thu, 06 Aug 2009 03:56:25 -0700
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
In-reply-to: <684c8fc69d658d058246.1249555224@xxxxxxxxxxxxxxxxxxxxxxxx>
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
Thread-index: AcoWgqnU11taaMaCR9mdAT+AZfSbkgAAdAQQ
Thread-topic: [Xen-devel] [PATCH] hvm emul: fix cmpxchg emulation to use an atomic operation
User-agent: Microsoft-Entourage/
On 06/08/2009 11:40, "Patrick Colp" <Patrick.Colp@xxxxxxxxxx> wrote:

> # HG changeset patch
> # User Patrick Colp <Patrick.Colp@xxxxxxxxxx>
> # Date 1249555177 -3600
> # Node ID 684c8fc69d658d058246eb9edfc8eba187ae6f2c
> # Parent  68e8b8379244e293c55875e7dc3692fc81d3d212
> hvm emul: fix cmpxchg emulation to use an atomic operation.
> Currently HVM cmpxchg emulation is done by doing a normal emulated write,
> which is not atomic. This patch changes it to use a cmpxchg operation
> instead, which is atomic.

Has this been causing problems?

Also this looks rather similar to some shadow-pagetable code. Why is it not

A further problem is that this is a regression for emulated atomic ops to
devices. This does happen in some cases (e.g., Linux writes to APIC
registers with XCHG in some cases, which will trigger the ->cmpxchg hook).
These will now fail outright.

Overall, I'm not super-fussed to touch this at all, and certainly not unless
code can be shared and fallback paths implemented.

If you can share the code in its current location (in shadow code) that
would be better for me as it makes the patch smaller. I can then do the
trivial code relocation myself as a second patch.

 -- Keir

Xen-devel mailing list

<Prev in Thread] Current Thread [Next in Thread>