From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1NkdRV-0006UX-PM for qemu-devel@nongnu.org; Thu, 25 Feb 2010 08:07:49 -0500 Received: from [199.232.76.173] (port=46281 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NkdRV-0006UP-Fs for qemu-devel@nongnu.org; Thu, 25 Feb 2010 08:07:49 -0500 Received: from Debian-exim by monty-python.gnu.org with spam-scanned (Exim 4.60) (envelope-from ) id 1NkdRT-0002yv-Oi for qemu-devel@nongnu.org; Thu, 25 Feb 2010 08:07:48 -0500 Received: from mx20.gnu.org ([199.232.41.8]:20557) by monty-python.gnu.org with esmtps (TLS-1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1NkdRT-0002yh-FR for qemu-devel@nongnu.org; Thu, 25 Feb 2010 08:07:47 -0500 Received: from mx1.redhat.com ([209.132.183.28]) by mx20.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1NkdRS-0001qY-ME for qemu-devel@nongnu.org; Thu, 25 Feb 2010 08:07:46 -0500 Date: Thu, 25 Feb 2010 15:04:28 +0200 From: "Michael S. Tsirkin" Message-ID: <20100225130427.GA10660@redhat.com> References: <1266524723-21572-1-git-send-email-pbonzini@redhat.com> <1266524723-21572-2-git-send-email-pbonzini@redhat.com> <20100225114048.GB9116@redhat.com> <4B867230.60708@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <4B867230.60708@redhat.com> Subject: [Qemu-devel] Re: [PATCH v2 2/2] get rid of hostregs_helper.h List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Paolo Bonzini Cc: Blue Swirl , qemu-devel@nongnu.org On Thu, Feb 25, 2010 at 01:50:56PM +0100, Paolo Bonzini wrote: > On 02/25/2010 12:40 PM, Michael S. Tsirkin wrote: >> On Thu, Feb 18, 2010 at 11:28:14PM +0200, Blue Swirl wrote: >>>> /* restore global registers */ >>>> -#include "hostregs_helper.h" >>>> + asm(""); >>>> + env = (void *) saved_env_reg; >>>> >> >> Is this sufficient? >> I see __asm__ __volatile__("": : :"memory") in virtio. >> Is memory clobber implied? What about volatile? > > All asms without colons ("old-style") are volatile. Clobbering memory > is not necessary since we are only caring about blocking assignments of > "env", which is by definition in a register Then I think you should add that as a clobber. Otherwise what prevents the compiler from reordering this asm wrt assignments? > (hostregs_helper.h wasn't > clobbering memory either). Maybe it was buggy :) > Paolo