Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1757325AbXJCGWJ (ORCPT ); Wed, 3 Oct 2007 02:22:09 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1751787AbXJCGV5 (ORCPT ); Wed, 3 Oct 2007 02:21:57 -0400 Received: from terminus.zytor.com ([198.137.202.10]:39688 "EHLO terminus.zytor.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751648AbXJCGV4 (ORCPT ); Wed, 3 Oct 2007 02:21:56 -0400 Message-ID: <4703342E.3020101@zytor.com> Date: Tue, 02 Oct 2007 23:18:22 -0700 From: "H. Peter Anvin" User-Agent: Thunderbird 2.0.0.5 (X11/20070727) MIME-Version: 1.0 To: Nick Piggin CC: Chuck Ebbert , Arjan van de Ven , Kirill Korotaev , Andrew Morton , Andi Kleen , Linux Kernel Mailing List , devel@openvz.org Subject: Re: [PATCH] mark read_crX() asm code as volatile References: <470250E0.5090706@openvz.org> <20071002082856.3c478e66@laptopd505.fenrus.org> <47028D99.8020100@redhat.com> <200710022214.55381.nickpiggin@yahoo.com.au> In-Reply-To: <200710022214.55381.nickpiggin@yahoo.com.au> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 672 Lines: 27 Nick Piggin wrote: >> >> This should work because the result gets used before reading again: >> >> read_cr3(a); >> write_cr3(a | 1); >> read_cr3(a); >> >> But this might be reordered so that b gets read before the write: >> >> read_cr3(a); >> write_cr3(a | 1); >> read_cr3(b); >> >> ? > > I don't see how, as write_cr3 clobbers memory. Because read_cr3() doesn't depend on memory, and b could be stored in a register. -hpa - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/