Skip to contentSkip to conversation

target-i386: KVM loves Hyper-V!

PATCH In review Paolo Bonzini 6 participants 7 messages Apr 1, 2016

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 target-i386: KVM loves Hyper-V!

Microsoft loves Linux, and Red Hat loves .NET. Since we can put whatever we want in the Hyper-V vendor signature, let's show some love too!

Cc Andreas Färber <[email protected]>
Cc Alex Williamson <[email protected]>
Cc Denis V. Lunev <[email protected]>
Cc Eduardo Habkost <[email protected]>
Cc Roman Kagan <[email protected]>
Cc KY Srinivasan <[email protected]>
---
 target-i386/kvm.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
target-i386/kvm.c +1 -1
index 799fdfa..1968f04 100644
@@ -592,7 +592,7 @@ int kvm_arch_init_vcpu(CPUState *cs)
         c = &cpuid_data.entries[cpuid_i++];
         c->function = HYPERV_CPUID_VENDOR_AND_MAX_FUNCTIONS;
         if (!cpu->hyperv_vendor_id) {
-            memcpy(signature, "Microsoft Hv", 12);
+            memcpy(signature, "KVM<3HyperV!", 12);
         } else {
             size_t len = strlen(cpu->hyperv_vendor_id);
 
Signature · 1 line
2.5.5
#1 lore raw
Quoted 19 lines · Paolo Bonzini

Microsoft loves Linux, and Red Hat loves .NET. Since we can put whatever we want in the Hyper-V vendor signature, let's show some love too!

Cc Andreas Färber <[email protected]>
Cc Alex Williamson <[email protected]>
Cc Denis V. Lunev <[email protected]>
Cc Eduardo Habkost <[email protected]>
Cc Roman Kagan <[email protected]>
Cc KY Srinivasan <[email protected]>
---
  target-i386/kvm.c | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)
target-i386/kvm.c +0 -0
index 799fdfa..1968f04 100644

target-i386/kvm.c int kvm_arch_init_vcpu(CPUState *cs) · line 598

