summaryrefslogtreecommitdiffstats
path: root/sys/amd64
diff options
context:
space:
mode:
authorjhb <jhb@FreeBSD.org>2014-10-28 19:17:44 +0000
committerjhb <jhb@FreeBSD.org>2014-10-28 19:17:44 +0000
commitd47eb7d2d46dabce3135bac7e98b771b40aff97d (patch)
tree396338e21acadb31ec69556dca490e2010a46862 /sys/amd64
parent7dd1b73c3843393e02fb47a35ad7b9bf4dac7c2f (diff)
downloadFreeBSD-src-d47eb7d2d46dabce3135bac7e98b771b40aff97d.zip
FreeBSD-src-d47eb7d2d46dabce3135bac7e98b771b40aff97d.tar.gz
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
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 e5e78f6..96da886 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;
OpenPOWER on IntegriCloud