summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--sys/arch/amd64/amd64/identcpu.c4
-rw-r--r--sys/arch/amd64/amd64/vmm.c12
-rw-r--r--sys/arch/amd64/include/cpu.h3
3 files changed, 14 insertions, 5 deletions
diff --git a/sys/arch/amd64/amd64/identcpu.c b/sys/arch/amd64/amd64/identcpu.c
index f3e0fe96b42..f0561675683 100644
--- a/sys/arch/amd64/amd64/identcpu.c
+++ b/sys/arch/amd64/amd64/identcpu.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: identcpu.c,v 1.77 2016/09/30 07:33:06 mlarkin Exp $ */
+/* $OpenBSD: identcpu.c,v 1.78 2016/10/13 19:36:25 martijn Exp $ */
/* $NetBSD: identcpu.c,v 1.1 2003/04/26 18:39:28 fvdl Exp $ */
/*
@@ -799,6 +799,8 @@ cpu_check_vmm_cap(struct cpu_info *ci)
else {
if (msr & IA32_FEATURE_CONTROL_VMX_EN)
ci->ci_vmm_flags |= CI_VMM_VMX;
+ else
+ ci->ci_vmm_flags |= CI_VMM_DIS;
}
}
diff --git a/sys/arch/amd64/amd64/vmm.c b/sys/arch/amd64/amd64/vmm.c
index 578e4513027..949302a5359 100644
--- a/sys/arch/amd64/amd64/vmm.c
+++ b/sys/arch/amd64/amd64/vmm.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: vmm.c,v 1.92 2016/10/06 18:52:09 reyk Exp $ */
+/* $OpenBSD: vmm.c,v 1.93 2016/10/13 19:36:25 martijn Exp $ */
/*
* Copyright (c) 2014 Mike Larkin <mlarkin@openbsd.org>
*
@@ -259,7 +259,7 @@ vmm_probe(struct device *parent, void *match, void *aux)
struct cpu_info *ci;
CPU_INFO_ITERATOR cii;
const char **busname = (const char **)aux;
- int found_vmx, found_svm;
+ int found_vmx, found_svm, vm_disabled;
/* Check if this probe is for us */
if (strcmp(*busname, vmm_cd.cd_name) != 0)
@@ -274,13 +274,19 @@ vmm_probe(struct device *parent, void *match, void *aux)
found_vmx = 1;
if (ci->ci_vmm_flags & CI_VMM_SVM)
found_svm = 1;
+ if (ci->ci_vmm_flags & CI_VMM_DIS)
+ vm_disabled = 1;
}
/* Don't support both SVM and VMX at the same time */
if (found_vmx && found_svm)
return (0);
- return (found_vmx || found_svm);
+ if (found_vmx || found_svm)
+ return 1;
+ if (vm_disabled)
+ printf("vmm disabled by firmware\n");
+ return 0;
}
/*
diff --git a/sys/arch/amd64/include/cpu.h b/sys/arch/amd64/include/cpu.h
index 66f1063930d..8f044403925 100644
--- a/sys/arch/amd64/include/cpu.h
+++ b/sys/arch/amd64/include/cpu.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: cpu.h,v 1.105 2016/09/30 07:33:06 mlarkin Exp $ */
+/* $OpenBSD: cpu.h,v 1.106 2016/10/13 19:36:25 martijn Exp $ */
/* $NetBSD: cpu.h,v 1.1 2003/04/26 18:39:39 fvdl Exp $ */
/*-
@@ -183,6 +183,7 @@ struct cpu_info {
#define CI_VMM_SVM (1 << 1)
#define CI_VMM_RVI (1 << 2)
#define CI_VMM_EPT (1 << 3)
+#define CI_VMM_DIS (1 << 4)
union vmm_cpu_cap ci_vmm_cap;
paddr_t ci_vmxon_region_pa;
struct vmxon_region *ci_vmxon_region;