Page MenuHomeFreeBSD

bhyve: create all vcpus on startup
ClosedPublic

Authored by corvink on Jun 28 2022, 8:44 AM.
Tags
Referenced Files
Unknown Object (File)
Mon, Oct 14, 9:47 PM
Unknown Object (File)
Oct 6 2024, 4:51 PM
Unknown Object (File)
Oct 3 2024, 2:32 PM
Unknown Object (File)
Oct 2 2024, 3:44 PM
Unknown Object (File)
Oct 2 2024, 5:48 AM
Unknown Object (File)
Sep 29 2024, 10:31 PM
Unknown Object (File)
Sep 29 2024, 10:29 PM
Unknown Object (File)
Sep 29 2024, 10:29 PM
Subscribers

Details

Summary

vcpus could be restarted by the guest by sending an INIT SIPI SIPI
sequence to a vcpu. That's not supported by bhyve yet but it will be
supported in a future commit. So, create the vcpu threads only once on
startup to make restarting a vcpu easier.

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

I think the general idea is ok, just some nits

usr.sbin/bhyve/bhyverun.c
551

s/int suspend/bool suspend/

689

Looks like pvcpu isn't used anymore?

1139

bool here as well.

1594

I would maybe write this as:

     bool suspend = (vcpu != BSP);
#ifdef BHYVE_SNAPSHOT;
     if (restore_file != NULL)
         suspend = false;
#endif
usr.sbin/bhyve/bhyverun.c
689

Yes, it's unused. Should we mark it as unused?

usr.sbin/bhyve/bhyverun.c
689

Oh, never mind, I see it's required as part of being a vmexit handler.

1594

s/int/bool/

corvink added a reviewer: manu.
  • add context to diff file

@jhb seems all comments have been resolved, will commit later today unless you have objections.

This revision was not accepted when it landed; it landed in state Needs Review.Sep 7 2022, 7:09 AM
Closed by commit rG9cc9abf409cc: bhyve: create all vcpus on startup (authored by corvink, committed by manu). · Explain Why
This revision was automatically updated to reflect the committed changes.