diff mbox

[for-2.6] target-i386: KVM loves Hyper-V!

Message ID 1459498682-3871-1-git-send-email-pbonzini@redhat.com (mailing list archive)
State New, archived
Headers show

Commit Message

Paolo Bonzini April 1, 2016, 8:18 a.m. UTC
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 <afaerber@suse.de>
Cc: Alex Williamson <alex.williamson@redhat.com>
Cc: Denis V. Lunev <den@openvz.org>
Cc: Eduardo Habkost <ehabkost@redhat.com>
Cc: Roman Kagan <rkagan@virtuozzo.com>
Cc: KY Srinivasan <kys@microsoft.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
---
 target-i386/kvm.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Denis V. Lunev April 1, 2016, 8:36 a.m. UTC | #1
On 04/01/2016 11:18 AM, Paolo Bonzini wrote:
> 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 <afaerber@suse.de>
> Cc: Alex Williamson <alex.williamson@redhat.com>
> Cc: Denis V. Lunev <den@openvz.org>
> Cc: Eduardo Habkost <ehabkost@redhat.com>
> Cc: Roman Kagan <rkagan@virtuozzo.com>
> Cc: KY Srinivasan <kys@microsoft.com>
> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
> ---
>   target-i386/kvm.c | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/target-i386/kvm.c b/target-i386/kvm.c
> index 799fdfa..1968f04 100644
> --- a/target-i386/kvm.c
> +++ b/target-i386/kvm.c
> @@ -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.
Daniel P. Berrangé April 1, 2016, 8:58 a.m. UTC | #2
On Fri, Apr 01, 2016 at 10:18:02AM +0200, Paolo Bonzini wrote:
> 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 <afaerber@suse.de>
> Cc: Alex Williamson <alex.williamson@redhat.com>
> Cc: Denis V. Lunev <den@openvz.org>
> Cc: Eduardo Habkost <ehabkost@redhat.com>
> Cc: Roman Kagan <rkagan@virtuozzo.com>
> Cc: KY Srinivasan <kys@microsoft.com>
> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
> ---
>  target-i386/kvm.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/target-i386/kvm.c b/target-i386/kvm.c
> index 799fdfa..1968f04 100644
> --- a/target-i386/kvm.c
> +++ b/target-i386/kvm.c
> @@ -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
Paolo Bonzini April 1, 2016, 9:06 a.m. UTC | #3
On 01/04/2016 10:58, Daniel P. Berrange wrote:
> On Fri, Apr 01, 2016 at 10:18:02AM +0200, Paolo Bonzini wrote:
>> 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 <afaerber@suse.de>
>> Cc: Alex Williamson <alex.williamson@redhat.com>
>> Cc: Denis V. Lunev <den@openvz.org>
>> Cc: Eduardo Habkost <ehabkost@redhat.com>
>> Cc: Roman Kagan <rkagan@virtuozzo.com>
>> Cc: KY Srinivasan <kys@microsoft.com>
>> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
>> ---
>>  target-i386/kvm.c | 2 +-
>>  1 file changed, 1 insertion(+), 1 deletion(-)
>>
>> diff --git a/target-i386/kvm.c b/target-i386/kvm.c
>> index 799fdfa..1968f04 100644
>> --- a/target-i386/kvm.c
>> +++ b/target-i386/kvm.c
>> @@ -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);

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

Paolo
Roman Kagan April 1, 2016, 10:13 a.m. UTC | #4
On Fri, Apr 01, 2016 at 10:18:02AM +0200, Paolo Bonzini wrote:
> 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 <afaerber@suse.de>
> Cc: Alex Williamson <alex.williamson@redhat.com>
> Cc: Denis V. Lunev <den@openvz.org>
> Cc: Eduardo Habkost <ehabkost@redhat.com>
> Cc: Roman Kagan <rkagan@virtuozzo.com>
> Cc: KY Srinivasan <kys@microsoft.com>
> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
> ---
>  target-i386/kvm.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/target-i386/kvm.c b/target-i386/kvm.c
> index 799fdfa..1968f04 100644
> --- a/target-i386/kvm.c
> +++ b/target-i386/kvm.c
> @@ -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 <rkagan@virtuozzo.com>
Michael Roth April 1, 2016, 2:12 p.m. UTC | #5
Quoting Paolo Bonzini (2016-04-01 03:18:02)
> 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 qemu-stable@nongnu.org

> 
> Cc: Andreas Färber <afaerber@suse.de>
> Cc: Alex Williamson <alex.williamson@redhat.com>
> Cc: Denis V. Lunev <den@openvz.org>
> Cc: Eduardo Habkost <ehabkost@redhat.com>
> Cc: Roman Kagan <rkagan@virtuozzo.com>
> Cc: KY Srinivasan <kys@microsoft.com>
> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
> ---
>  target-i386/kvm.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/target-i386/kvm.c b/target-i386/kvm.c
> index 799fdfa..1968f04 100644
> --- a/target-i386/kvm.c
> +++ b/target-i386/kvm.c
> @@ -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
> 
>
KY Srinivasan April 1, 2016, 8:28 p.m. UTC | #6
> -----Original Message-----

> From: Paolo Bonzini [mailto:paolo.bonzini@gmail.com] On Behalf Of Paolo

> Bonzini

> Sent: Friday, April 1, 2016 1:18 AM

> To: qemu-devel@nongnu.org

> Cc: Andreas Färber <afaerber@suse.de>; Alex Williamson

> <alex.williamson@redhat.com>; Denis V. Lunev <den@openvz.org>;

> Eduardo Habkost <ehabkost@redhat.com>; Roman Kagan

> <rkagan@virtuozzo.com>; KY Srinivasan <kys@microsoft.com>

> Subject: [PATCH for-2.6] 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!


It is Spring; love is in the air! 

K. Y
> 

> Cc: Andreas Färber <afaerber@suse.de>

> Cc: Alex Williamson <alex.williamson@redhat.com>

> Cc: Denis V. Lunev <den@openvz.org>

> Cc: Eduardo Habkost <ehabkost@redhat.com>

> Cc: Roman Kagan <rkagan@virtuozzo.com>

> Cc: KY Srinivasan <kys@microsoft.com>

> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>

> ---

>  target-i386/kvm.c | 2 +-

>  1 file changed, 1 insertion(+), 1 deletion(-)

> 

> diff --git a/target-i386/kvm.c b/target-i386/kvm.c

> index 799fdfa..1968f04 100644

> --- a/target-i386/kvm.c

> +++ b/target-i386/kvm.c

> @@ -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
diff mbox

Patch

diff --git a/target-i386/kvm.c b/target-i386/kvm.c
index 799fdfa..1968f04 100644
--- a/target-i386/kvm.c
+++ b/target-i386/kvm.c
@@ -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);