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] Re: [PATCH 03 of 36] x86: add memory barriers to wrmsr

To: Arjan van de Ven <arjan@xxxxxxxxxxxxx>
Subject: [Xen-devel] Re: [PATCH 03 of 36] x86: add memory barriers to wrmsr
From: Jeremy Fitzhardinge <jeremy@xxxxxxxx>
Date: Wed, 25 Jun 2008 14:08:57 -0700
Cc: Mark McLoughlin <markmc@xxxxxxxxxx>, xen-devel <xen-devel@xxxxxxxxxxxxxxxxxxx>, Eduardo Habkost <ehabkost@xxxxxxxxxx>, Stephen Tweedie <sct@xxxxxxxxxx>, x86@xxxxxxxxxx, LKML <linux-kernel@xxxxxxxxxxxxxxx>, Ingo Molnar <mingo@xxxxxxx>
Delivery-date: Wed, 25 Jun 2008 14:09:34 -0700
Envelope-to: www-data@xxxxxxxxxxxxxxxxxx
In-reply-to: <20080624214441.13202f12@xxxxxxxxxxxxx>
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: <patchbomb.1214367536@localhost> <93c7057b1f4acae501b2.1214367539@localhost> <20080624214441.13202f12@xxxxxxxxxxxxx>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
User-agent: Thunderbird 2.0.0.14 (X11/20080501)
Arjan van de Ven wrote:
it's more readable for several of these cases to stick a barrier(); in
front and after it to be honest; that makes it more explicit that
these are deliberate compiler barriers rather than "actual" memory
access...


I suppose, though I would be inclined to put the barriers in the wrmsr macro itself to act as documentation. Either way, I don't think there's any legitimate reason to let the compiler reorder things around a wrmsr, and it should be an inherent property of the macro, rather than relying on ad-hoc barriers where it gets used. After all, that's a fairly accurate reflection of how the micro-architecture treats wrmsr...

   J

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