aboutsummaryrefslogtreecommitdiffstats
path: root/arch/x86/kernel/cpu/vmware.c
diff options
context:
space:
mode:
authorAlok Kataria <akataria@vmware.com>2008-11-03 18:50:38 -0500
committerH. Peter Anvin <hpa@zytor.com>2008-11-04 16:59:00 -0500
commitfd8cd7e1919fc1c27fe2fdccd2a1cd32f791ef0f (patch)
treeb2b1482133a10f8de3d8c85a1a291fd93ead4b2c /arch/x86/kernel/cpu/vmware.c
parent6bdbfe99916398dbb28d83833cc04757110f2738 (diff)
x86: vmware: look for DMI string in the product serial key
Impact: Should permit VMware detection on older platforms where the vendor is changed. Could theoretically cause a regression if some weird serial number scheme contains the string "VMware" by pure chance. Seems unlikely, especially with the mixed case. In some user configured cases, VMware may choose not to put a VMware specific DMI string, but the product serial key is always there and is VMware specific. Add a interface to check the serial key, when checking for VMware in the DMI information. Signed-off-by: Alok N Kataria <akataria@vmware.com> Signed-off-by: H. Peter Anvin <hpa@zytor.com>
Diffstat (limited to 'arch/x86/kernel/cpu/vmware.c')
-rw-r--r--arch/x86/kernel/cpu/vmware.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/arch/x86/kernel/cpu/vmware.c b/arch/x86/kernel/cpu/vmware.c
index a0905ecfe7d2..c034bda842d9 100644
--- a/arch/x86/kernel/cpu/vmware.c
+++ b/arch/x86/kernel/cpu/vmware.c
@@ -61,6 +61,11 @@ static unsigned long __vmware_get_tsc_khz(void)
61 return tsc_hz; 61 return tsc_hz;
62} 62}
63 63
64/*
65 * While checking the dmi string infomation, just checking the product
66 * serial key should be enough, as this will always have a VMware
67 * specific string when running under VMware hypervisor.
68 */
64int vmware_platform(void) 69int vmware_platform(void)
65{ 70{
66 if (cpu_has_hypervisor) { 71 if (cpu_has_hypervisor) {
@@ -74,7 +79,7 @@ int vmware_platform(void)
74 hyper_vendor_id[12] = '\0'; 79 hyper_vendor_id[12] = '\0';
75 if (!strcmp(hyper_vendor_id, "VMwareVMware")) 80 if (!strcmp(hyper_vendor_id, "VMwareVMware"))
76 return 1; 81 return 1;
77 } else if (dmi_available && dmi_name_in_vendors("VMware") && 82 } else if (dmi_available && dmi_name_in_serial("VMware") &&
78 __vmware_platform()) 83 __vmware_platform())
79 return 1; 84 return 1;
80 85