From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1K1Kwl-0003MV-Vb for qemu-devel@nongnu.org; Wed, 28 May 2008 08:40:04 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1K1Kwj-0003Lm-Bm for qemu-devel@nongnu.org; Wed, 28 May 2008 08:40:03 -0400 Received: from [199.232.76.173] (port=38088 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1K1Kwj-0003Lg-4J for qemu-devel@nongnu.org; Wed, 28 May 2008 08:40:01 -0400 Received: from mail2.shareable.org ([80.68.89.115]:53612) by monty-python.gnu.org with esmtps (TLS-1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1K1Kwi-0007q5-Uc for qemu-devel@nongnu.org; Wed, 28 May 2008 08:40:01 -0400 Received: from jamie by mail2.shareable.org with local (Exim 4.63) (envelope-from ) id 1K1Kwi-0005Oh-0l for qemu-devel@nongnu.org; Wed, 28 May 2008 13:40:00 +0100 Date: Wed, 28 May 2008 13:39:59 +0100 From: Jamie Lokier Subject: Re: [Qemu-devel] Threading Qemu Message-ID: <20080528123959.GD19738@shareable.org> References: <20080527233155.d05f3f7a3b090fc6839dcb689abb911d.486e192adc.wbe@email.secureserver.net> <483D0C78.8020406@qumranet.com> <483D4FC8.5080708@bellard.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <483D4FC8.5080708@bellard.org> Reply-To: qemu-devel@nongnu.org List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Fabrice Bellard wrote: > I confirm, the general case is quite complicated. It is simpler to begin > with an implementation where the host and guest CPUs have the same > memory ordering constraints (e.g. x86 on x86 case). I have just realised it is not _always_ correct even for x86 on x86, for some flavours of x86 host CPU. Qemu emulates a standard x86 with writes fully ordered. Guest code will assume that. But a few types of x86 host don't fully order writes. See CONFIG_X86_OOSTORE and CONFIG_X86_PPRO_FENCE in Linux kernels - look in linux/arch/x86/Kconfig.cpu. On those, running multiple target CPUs as host threads on a multiprocessor host may not be correct. I'm not sure if the "sfence" instruction means this could apply to some modern, mainstream x86 hosts too. -- Jamie