From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1KOe8M-00017m-CB for qemu-devel@nongnu.org; Thu, 31 Jul 2008 15:48:22 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1KOe8K-000148-Hm for qemu-devel@nongnu.org; Thu, 31 Jul 2008 15:48:21 -0400 Received: from [199.232.76.173] (port=42879 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1KOe8K-00013u-DD for qemu-devel@nongnu.org; Thu, 31 Jul 2008 15:48:20 -0400 Received: from mail.gmx.net ([213.165.64.20]:47940) by monty-python.gnu.org with smtp (Exim 4.60) (envelope-from ) id 1KOe8J-0005Rv-KO for qemu-devel@nongnu.org; Thu, 31 Jul 2008 15:48:20 -0400 Message-ID: <02e701c8f346$5cb38bb0$0201a8c0@zeug> From: "Sebastian Herbszt" 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> <20080728154849.GA13000@shareable.org> Date: Thu, 31 Jul 2008 21:45:41 +0200 MIME-Version: 1.0 Content-Type: text/plain; format=flowed; charset="iso-8859-1"; reply-type=original Content-Transfer-Encoding: 7bit Subject: [Qemu-devel] Re: Re: [PATCH 0/3]: Add UUID command-line option 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, Jamie Lokier Cc: Gleb Natapov , Chris Lalancette Jamie Lokier 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)); Fixed in cvs (rombios32.c r1.29) now. Thanks for spotting it. - Sebastian