From: H. Peter Anvin Date: Sat, 8 May 2010 21:59:58 +0000 (-0700) Subject: Merge commit 'v2.6.34-rc6' into x86/cpu X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=d7be0ce6afb1df60bc786f57410407ceae92b994;p=GitHub%2Fmoto-9609%2Fandroid_kernel_motorola_exynos9610.git Merge commit 'v2.6.34-rc6' into x86/cpu --- d7be0ce6afb1df60bc786f57410407ceae92b994 diff --cc arch/x86/kernel/cpu/vmware.c index 46a5b5d3ba5e,dfdb4dba2320..265b432f6e64 --- a/arch/x86/kernel/cpu/vmware.c +++ b/arch/x86/kernel/cpu/vmware.c @@@ -22,9 -22,10 +22,10 @@@ */ #include + #include #include -#include #include +#include #define CPUID_VMWARE_INFO_LEAF 0x40000000 #define VMWARE_HYPERVISOR_MAGIC 0x564D5868 @@@ -82,22 -83,26 +83,23 @@@ static void __init vmware_platform_setu * serial key should be enough, as this will always have a VMware * specific string when running under VMware hypervisor. */ -int vmware_platform(void) +static bool __init vmware_platform(void) { if (cpu_has_hypervisor) { - unsigned int eax, ebx, ecx, edx; - char hyper_vendor_id[13]; - - cpuid(CPUID_VMWARE_INFO_LEAF, &eax, &ebx, &ecx, &edx); - memcpy(hyper_vendor_id + 0, &ebx, 4); - memcpy(hyper_vendor_id + 4, &ecx, 4); - memcpy(hyper_vendor_id + 8, &edx, 4); - hyper_vendor_id[12] = '\0'; - if (!strcmp(hyper_vendor_id, "VMwareVMware")) - return 1; + unsigned int eax; + unsigned int hyper_vendor_id[3]; + + cpuid(CPUID_VMWARE_INFO_LEAF, &eax, &hyper_vendor_id[0], + &hyper_vendor_id[1], &hyper_vendor_id[2]); + if (!memcmp(hyper_vendor_id, "VMwareVMware", 12)) + return true; } else if (dmi_available && dmi_name_in_serial("VMware") && __vmware_platform()) - return 1; + return true; - return 0; + return false; } + EXPORT_SYMBOL(vmware_platform); /* * VMware hypervisor takes care of exporting a reliable TSC to the guest.