diff options
author | badger <badger@FreeBSD.org> | 2016-08-18 14:10:36 +0000 |
---|---|---|
committer | badger <badger@FreeBSD.org> | 2016-08-18 14:10:36 +0000 |
commit | 8aeae6d2238b635aee5108ae0fc930ed2b034a49 (patch) | |
tree | dcb2edf90f19bf9dfdb6283a47c6fe660003e1c6 /sys/i386 | |
parent | 4640af5ebc09fc4ec16e694134ef44da779b2410 (diff) | |
download | FreeBSD-src-8aeae6d2238b635aee5108ae0fc930ed2b034a49.zip FreeBSD-src-8aeae6d2238b635aee5108ae0fc930ed2b034a49.tar.gz |
MFC r302783:
Add explicit detection of KVM hypervisor
Set vm_guest to a new enum value (VM_GUEST_KVM) when kvm is detected and use
vm_guest in conditionals testing for KVM.
Also, fix a conditional checking if we're running in a VM which caught only
the generic VM case, but not more specific VMs (KVM, VMWare, etc.). (Spotted
by: vangyzen).
Sponsored by: Dell Inc.
Approved by: vangyzen (mentor)
Diffstat (limited to 'sys/i386')
-rw-r--r-- | sys/i386/i386/pmap.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/sys/i386/i386/pmap.c b/sys/i386/i386/pmap.c index 575e42f..d40de0f 100644 --- a/sys/i386/i386/pmap.c +++ b/sys/i386/i386/pmap.c @@ -794,7 +794,7 @@ pmap_init(void) * include at least one feature that is only supported by older Intel * or newer AMD processors. */ - if (vm_guest == VM_GUEST_VM && (cpu_feature & CPUID_SS) == 0 && + if (vm_guest != VM_GUEST_NO && (cpu_feature & CPUID_SS) == 0 && (cpu_feature2 & (CPUID2_SSSE3 | CPUID2_SSE41 | CPUID2_AESNI | CPUID2_AVX | CPUID2_XSAVE)) == 0 && (amd_feature2 & (AMDID2_XOP | AMDID2_FMA4)) == 0) |