[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PULL 49/49] kvm: Allow the Hyper-V vendor ID to be specifi
From: |
Paolo Bonzini |
Subject: |
[Qemu-devel] [PULL 49/49] kvm: Allow the Hyper-V vendor ID to be specified |
Date: |
Fri, 16 Oct 2015 10:50:11 +0200 |
From: Alex Williamson <address@hidden>
According to Microsoft documentation, the signature in the standard
hypervisor CPUID leaf at 0x40000000 identifies the Vendor ID and is
for reporting and diagnostic purposes only. We can therefore allow
the user to change it to whatever they want, within the 12 character
limit. Add a new hyperv-vendor-id option to the -cpu flag to allow
for this, ex:
-cpu host,hv_time,hv_vendor_id=KeenlyKVM
Link: http://msdn.microsoft.com/library/windows/hardware/hh975392
Signed-off-by: Alex Williamson <address@hidden>
Message-Id: <address@hidden>
[Do not abort. - Paolo]
Signed-off-by: Paolo Bonzini <address@hidden>
---
target-i386/cpu-qom.h | 1 +
target-i386/cpu.c | 1 +
target-i386/kvm.c | 13 ++++++++++++-
3 files changed, 14 insertions(+), 1 deletion(-)
diff --git a/target-i386/cpu-qom.h b/target-i386/cpu-qom.h
index 9eab41b..e3bfe9d 100644
--- a/target-i386/cpu-qom.h
+++ b/target-i386/cpu-qom.h
@@ -88,6 +88,7 @@ typedef struct X86CPU {
bool hyperv_vapic;
bool hyperv_relaxed_timing;
int hyperv_spinlock_attempts;
+ char *hyperv_vendor_id;
bool hyperv_time;
bool hyperv_crash;
bool hyperv_reset;
diff --git a/target-i386/cpu.c b/target-i386/cpu.c
index d2b0619..5f53af2 100644
--- a/target-i386/cpu.c
+++ b/target-i386/cpu.c
@@ -3149,6 +3149,7 @@ static Property x86_cpu_properties[] = {
DEFINE_PROP_UINT32("level", X86CPU, env.cpuid_level, 0),
DEFINE_PROP_UINT32("xlevel", X86CPU, env.cpuid_xlevel, 0),
DEFINE_PROP_UINT32("xlevel2", X86CPU, env.cpuid_xlevel2, 0),
+ DEFINE_PROP_STRING("hv-vendor-id", X86CPU, hyperv_vendor_id),
DEFINE_PROP_END_OF_LIST()
};
diff --git a/target-i386/kvm.c b/target-i386/kvm.c
index 010ac51..e9f1779 100644
--- a/target-i386/kvm.c
+++ b/target-i386/kvm.c
@@ -505,7 +505,18 @@ int kvm_arch_init_vcpu(CPUState *cs)
if (hyperv_enabled(cpu)) {
c = &cpuid_data.entries[cpuid_i++];
c->function = HYPERV_CPUID_VENDOR_AND_MAX_FUNCTIONS;
- memcpy(signature, "Microsoft Hv", 12);
+ if (!cpu->hyperv_vendor_id) {
+ memcpy(signature, "Microsoft Hv", 12);
+ } else {
+ size_t len = strlen(cpu->hyperv_vendor_id);
+
+ if (len > 12) {
+ fprintf(stderr,
+ "hyperv-vendor-id too long, limited to 12 charaters");
+ }
+ memset(signature, 0, 12);
+ memcpy(signature, cpu->hyperv_vendor_id, len);
+ }
c->eax = HYPERV_CPUID_MIN;
c->ebx = signature[0];
c->ecx = signature[1];
--
2.5.0
- [Qemu-devel] [PULL 40/49] qemu-char: convert spice backend to data-driven creation, (continued)
- [Qemu-devel] [PULL 40/49] qemu-char: convert spice backend to data-driven creation, Paolo Bonzini, 2015/10/16
- [Qemu-devel] [PULL 41/49] qemu-char: convert vc backend to data-driven creation, Paolo Bonzini, 2015/10/16
- [Qemu-devel] [PULL 36/49] qemu-char: convert braille backend to data-driven creation, Paolo Bonzini, 2015/10/16
- [Qemu-devel] [PULL 38/49] qemu-char: convert stdio backend to data-driven creation, Paolo Bonzini, 2015/10/16
- [Qemu-devel] [PULL 39/49] qemu-char: convert console backend to data-driven creation, Paolo Bonzini, 2015/10/16
- [Qemu-devel] [PULL 42/49] qemu-char: convert ringbuf backend to data-driven creation, Paolo Bonzini, 2015/10/16
- [Qemu-devel] [PULL 44/49] doc/rcu: fix g_free_rcu() usage example, Paolo Bonzini, 2015/10/16
- [Qemu-devel] [PULL 48/49] kvm: Move x86-specific functions into target-i386/kvm.c, Paolo Bonzini, 2015/10/16
- [Qemu-devel] [PULL 45/49] kvm: Make KVM_CAP_SIGNAL_MSI globally available, Paolo Bonzini, 2015/10/16
- [Qemu-devel] [PULL 46/49] hw/pci: Introduce pci_requester_id(), Paolo Bonzini, 2015/10/16
- [Qemu-devel] [PULL 49/49] kvm: Allow the Hyper-V vendor ID to be specified,
Paolo Bonzini <=
- [Qemu-devel] [PULL 47/49] kvm: Pass PCI device pointer to MSI routing functions, Paolo Bonzini, 2015/10/16
- Re: [Qemu-devel] [PULL 00/49] Misc patches for 2015-10-16, Paolo Bonzini, 2015/10/16