qemu-devel
[Top][All Lists]
Advanced

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

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


From: Chris Lalancette
Subject: [Qemu-devel] Re: [PATCH 0/3]: Add UUID command-line option
Date: Mon, 28 Jul 2008 17:09:54 +0200
User-agent: Thunderbird 2.0.0.14 (X11/20080501)

Anthony Liguori wrote:
>> Hm, but that's basically what this does, in combination with the Bochs BIOS.
>> Once the Bochs BIOS reaches the rombios32 code, it makes the calls into the
>> device model VMware backdoor to get the UUID.  Assuming this all succeeds, 
>> the
>> Bochs BIOS then plumbs it into the SMBIOS tables.
>>   
> 
> Are there patches for the Bochs BIOS to do this?  Why wouldn't it just 
> use CMOS to get at the UUID?

Yeah, there's a uuid_probe() function that's already been merged into the Bochs
BIOS, and subsequently to most of the downstream projects (including KVM).

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) {
        uint32_t *uuid_ptr = (uint32_t *)bios_uuid;
        // get uuid
        asm volatile ("outl %%eax, %%dx"
            : "=a" (eax), "=b" (ebx), "=c" (ecx), "=d" (edx)
            : "a" (0x564d5868), "c" (0x13), "d" (0x5658));
        uuid_ptr[0] = eax;
        uuid_ptr[1] = ebx;
        uuid_ptr[2] = ecx;
        uuid_ptr[3] = edx;
    } else
#endif
    {
        // UUID not set
        memset(bios_uuid, 0, 16);
    }
}

Later on in the rombios32 code the bios_uuid[] is used to build up the SMBIOS
tables.

Chris Lalancette




reply via email to

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