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

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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, &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?
> 
> I guess a function cpuid_hypervisor_base("KVMKVMKVM") that does the scan?
> 

Something like that.

	-hpa


--
To unsubscribe from this list: send the line "unsubscribe kvm" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [KVM ARM]     [KVM ia64]     [KVM ppc]     [Virtualization Tools]     [Spice Development]     [Libvirt]     [Libvirt Users]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite Questions]     [Linux Kernel]     [Linux SCSI]     [XFree86]
  Powered by Linux