From mboxrd@z Thu Jan 1 00:00:00 1970 From: Glauber de Oliveira Costa Subject: Re: [PATCH 3/16] read/write_crX, clts and wbinvd for 64-bit paravirt Date: Thu, 01 Nov 2007 14:13:55 -0200 Message-ID: <4729FB43.1010904@redhat.com> References: Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Cc: Jeremy Fitzhardinge , akpm-de/tnXTf+JLsfHDXvbKv3WD2FQJk+8+b@public.gmane.org, kvm-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org, ak-l3A5Bk7waGM@public.gmane.org, linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, lguest-mnsaURCQ41sdnm+yROfE0A@public.gmane.org, virtualization-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA@public.gmane.org To: Keir Fraser Return-path: In-Reply-To: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: kvm-devel-bounces-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org Errors-To: kvm-devel-bounces-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org List-Id: kvm.vger.kernel.org -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Keir Fraser escreveu: > On 1/11/07 15:30, "Jeremy Fitzhardinge" wrote: > >> Glauber de Oliveira Costa wrote: >>> I in fact have seen bugs with mixed reads and writes to the same cr, >>> (cr4), but adding the volatile >>> flag to the read function seemed to fix it. >> Well, volatile will make a read be repeated rather than caching the >> previous value, but it has no effect on ordering. > > volatile prevents the asm from being 'moved significantly', according to the > gcc manual. I take that to mean that reordering is not allowed. > According to a gcc developer to whom I asked this question, volatile prevents the code to be removed, but does not prevent it to be moved (pun indented). In practice, it should force a re-read, but not influence the ordering decisions from the compiler. Besides , 'significantly' sounds like a significantly unprecise word, whose specific meaning may be implementation dependant. So I agree that adding a memory location reference is probably the best alternative. -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.7 (GNU/Linux) Comment: Using GnuPG with Remi - http://enigmail.mozdev.org iD8DBQFHKftDjYI8LaFUWXMRAiLTAKDqf/M8umNYw6u7r9ONozTEUVy8SwCgygma jWNKQmxmLpyPxr00KbQy9Vg= =JM4K -----END PGP SIGNATURE----- ------------------------------------------------------------------------- This SF.net email is sponsored by: Splunk Inc. Still grepping through log files to find problems? Stop. Now Search log events and configuration files using AJAX and a browser. Download your FREE copy of Splunk now >> http://get.splunk.com/