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: Anthony Liguori
Subject: [Qemu-devel] Re: [PATCH 0/3]: Add UUID command-line option
Date: Mon, 28 Jul 2008 10:12:32 -0500
User-agent: Thunderbird 2.0.0.14 (X11/20080501)

Chris Lalancette wrote:
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);
    }
}

That makes me sad that they merged that. What a terribly complicated way to do something that's relatively simple.

Regards,

Anthony Liguori

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]