qemu-devel
[Top][All Lists]
Advanced

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

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


From: Jamie Lokier
Subject: Re: [Qemu-devel] Re: [PATCH 0/3]: Add UUID command-line option
Date: Mon, 28 Jul 2008 16:48:50 +0100
User-agent: Mutt/1.5.13 (2006-08-11)

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




reply via email to

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