Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 4 Jun 2015 01:41:22 +0300
From:      Stefan Andritoiu <stefan.andritoiu@gmail.com>
To:        Peter Grehan <grehan@freebsd.org>
Cc:        freebsd-virtualization@freebsd.org
Subject:   Re: Where are the VCPU threads created?
Message-ID:  <CAO3d8=bAg8DHMGgVS9P9xRPox4hnnoSXqRr9shC=pMM%2BcmpU7g@mail.gmail.com>
In-Reply-To: <556F3699.7000609@freebsd.org>
References:  <CAO3d8=bWJ-K-k9mRChpC4snVHkXoMrnQTA5L-VNqzoApDhbP3g@mail.gmail.com> <556F3699.7000609@freebsd.org>

next in thread | previous in thread | raw e-mail | index | archive | help
On Wed, Jun 3, 2015 at 8:17 PM, Peter Grehan <grehan@freebsd.org> wrote:
>> 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.

Hi Peter,
Thank you, that answered my question.
Another thing: Are these threads (the ones that run the VCPUs) ever
destroyed and recreated? In the timespan between the moment they are
created (when the guest starts) and when the guest is shut down, is
there any chance of the threads ending/being killed and others created
to take their place? Or do you end up with the same threads?
I am trying to add some information to the VCPU thread at the moment
it is created by bhyve, and want that information to be available for
the entirety of the guest's lifespan.



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?CAO3d8=bAg8DHMGgVS9P9xRPox4hnnoSXqRr9shC=pMM%2BcmpU7g>