From mboxrd@z Thu Jan 1 00:00:00 1970 From: Olaf Hering Subject: Re: [PATCH] tools/libxc: make volatile keyword for bitmap operations optional Date: Mon, 30 Jan 2012 10:10:02 +0100 Message-ID: <20120130091002.GA29543@aepfle.de> References: <5da4c273e819d5a1d42f.1327883776@probook.site> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Content-Disposition: inline In-Reply-To: List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xensource.com Errors-To: xen-devel-bounces@lists.xensource.com To: Keir Fraser Cc: xen-devel@lists.xensource.com List-Id: xen-devel@lists.xenproject.org On Mon, Jan 30, Keir Fraser wrote: > On 30/01/2012 00:36, "Olaf Hering" wrote: > > > # HG changeset patch > > # User Olaf Hering > > # Date 1327883694 -3600 > > # Node ID 5da4c273e819d5a1d42f3186f0829f8e00d83132 > > # Parent b06617b0398c73c63ce153f39464fd1edac788e5 > > tools/libxc: make volatile keyword for bitmap operations optional > > > > Except for xc_save, all bitmaps maintained by xc_bitops.h are used in single > > threaded applications. So nothing will change the bitmaps content, adding > > volatile adds just unneeded memory reloads. > > The bitops aren't threadsafe anyway, as none of them use atomic rmw > instructions. I suspect the volatile declarations are completely pointless > and can just be removed. Will gcc use the right thing if the array is passed to the hyperviso, and will it reload everything after the hypercall? If yes, the volatile can indeed go. Olaf