From mboxrd@z Thu Jan 1 00:00:00 1970 From: Jeremy Fitzhardinge Subject: Re: [PATCH 3/16] read/write_crX, clts and wbinvd for 64-bit paravirt Date: Thu, 01 Nov 2007 08:30:59 -0700 Message-ID: <4729F133.3060308@goop.org> References: <1193858101367-git-send-email-gcosta@redhat.com> <11938581073775-git-send-email-gcosta@redhat.com> <11938581133479-git-send-email-gcosta@redhat.com> <1193858118284-git-send-email-gcosta@redhat.com> <47295AA7.9090507@goop.org> <4729D92E.2030108@redhat.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Cc: zach-pghWNbHTmq7QT0dZR+AlfA@public.gmane.org, lguest-mnsaURCQ41sdnm+yROfE0A@public.gmane.org, kvm-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org, linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, avi-atKUWr5tajBWk0Htik3J/w@public.gmane.org, ak-l3A5Bk7waGM@public.gmane.org, akpm-de/tnXTf+JLsfHDXvbKv3WD2FQJk+8+b@public.gmane.org, virtualization-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA@public.gmane.org To: Glauber de Oliveira Costa Return-path: In-Reply-To: <4729D92E.2030108-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org> 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 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. > Yet, I agree with you that > the theorectical problem exists for the reorder, and your proposed fix > seems fine (although if we're really desperate about memory usage, we > can use a char instead a int and save 3 bytes!) Sure. Ideally the compiler would never even generate a reference to it, and it could just be extern, but in practice the compiler will generate references sometimes. J ------------------------------------------------------------------------- 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/