From: Jeremy Fitzhardinge Subject: Re: [PATCH 03 of 36] x86: add memory barriers to wrmsr Date: Wed, 25 Jun 2008 14:08:57 -0700 Message-ID: <4862B3E9.50601@goop.org> References: <93c7057b1f4acae501b2.1214367539@localhost> <20080624214441.13202f12@infradead.org> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <20080624214441.13202f12@infradead.org> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xensource.com Errors-To: xen-devel-bounces@lists.xensource.com To: Arjan van de Ven Cc: Mark McLoughlin , xen-devel , Eduardo Habkost , Stephen Tweedie , x86@kernel.org, LKML , Ingo Molnar List-Id: xen-devel@lists.xenproject.org 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