qemu-devel
[Top][All Lists]
Advanced

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

[Qemu-devel] [PATCH v7 11/17] target-i386: Use Hypervisor vendor in -mac


From: Don Slutz
Subject: [Qemu-devel] [PATCH v7 11/17] target-i386: Use Hypervisor vendor in -machine pc, accel=kvm.
Date: Fri, 12 Oct 2012 15:56:16 -0400

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 <address@hidden>
---
 target-i386/kvm.c |   26 ++++++++++++++------------
 1 files changed, 14 insertions(+), 12 deletions(-)

diff --git a/target-i386/kvm.c b/target-i386/kvm.c
index 30963e1..513356d 100644
--- a/target-i386/kvm.c
+++ b/target-i386/kvm.c
@@ -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;
-- 
1.7.1




reply via email to

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