aboutsummaryrefslogtreecommitdiff
path: root/sys/amd64
diff options
context:
space:
mode:
authorJohn Baldwin <jhb@FreeBSD.org>2014-10-28 19:17:44 +0000
committerJohn Baldwin <jhb@FreeBSD.org>2014-10-28 19:17:44 +0000
commit01e1933dcccd319205d2540d366e8fa03e4e1723 (patch)
tree396338e21acadb31ec69556dca490e2010a46862 /sys/amd64
parent8839e0e9f316d15c4ce8dc5f02ba6fd573d7d4de (diff)
downloadsrc-01e1933dcccd319205d2540d366e8fa03e4e1723.tar.gz
src-01e1933dcccd319205d2540d366e8fa03e4e1723.zip
Rework virtual machine hypervisor detection.
- Move the existing code to x86/x86/identcpu.c since it is x86-specific. - If the CPUID2_HV flag is set, assume a hypervisor is present and query the 0x40000000 leaf to determine the hypervisor vendor ID. Export the vendor ID and the highest supported hypervisor CPUID leaf via hv_vendor[] and hv_high variables, respectively. The hv_vendor[] array is also exported via the hw.hv_vendor sysctl. - Merge the VMWare detection code from tsc.c into the new probe in identcpu.c. Add a VM_GUEST_VMWARE to identify vmware and use that in the TSC code to identify VMWare. Differential Revision: https://reviews.freebsd.org/D1010 Reviewed by: delphij, jkim, neel
Notes
Notes: svn path=/head/; revision=273800
Diffstat (limited to 'sys/amd64')
-rw-r--r--sys/amd64/include/md_var.h2
1 files changed, 2 insertions, 0 deletions
diff --git a/sys/amd64/include/md_var.h b/sys/amd64/include/md_var.h
index e5e78f65369e..96da886af9ff 100644
--- a/sys/amd64/include/md_var.h
+++ b/sys/amd64/include/md_var.h
@@ -62,6 +62,8 @@ extern u_int cpu_mon_mwait_flags;
extern u_int cpu_mon_min_size;
extern u_int cpu_mon_max_size;
extern char ctx_switch_xsave[];
+extern u_int hv_high;
+extern char hv_vendor[];
extern char kstack[];
extern char sigcode[];
extern int szsigcode;