From owner-freebsd-virtualization@FreeBSD.ORG Wed Jun 3 17:17:20 2015 Return-Path: Delivered-To: freebsd-virtualization@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 81ECBA70 for ; Wed, 3 Jun 2015 17:17:20 +0000 (UTC) (envelope-from grehan@freebsd.org) Received: from alto.onthenet.com.au (alto2.onthenet.com.au [203.13.68.14]) by mx1.freebsd.org (Postfix) with ESMTP id 3E444102D for ; Wed, 3 Jun 2015 17:17:19 +0000 (UTC) (envelope-from grehan@freebsd.org) Received: from iredmail.onthenet.com.au (iredmail.onthenet.com.au [203.13.68.150]) by alto.onthenet.com.au (Postfix) with ESMTP id ADC791271D for ; Thu, 4 Jun 2015 03:17:17 +1000 (EST) Received: from localhost (iredmail.onthenet.com.au [127.0.0.1]) by iredmail.onthenet.com.au (Postfix) with ESMTP id 9AEE828099B for ; Thu, 4 Jun 2015 03:17:17 +1000 (AEST) X-Amavis-Modified: Mail body modified (using disclaimer) - iredmail.onthenet.com.au Received: from iredmail.onthenet.com.au ([127.0.0.1]) by localhost (iredmail.onthenet.com.au [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id Cg-yrv6hJ3ck for ; Thu, 4 Jun 2015 03:17:17 +1000 (AEST) Received: from Peters-MacBook-Pro.local (c-50-184-135-69.hsd1.ca.comcast.net [50.184.135.69]) by iredmail.onthenet.com.au (Postfix) with ESMTPSA id BEB0A280999; Thu, 4 Jun 2015 03:17:14 +1000 (AEST) Message-ID: <556F3699.7000609@freebsd.org> Date: Wed, 03 Jun 2015 10:17:13 -0700 From: Peter Grehan User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.10; rv:31.0) Gecko/20100101 Thunderbird/31.7.0 MIME-Version: 1.0 To: Stefan Andritoiu CC: freebsd-virtualization@freebsd.org Subject: Re: Where are the VCPU threads created? References: In-Reply-To: Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit X-BeenThere: freebsd-virtualization@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "Discussion of various virtualization techniques FreeBSD supports." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 03 Jun 2015 17:17:20 -0000 Hi Stefan, > I see that in the main() function of bhyverun.c it adds CPU0 by > calling fbsdrun_addcpu(ctx, 0, 0, rip). But I can't find where the > other VCPUs are added. Or if the 'guest_ncpus' variable is ever used > (except for error checks) Have a look at bhyve/spinup_ap.c:spinup_ap() which is called when a the vmm kernel module detects a SIPI message being sent to the local APIC and forces a vm-exit to userspace. later, Peter.