Index: x86.c =================================================================== --- x86.c (revision 270344) +++ x86.c (working copy) @@ -215,7 +215,7 @@ break; case CPUID_0000_0004: - do_cpuid(4, regs); + cpuid_count(4, *ecx, regs); /* * Do not expose topology. @@ -230,7 +230,7 @@ * Therefore 0 for both indicates 1 core per * package and no cache sharing. */ - regs[0] &= 0xffff8000; + regs[0] &= 0x1ff; break; case CPUID_0000_0007: @@ -286,8 +286,15 @@ */ regs[0] = 0; regs[1] = 0; - regs[2] = *ecx & 0xff; - regs[3] = vcpu_id; + regs[2] = *ecx & 0xff; /* level number */ + regs[3] = 0; + + if (*ecx == 0) { + regs[0] = 0; /* 1 core per package */ + regs[1] = VM_MAXCPU; + regs[2] |= CPUID_TYPE_CORE << 8; + regs[3] = vcpu_id; /* x2APIC ID of vcpu */ + } break; case CPUID_0000_000D: