git: kernel: Add more detailed VM detection.
Sascha Wildner
swildner at crater.dragonflybsd.org
Tue Mar 4 14:11:53 PST 2014
commit 5a1223c17c5bf9ecbba67f80b4c43b6ff0bb000a
Author: Sascha Wildner <saw at online.de>
Date: Tue Mar 4 19:07:21 2014 +0100
kernel: Add more detailed VM detection.
Previously, the kernel global 'vmm_guest' was either 0 or 1 depending
on the VMM bit in the CPU features (which isn't set in all VMs).
This commit adds more detailed information by checking the emulated
BIOS for known strings. The detected VMs include vkernel, which
doesn't strictly fit into the category, but it shares enough
similarities for this to be useful.
Also expose this information in a read-only sysctl (kern.vmm_guest).
The detection code was kind of adapted from FreeBSD (although their
kern.vm_guest works differently).
Tested-by: tuxillo
Summary of changes:
sys/kern/subr_param.c | 89 +++++++++++++++++++++++++++++++++-
sys/platform/pc32/i386/initcpu.c | 6 ++-
sys/platform/pc64/x86_64/initcpu.c | 9 ++--
sys/platform/vkernel/platform/init.c | 2 +-
sys/platform/vkernel64/platform/init.c | 2 +-
sys/sys/kernel.h | 17 +++++++
sys/sys/systm.h | 1 +
7 files changed, 118 insertions(+), 8 deletions(-)
http://gitweb.dragonflybsd.org/dragonfly.git/commitdiff/5a1223c17c5bf9ecbba67f80b4c43b6ff0bb000a
--
DragonFly BSD source repository
More information about the Commits
mailing list