qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Qemu-devel] Re: Re: [PATCH 0/3]: Add UUID command-line option


From: Sebastian Herbszt
Subject: [Qemu-devel] Re: Re: [PATCH 0/3]: Add UUID command-line option
Date: Thu, 31 Jul 2008 21:45:41 +0200

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





reply via email to

[Prev in Thread] Current Thread [Next in Thread]