From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1Md5Zh-00032F-L1 for qemu-devel@nongnu.org; Mon, 17 Aug 2009 13:00:49 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1Md5Zd-0002xu-2N for qemu-devel@nongnu.org; Mon, 17 Aug 2009 13:00:49 -0400 Received: from [199.232.76.173] (port=57342 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Md5Zc-0002xh-Sz for qemu-devel@nongnu.org; Mon, 17 Aug 2009 13:00:44 -0400 Received: from mail.gmx.net ([213.165.64.20]:44730) by monty-python.gnu.org with smtp (Exim 4.60) (envelope-from ) id 1Md5Zb-0003a8-Lj for qemu-devel@nongnu.org; Mon, 17 Aug 2009 13:00:44 -0400 Date: Mon, 17 Aug 2009 19:00:41 +0200 From: Reimar =?iso-8859-1?Q?D=F6ffinger?= Message-ID: <20090817170041.GC1835@1und1.de> References: <20090817144754.GA31553@1und1.de> <4A89730F.7090206@codemonkey.ws> <20090817154557.GB365@1und1.de> <4A8988DB.3040108@gnu.org> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <4A8988DB.3040108@gnu.org> Subject: [Qemu-devel] Re: [HACK] make vmmouse work with KVM List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org On Mon, Aug 17, 2009 at 06:44:11PM +0200, Paolo Bonzini wrote: > On 08/17/2009 05:45 PM, Reimar Döffinger wrote: > > + cpu_synchronize_state(env, 0); > > env->regs[R_EAX] = vmport_ioport_read(opaque, addr); > > + cpu_synchronize_state(env, 1); > > This is not needed because the sync is done in vmport_ioport_read, isn't it? Well... The cpu_synchronize_state could be dropped you are right, but here we write R_EAX so the cpu_synchronize_state(env, 1) is necessary. Want me to remove the cpu_synchronize_state(env, 0)? It all seems a bit messy, because despite the "synchronize" name of the function any change to the registers before the call to vmport_ioport_read would be overwritten by the cpu_synchronize_state in there. It might be slightly cleaner to rename the vmport_ioport_read (any name suggestions?) and add a wrapper for register_ioport_read that does the cpu_synchronize_state (so it looks similar to vmport_ioport_write). Greetings, Reimar Döffinger