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);
}
}