Page MenuHomeFreeBSD

bhyve: create all vcpus on startup
ClosedPublic

Authored by corvink on Jun 28 2022, 8:44 AM.
Tags
Referenced Files
F97464665: D35621.diff
Sun, Sep 29, 1:04 PM
F97464001: D35621.diff
Sun, Sep 29, 1:03 PM
Unknown Object (File)
Sat, Sep 28, 3:03 PM
Unknown Object (File)
Sat, Sep 28, 6:38 AM
Unknown Object (File)
Sat, Sep 28, 2:36 AM
Unknown Object (File)
Sat, Sep 28, 12:49 AM
Unknown Object (File)
Fri, Sep 27, 8:46 PM
Unknown Object (File)
Fri, Sep 27, 2:11 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.