From owner-svn-src-all@FreeBSD.ORG Mon Jan 21 01:33:10 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id C700DAD4; Mon, 21 Jan 2013 01:33:10 +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 B523FFAB; Mon, 21 Jan 2013 01:33:10 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r0L1XA0j098365; Mon, 21 Jan 2013 01:33:10 GMT (envelope-from neel@svn.freebsd.org) Received: (from neel@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r0L1XAOa098364; Mon, 21 Jan 2013 01:33:10 GMT (envelope-from neel@svn.freebsd.org) Message-Id: <201301210133.r0L1XAOa098364@svn.freebsd.org> From: Neel Natu Date: Mon, 21 Jan 2013 01:33:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r245704 - head/sys/amd64/vmm 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: Mon, 21 Jan 2013 01:33:10 -0000 Author: neel Date: Mon Jan 21 01:33:10 2013 New Revision: 245704 URL: http://svnweb.freebsd.org/changeset/base/245704 Log: Postpone vmm module initialization until after SMP is initialized - particularly that 'smp_started != 0'. This is required because the VT-x initialization calls smp_rendezvous() to set the CR4_VMXE bit on all the cpus. With this change we can preload vmm.ko from the loader. Reported by: alfred@, sbruno@ Obtained from: NetApp Modified: head/sys/amd64/vmm/vmm.c Modified: head/sys/amd64/vmm/vmm.c ============================================================================== --- head/sys/amd64/vmm/vmm.c Mon Jan 21 01:02:49 2013 (r245703) +++ head/sys/amd64/vmm/vmm.c Mon Jan 21 01:33:10 2013 (r245704) @@ -249,11 +249,15 @@ static moduledata_t vmm_kmod = { }; /* - * Execute the module load handler after the pci passthru driver has had - * a chance to claim devices. We need this information at the time we do - * iommu initialization. + * vmm initialization has the following dependencies: + * + * - iommu initialization must happen after the pci passthru driver has had + * a chance to attach to any passthru devices (after SI_SUB_CONFIGURE). + * + * - VT-x initialization requires smp_rendezvous() and therefore must happen + * after SMP is fully functional (after SI_SUB_SMP). */ -DECLARE_MODULE(vmm, vmm_kmod, SI_SUB_CONFIGURE + 1, SI_ORDER_ANY); +DECLARE_MODULE(vmm, vmm_kmod, SI_SUB_SMP + 1, SI_ORDER_ANY); MODULE_VERSION(vmm, 1); SYSCTL_NODE(_hw, OID_AUTO, vmm, CTLFLAG_RW, NULL, NULL);