From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1KNUy5-0000bx-2C for qemu-devel@nongnu.org; Mon, 28 Jul 2008 11:49:01 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1KNUy1-0000ZH-L9 for qemu-devel@nongnu.org; Mon, 28 Jul 2008 11:49:00 -0400 Received: from [199.232.76.173] (port=46368 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1KNUy1-0000Yu-AU for qemu-devel@nongnu.org; Mon, 28 Jul 2008 11:48:57 -0400 Received: from mail2.shareable.org ([80.68.89.115]:34024) by monty-python.gnu.org with esmtps (TLS-1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1KNUy1-0004GS-50 for qemu-devel@nongnu.org; Mon, 28 Jul 2008 11:48:57 -0400 Date: Mon, 28 Jul 2008 16:48:50 +0100 From: Jamie Lokier Subject: Re: [Qemu-devel] Re: [PATCH 0/3]: Add UUID command-line option Message-ID: <20080728154849.GA13000@shareable.org> References: <488DC8B2.1070009@redhat.com> <20080728141515.GJ3196@minantech.com> <488DD98D.5010907@codemonkey.ws> <488DDA93.4070702@redhat.com> <488DDF8B.8020103@codemonkey.ws> <488DE142.1060100@redhat.com> <488DE1E0.1070005@codemonkey.ws> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <488DE1E0.1070005@codemonkey.ws> 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 Cc: Gleb Natapov , Chris Lalancette Anthony Liguori wrote: > >void uuid_probe(void) > >{ > >#ifdef BX_QEMU > > uint32_t eax, ebx, ecx, edx; > > > > // check if backdoor port exists > > asm volatile ("outl %%eax, %%dx" > > : "=a" (eax), "=b" (ebx), "=c" (ecx), "=d" (edx) > > : "a" (0x564d5868), "c" (0xa), "d" (0x5658)); > > if (ebx == 0x564d5868) { Has a bug. EBX is not initialised prior to the ASM, and could contain the same value as EAX. If the I/O doesn't do anything (like on a real PC), it could match the condition which says its a backdoor. The ASM should initialise EBX to something else: asm volatile ("outl %%eax, %%dx" : "=a" (eax), "=b" (ebx), "=c" (ecx), "=d" (edx) : "a" (0x564d5868), "b" (0), "c" (0xa), "d" (0x5658)); -- Jamie