lkml.org 
[lkml]   [2013]   [Jul]   [19]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH] x86: properly handle KVM emulation of hyperv
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, &ecx, &edx);
>> - memcpy(signature + 0, &ebx, 4);
>> - memcpy(signature + 4, &ecx, 4);
>> - memcpy(signature + 8, &edx, 4);
>> - signature[12] = 0;
>> -
>> - if (strcmp(signature, "KVMKVMKVM") == 0)
>> + if (kvm_para_available_function(KVM_CPUID_SIGNATURE) ||
>> + kvm_para_available_function(KVM_CPUID_SIGNATURE_NEXT))
>> return true;
>> }
>
> Nice catch. Just one small thing, you should loop until 0x40010000, as
> done in arch/x86/include/asm/xen/hypervisor.h, in case one day a third
> hypervisor implements three extensions (Hyper-V, KVM and its own set).
>

Any way we can centralize this stuff?

-hpa




\
 
 \ /
  Last update: 2013-07-19 23:21    [W:0.072 / U:0.376 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site