summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMike Larkin <mlarkin@cvs.openbsd.org>2015-12-06 18:42:19 +0000
committerMike Larkin <mlarkin@cvs.openbsd.org>2015-12-06 18:42:19 +0000
commit5d725289ab2619165ed089d1dce1d931d68203b7 (patch)
tree14262431079279fdf055ade16d4387f00ba63abf
parent2bdb4f17410ba3207fec6fb306718418e7bde767 (diff)
Don't bother printing out the count of what type of cpu we have. Instead
just print the feature being used (eg, VMX/EPT). suggested by and ok deraadt@
-rw-r--r--sys/arch/amd64/amd64/vmm.c36
1 files changed, 17 insertions, 19 deletions
diff --git a/sys/arch/amd64/amd64/vmm.c b/sys/arch/amd64/amd64/vmm.c
index fcb942d7904..382a69557c2 100644
--- a/sys/arch/amd64/amd64/vmm.c
+++ b/sys/arch/amd64/amd64/vmm.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: vmm.c,v 1.17 2015/12/06 18:31:26 mlarkin Exp $ */
+/* $OpenBSD: vmm.c,v 1.18 2015/12/06 18:42:18 mlarkin Exp $ */
/*
* Copyright (c) 2014 Mike Larkin <mlarkin@openbsd.org>
*
@@ -239,30 +239,28 @@ vmm_attach(struct device *parent, struct device *self, void *aux)
SLIST_INIT(&sc->vm_list);
rw_init(&sc->vm_lock, "vmlistlock");
- if (sc->nr_vmx_cpus)
- printf(": %u VMX capable CPU%s, %u %s EPT capable\n",
- sc->nr_vmx_cpus, (sc->nr_vmx_cpus > 1) ? "s" : "",
- sc->nr_ept_cpus, (sc->nr_ept_cpus > 1) ? "are" : "is");
- else if (sc->nr_svm_cpus)
- printf(": %u SVM capable CPU%s, %u %s RVI capable\n",
- sc->nr_svm_cpus, (sc->nr_svm_cpus > 1) ? "s" : "",
- sc->nr_rvi_cpus, (sc->nr_rvi_cpus > 1) ? "are" : "is");
+ if (sc->nr_ept_cpus) {
+ printf(": VMX/EPT\n");
+ sc->mode = VMM_MODE_EPT;
+ } else if (sc->nr_vmx_cpus) {
+ printf(": VMX\n");
+ sc->mode = VMM_MODE_VMX;
+ } else if (sc->nr_rvi_cpus) {
+ printf(": SVM/RVI\n");
+ sc->mode = VMM_MODE_RVI;
+ } else if (sc->nr_svm_cpus) {
+ printf(": SVM\n");
+ sc->mode = VMM_MODE_SVM;
+ } else {
+ printf(": unknown\n");
+ sc->mode = VMM_MODE_UNKNOWN;
+ }
pool_init(&vm_pool, sizeof(struct vm), 0, 0, PR_WAITOK, "vmpool",
NULL);
pool_init(&vcpu_pool, sizeof(struct vcpu), 0, 0, PR_WAITOK, "vcpupl",
NULL);
- sc->mode = VMM_MODE_UNKNOWN;
- if (sc->nr_ept_cpus > 0)
- sc->mode = VMM_MODE_EPT;
- else if (sc->nr_vmx_cpus > 0)
- sc->mode = VMM_MODE_VMX;
- else if (sc->nr_rvi_cpus > 0)
- sc->mode = VMM_MODE_RVI;
- else
- sc->mode = VMM_MODE_SVM;
-
vmm_softc = sc;
}