lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:	Fri, 19 Jul 2013 13:59:02 -0700
From:	"H. Peter Anvin" <hpa@...or.com>
To:	Paolo Bonzini <pbonzini@...hat.com>
CC:	Jason Wang <jasowang@...hat.com>, gleb@...hat.com,
	tglx@...utronix.de, mingo@...hat.com, x86@...nel.org,
	kvm@...r.kernel.org, linux-kernel@...r.kernel.org,
	Vadim Rozenfeld <vrozenfe@...hat.com>,
	"K. Y. Srinivasan" <kys@...rosoft.com>
Subject: Re: [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


--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