]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/commit
Rework virtual machine hypervisor detection.
authorJohn Baldwin <jhb@FreeBSD.org>
Tue, 28 Oct 2014 19:17:44 +0000 (19:17 +0000)
committerJohn Baldwin <jhb@FreeBSD.org>
Tue, 28 Oct 2014 19:17:44 +0000 (19:17 +0000)
commit01e1933dcccd319205d2540d366e8fa03e4e1723
tree396338e21acadb31ec69556dca490e2010a46862
parent8839e0e9f316d15c4ce8dc5f02ba6fd573d7d4de
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
sys/amd64/include/md_var.h
sys/i386/include/md_var.h
sys/kern/subr_param.c
sys/sys/systm.h
sys/x86/include/vmware.h [new file with mode: 0644]
sys/x86/x86/identcpu.c
sys/x86/x86/tsc.c