Re: [PATCH] x86: properly handle KVM emulation of hyperv

2013-07-19 Thread H. Peter Anvin
On 07/19/2013 02:00 PM, Paolo Bonzini wrote: > Il 19/07/2013 22:59, H. Peter Anvin ha scritto: >> -cpuid(KVM_CPUID_SIGNATURE, , , , ); >> -memcpy(signature + 0, , 4); >> -memcpy(signature + 4, , 4); >> -

Re: [PATCH] x86: properly handle KVM emulation of hyperv

2013-07-19 Thread H. Peter Anvin
On 07/19/2013 05:10 AM, Paolo Bonzini wrote: >> + >> +static inline bool kvm_para_available(void) >> +{ >> if (boot_cpu_data.cpuid_level < 0) >> return false; /* So we don't blow up on old processors */ >> >> if (cpu_has_hypervisor) { >> -

Re: [PATCH] x86: properly handle KVM emulation of hyperv

2013-07-19 Thread Paolo Bonzini
Il 19/07/2013 22:59, H. Peter Anvin ha scritto: >>> >> -cpuid(KVM_CPUID_SIGNATURE, , , , ); >>> >> -memcpy(signature + 0, , 4); >>> >> -memcpy(signature + 4, , 4); >>> >> -memcpy(signature + 8, , 4); >>> >> -

Re: [PATCH] x86: properly handle KVM emulation of hyperv

2013-07-19 Thread Paolo Bonzini
Il 19/07/2013 12:25, Jason Wang ha scritto: > Recent kvm has some basic support of hyperv, this will cause the guest to > identify itself running on top of hyperv instead of kvm which will disable kvm > pv functionality. Solve this by check kvm para platform first and also check >

[PATCH] x86: properly handle KVM emulation of hyperv

2013-07-19 Thread Jason Wang
Recent kvm has some basic support of hyperv, this will cause the guest to identify itself running on top of hyperv instead of kvm which will disable kvm pv functionality. Solve this by check kvm para platform first and also check KVM_CPUID_SIGNATURE_NEXT which were set when kvm emulate hyperv.

[PATCH] x86: properly handle KVM emulation of hyperv

2013-07-19 Thread Jason Wang
Recent kvm has some basic support of hyperv, this will cause the guest to identify itself running on top of hyperv instead of kvm which will disable kvm pv functionality. Solve this by check kvm para platform first and also check KVM_CPUID_SIGNATURE_NEXT which were set when kvm emulate hyperv.

Re: [PATCH] x86: properly handle KVM emulation of hyperv

2013-07-19 Thread Paolo Bonzini
Il 19/07/2013 12:25, Jason Wang ha scritto: Recent kvm has some basic support of hyperv, this will cause the guest to identify itself running on top of hyperv instead of kvm which will disable kvm pv functionality. Solve this by check kvm para platform first and also check

Re: [PATCH] x86: properly handle KVM emulation of hyperv

2013-07-19 Thread Paolo Bonzini
Il 19/07/2013 22:59, H. Peter Anvin ha scritto: -cpuid(KVM_CPUID_SIGNATURE, eax, ebx, ecx, edx); -memcpy(signature + 0, ebx, 4); -memcpy(signature + 4, ecx, 4); -memcpy(signature + 8, edx, 4); -signature[12]

Re: [PATCH] x86: properly handle KVM emulation of hyperv

2013-07-19 Thread H. Peter Anvin
On 07/19/2013 05:10 AM, Paolo Bonzini wrote: + +static inline bool kvm_para_available(void) +{ if (boot_cpu_data.cpuid_level 0) return false; /* So we don't blow up on old processors */ if (cpu_has_hypervisor) { -cpuid(KVM_CPUID_SIGNATURE, eax, ebx,

Re: [PATCH] x86: properly handle KVM emulation of hyperv

2013-07-19 Thread H. Peter Anvin
On 07/19/2013 02:00 PM, Paolo Bonzini wrote: Il 19/07/2013 22:59, H. Peter Anvin ha scritto: -cpuid(KVM_CPUID_SIGNATURE, eax, ebx, ecx, edx); -memcpy(signature + 0, ebx, 4); -memcpy(signature + 4, ecx, 4); -memcpy(signature + 8,