From owner-svn-src-all@FreeBSD.ORG Sat Apr 13 21:41:52 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 5D8214E6; Sat, 13 Apr 2013 21:41:52 +0000 (UTC) (envelope-from neel@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 4E93D154E; Sat, 13 Apr 2013 21:41:52 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r3DLfqhF002236; Sat, 13 Apr 2013 21:41:52 GMT (envelope-from neel@svn.freebsd.org) Received: (from neel@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r3DLfqTe002235; Sat, 13 Apr 2013 21:41:52 GMT (envelope-from neel@svn.freebsd.org) Message-Id: <201304132141.r3DLfqTe002235@svn.freebsd.org> From: Neel Natu Date: Sat, 13 Apr 2013 21:41:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r249450 - head/sys/amd64/vmm/intel X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 13 Apr 2013 21:41:52 -0000 Author: neel Date: Sat Apr 13 21:41:51 2013 New Revision: 249450 URL: http://svnweb.freebsd.org/changeset/base/249450 Log: Create sysctl node 'hw.vmm.vmx' and populate it with oids that expose the VMX hardware capabilities. Obtained from: NetApp Modified: head/sys/amd64/vmm/intel/vmx.c Modified: head/sys/amd64/vmm/intel/vmx.c ============================================================================== --- head/sys/amd64/vmm/intel/vmx.c Sat Apr 13 21:21:13 2013 (r249449) +++ head/sys/amd64/vmm/intel/vmx.c Sat Apr 13 21:41:51 2013 (r249450) @@ -36,6 +36,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include @@ -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 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); }