Quoted 8 lines
target-i386/kvm.c +1 -1
@@ -592,7 +592,7 @@ int kvm_arch_init_vcpu(CPUState *cs)
          c = &cpuid_data.entries[cpuid_i++];
          c->function = HYPERV_CPUID_VENDOR_AND_MAX_FUNCTIONS;
          if (!cpu->hyperv_vendor_id) {
-            memcpy(signature, "Microsoft Hv", 12);
+            memcpy(signature, "KVM<3HyperV!", 12);
          } else {
              size_t len = strlen(cpu->hyperv_vendor_id);
 

potentially this could be dangerous. This could break hypervisor detection code. I'll check this today and reply.

But you have made my day. Thank you for April 1.

#2 lore raw
In reply to Paolo Bonzini
Quoted 19 lines · Paolo Bonzini

Microsoft loves Linux, and Red Hat loves .NET. Since we can put whatever we want in the Hyper-V vendor signature, let's show some love too!

Cc Andreas Färber <[email protected]>
Cc Alex Williamson <[email protected]>
Cc Denis V. Lunev <[email protected]>
Cc Eduardo Habkost <[email protected]>
Cc Roman Kagan <[email protected]>
Cc KY Srinivasan <[email protected]>
---
 target-i386/kvm.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
target-i386/kvm.c +0 -0
index 799fdfa..1968f04 100644

target-i386/kvm.c int kvm_arch_init_vcpu(CPUState *cs) · line 595

Quoted 5 lines
target-i386/kvm.c +1 -1
@@ -592,7 +592,7 @@ int kvm_arch_init_vcpu(CPUState *cs)
         c = &cpuid_data.entries[cpuid_i++];
         c->function = HYPERV_CPUID_VENDOR_AND_MAX_FUNCTIONS;
         if (!cpu->hyperv_vendor_id) {
-            memcpy(signature, "Microsoft Hv", 12);
+            memcpy(signature, "KVM<3HyperV!", 12);

I think it'd be nicer to use the unicode heart symbol ♡ encoded as utf-8 eg

  memcpy(signature, "KVM\xe2\x99\xa1HyperV", 12);

Regards,
Daniel

Signature · 4 lines
|: http://berrange.com      -o-    http://www.flickr.com/photos/dberrange/ :|
|: http://libvirt.org              -o-             http://virt-manager.org :|
|: http://autobuild.org       -o-         http://search.cpan.org/~danberr/ :|
|: http://entangle-photo.org       -o-       http://live.gnome.org/gtk-vnc :|
#3 lore raw
Quoted 29 lines · Daniel P. Berrange
Quoted 19 lines · Paolo Bonzini

Microsoft loves Linux, and Red Hat loves .NET. Since we can put whatever we want in the Hyper-V vendor signature, let's show some love too!

Cc Andreas Färber <[email protected]>
Cc Alex Williamson <[email protected]>
Cc Denis V. Lunev <[email protected]>
Cc Eduardo Habkost <[email protected]>
Cc Roman Kagan <[email protected]>
Cc KY Srinivasan <[email protected]>
---
 target-i386/kvm.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
target-i386/kvm.c +0 -0
index 799fdfa..1968f04 100644

target-i386/kvm.c int kvm_arch_init_vcpu(CPUState *cs) · line 595

Quoted 5 lines
target-i386/kvm.c +1 -1
@@ -592,7 +592,7 @@ int kvm_arch_init_vcpu(CPUState *cs)
         c = &cpuid_data.entries[cpuid_i++];
         c->function = HYPERV_CPUID_VENDOR_AND_MAX_FUNCTIONS;
         if (!cpu->hyperv_vendor_id) {
-            memcpy(signature, "Microsoft Hv", 12);
+            memcpy(signature, "KVM<3HyperV!", 12);

I think it'd be nicer to use the unicode heart symbol ♡ encoded as utf-8 eg

Quoted 1 line
  memcpy(signature, "KVM\xe2\x99\xa1HyperV", 12);

I'll try to get v2 ready in the next 13 hours and 53 minutes.

Paolo

#4 lore raw
In reply to Paolo Bonzini

Quoting Paolo Bonzini (2016-04-01 03:18:02)

Quoted 2 lines

Microsoft loves Linux, and Red Hat loves .NET. Since we can put whatever we want in the Hyper-V vendor signature, let's show some love too!

This might actually fix GPU passthrough for Nvidia cards when Hyper-V is enabled.

Cc'ing [email protected]

Quoted 29 lines
Cc Andreas Färber <[email protected]>
Cc Alex Williamson <[email protected]>
Cc Denis V. Lunev <[email protected]>
Cc Eduardo Habkost <[email protected]>
Cc Roman Kagan <[email protected]>
Cc KY Srinivasan <[email protected]>
---
 target-i386/kvm.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
target-i386/kvm.c +1 -1
index 799fdfa..1968f04 100644
@@ -592,7 +592,7 @@ int kvm_arch_init_vcpu(CPUState *cs)
         c = &cpuid_data.entries[cpuid_i++];
         c->function = HYPERV_CPUID_VENDOR_AND_MAX_FUNCTIONS;
         if (!cpu->hyperv_vendor_id) {
-            memcpy(signature, "Microsoft Hv", 12);
+            memcpy(signature, "KVM<3HyperV!", 12);
         } else {
             size_t len = strlen(cpu->hyperv_vendor_id);
 
Signature · 1 line
2.5.5
#5 lore raw
In reply to Paolo Bonzini
Quoted 19 lines · Paolo Bonzini

Microsoft loves Linux, and Red Hat loves .NET. Since we can put whatever we want in the Hyper-V vendor signature, let's show some love too!

Cc Andreas Färber <[email protected]>
Cc Alex Williamson <[email protected]>
Cc Denis V. Lunev <[email protected]>
Cc Eduardo Habkost <[email protected]>
Cc Roman Kagan <[email protected]>
Cc KY Srinivasan <[email protected]>
---
 target-i386/kvm.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
target-i386/kvm.c +0 -0
index 799fdfa..1968f04 100644

target-i386/kvm.c int kvm_arch_init_vcpu(CPUState *cs) · line 597

Quoted 7 lines
target-i386/kvm.c +1 -1
@@ -592,7 +592,7 @@ int kvm_arch_init_vcpu(CPUState *cs)
         c = &cpuid_data.entries[cpuid_i++];
         c->function = HYPERV_CPUID_VENDOR_AND_MAX_FUNCTIONS;
         if (!cpu->hyperv_vendor_id) {
-            memcpy(signature, "Microsoft Hv", 12);
+            memcpy(signature, "KVM<3HyperV!", 12);
         } else {
             size_t len = strlen(cpu->hyperv_vendor_id);
Sealed-with-a-kiss-by Roman Kagan <[email protected]>
#6 lore raw
In reply to Paolo Bonzini
Quoted 13 lines

-----Original Message-----
From: Paolo Bonzini [mailto:[email protected]] On Behalf Of Paolo Bonzini
Sent: Friday, April 1, 2016 1:18 AM
To: [email protected]
Cc: Andreas Färber <[email protected]>; Alex Williamson <[email protected]>; Denis V. Lunev <[email protected]>; Eduardo Habkost <[email protected]>; Roman Kagan <[email protected]>; KY Srinivasan <[email protected]>
Subject: [PATCH for-2.6] target-i386: KVM loves Hyper-V!

Quoted 2 lines

Microsoft loves Linux, and Red Hat loves .NET. Since we can put whatever we want in the Hyper-V vendor signature, let's show some love too!

It is Spring; love is in the air!

K. Y

Quoted 27 lines
Cc Andreas Färber <[email protected]>
Cc Alex Williamson <[email protected]>
Cc Denis V. Lunev <[email protected]>
Cc Eduardo Habkost <[email protected]>
Cc Roman Kagan <[email protected]>
Cc KY Srinivasan <[email protected]>
---
 target-i386/kvm.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
target-i386/kvm.c +1 -2
index 799fdfa..1968f04 100644
@@ -592,7 +592,7 @@ int kvm_arch_init_vcpu(CPUState *cs)
         c = &cpuid_data.entries[cpuid_i++];
         c->function = HYPERV_CPUID_VENDOR_AND_MAX_FUNCTIONS;
         if (!cpu->hyperv_vendor_id) {
-            memcpy(signature, "Microsoft Hv", 12);
+            memcpy(signature, "KVM<3HyperV!", 12);
         } else {
             size_t len = strlen(cpu->hyperv_vendor_id);
 
--

2.5.5