summaryrefslogtreecommitdiffstats
path: root/sys/amd64
diff options
context:
space:
mode:
authorneel <neel@FreeBSD.org>2013-04-13 21:41:51 +0000
committerneel <neel@FreeBSD.org>2013-04-13 21:41:51 +0000
commitdf290795061cd7df124ea2d00b10349af3e1266f (patch)
tree1b3164023efe05487369484a80c393033c1cb18c /sys/amd64
parent6a5be05861061839894b4f8a1f31c03093684f2a (diff)
downloadFreeBSD-src-df290795061cd7df124ea2d00b10349af3e1266f.zip
FreeBSD-src-df290795061cd7df124ea2d00b10349af3e1266f.tar.gz
Create sysctl node 'hw.vmm.vmx' and populate it with oids that expose the VMX
hardware capabilities. Obtained from: NetApp
Diffstat (limited to 'sys/amd64')
-rw-r--r--sys/amd64/vmm/intel/vmx.c19
1 files changed, 19 insertions, 0 deletions
diff --git a/sys/amd64/vmm/intel/vmx.c b/sys/amd64/vmm/intel/vmx.c
index fb41074..e950d18 100644
--- a/sys/amd64/vmm/intel/vmx.c
+++ b/sys/amd64/vmm/intel/vmx.c
@@ -36,6 +36,7 @@ __FBSDID("$FreeBSD$");
#include <sys/malloc.h>
#include <sys/pcpu.h>
#include <sys/proc.h>
+#include <sys/sysctl.h>
#include <vm/vm.h>
#include <vm/pmap.h>
@@ -116,6 +117,9 @@ __FBSDID("$FreeBSD$");
MALLOC_DEFINE(M_VMX, "vmx", "vmx");
+SYSCTL_DECL(_hw_vmm);
+SYSCTL_NODE(_hw_vmm, OID_AUTO, vmx, CTLFLAG_RW, NULL, NULL);
+
int vmxon_enabled[MAXCPU];
static char vmxon_region[MAXCPU][PAGE_SIZE] __aligned(PAGE_SIZE);
@@ -123,12 +127,25 @@ static uint32_t pinbased_ctls, procbased_ctls, procbased_ctls2;
static uint32_t exit_ctls, entry_ctls;
static uint64_t cr0_ones_mask, cr0_zeros_mask;
+SYSCTL_ULONG(_hw_vmm_vmx, OID_AUTO, cr0_ones_mask, CTLFLAG_RD,
+ &cr0_ones_mask, 0, NULL);
+SYSCTL_ULONG(_hw_vmm_vmx, OID_AUTO, cr0_zeros_mask, CTLFLAG_RD,
+ &cr0_zeros_mask, 0, NULL);
+
static uint64_t cr4_ones_mask, cr4_zeros_mask;
+SYSCTL_ULONG(_hw_vmm_vmx, OID_AUTO, cr4_ones_mask, CTLFLAG_RD,
+ &cr4_ones_mask, 0, NULL);
+SYSCTL_ULONG(_hw_vmm_vmx, OID_AUTO, cr4_zeros_mask, CTLFLAG_RD,
+ &cr4_zeros_mask, 0, NULL);
static volatile u_int nextvpid;
static int vmx_no_patmsr;
+static int vmx_initialized;
+SYSCTL_INT(_hw_vmm_vmx, OID_AUTO, initialized, CTLFLAG_RD,
+ &vmx_initialized, 0, "Intel VMX initialized");
+
/*
* Virtual NMI blocking conditions.
*
@@ -593,6 +610,8 @@ vmx_init(void)
/* enable VMX operation */
smp_rendezvous(NULL, vmx_enable, NULL, NULL);
+ vmx_initialized = 1;
+
return (0);
}
OpenPOWER on IntegriCloud