Comments
Patch
@@ -390,20 +390,21 @@ int kvm_arch_init_vcpu(CPUX86State *env)
c = &cpuid_data.entries[cpuid_i++];
memset(c, 0, sizeof(*c));
c->function = KVM_CPUID_SIGNATURE;
- if (!hyperv_enabled()) {
- memcpy(signature, "KVMKVMKVM\0\0\0", 12);
- if (!env->cpuid_hv_level_set) {
- c->eax = 0;
- } else {
- c->eax = env->cpuid_hv_level;
- }
+ if (!env->cpuid_hv_level_set) {
+ c->eax = 0;
} else {
- memcpy(signature, "Microsoft Hv", 12);
c->eax = env->cpuid_hv_level;
}
- c->ebx = signature[0];
- c->ecx = signature[1];
- c->edx = signature[2];
+ if (!env->cpuid_hv_vendor_set) {
+ memcpy(signature, "KVMKVMKVM\0\0\0", 12);
+ c->ebx = signature[0];
+ c->ecx = signature[1];
+ c->edx = signature[2];
+ } else {
+ c->ebx = env->cpuid_hv_vendor1;
+ c->ecx = env->cpuid_hv_vendor2;
+ c->edx = env->cpuid_hv_vendor3;
+ }
c = &cpuid_data.entries[cpuid_i++];
memset(c, 0, sizeof(*c));
@@ -448,7 +449,8 @@ int kvm_arch_init_vcpu(CPUX86State *env)
c->function = HYPERV_CPUID_IMPLEMENT_LIMITS;
c->eax = 0x40;
c->ebx = 0x40;
-
+ }
+ if (env->cpuid_hv_vendor_set) {
c = &cpuid_data.entries[cpuid_i++];
memset(c, 0, sizeof(*c));
c->function = KVM_CPUID_SIGNATURE_NEXT;
Part of "target-i386: Add way to expose VMWare CPUID" Also known as Paravirtualization vendor. This is EBX, ECX, and EDX data for 0x40000000. QEMU knows this is KVM_CPUID_SIGNATURE (0x40000000). If hypervisor vendor is set then add kvm's signature at KVM_CPUID_SIGNATURE_NEXT (0x40000100). Signed-off-by: Don Slutz <Don@CloudSwitch.com> --- target-i386/kvm.c | 26 ++++++++++++++------------ 1 files changed, 14 insertions(+), 12 deletions(-)