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)
Feb 26 2024, 8:35 PM
Unknown Object (File)
Jan 25 2024, 6:49 AM
Unknown Object (File)
Jan 25 2024, 6:49 AM
Unknown Object (File)
Jan 25 2024, 6:49 AM
Unknown Object (File)
Dec 20 2023, 7:39 AM
Unknown Object (File)
Dec 12 2023, 9:05 AM
Unknown Object (File)
Sep 6 2023, 4:15 AM
Unknown Object (File)
Sep 3 2023, 2:31 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.