Page MenuHomeFreeBSD

bhyve: Some fwctl simplifications.
ClosedPublic

Authored by jhb on Aug 1 2023, 8:26 PM.
Tags
None
Referenced Files
F102162063: D41286.diff
Fri, Nov 8, 9:31 AM
Unknown Object (File)
Fri, Nov 1, 2:47 PM
Unknown Object (File)
Sep 24 2024, 8:39 AM
Unknown Object (File)
Sep 20 2024, 8:29 PM
Unknown Object (File)
Sep 20 2024, 2:19 PM
Unknown Object (File)
Sep 19 2024, 6:52 PM
Unknown Object (File)
Sep 19 2024, 9:08 AM
Unknown Object (File)
Sep 17 2024, 1:22 PM

Details

Summary
  • Collapse IDENT_SEND/IDENT_WAIT states down to a single state.
  • Remove unused 'len' argument to op_data callback. The value passed in (total amount of remaining data to receive) didn't seem very useful and no op_data implementations used it.

Diff Detail

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

Event Timeline

jhb requested review of this revision.Aug 1 2023, 8:26 PM
markj added inline comments.
usr.sbin/bhyve/fwctl.c
476 ↗(On Diff #125451)

So after this change, guests don't have to explicitly reset the state machine before reading the signature, but doing so is harmless. Ok, that seems fine.

This revision is now accepted and ready to land.Aug 4 2023, 2:08 PM
usr.sbin/bhyve/fwctl.c
476 ↗(On Diff #125451)

Humm, well, I hadn't quite realized that behavior change, but yes, I do think it's fine.

corvink added a subscriber: corvink.

IMHO, we should get rid of fwctl. It was broken for years (https://github.com/freebsd/freebsd-src/commit/8ec366ec6c943550a011effe50bc73e3875f8ead) and nobody noticed it. So, there can't be any users.

Additionally, fwcfg serves the same use case and is a common standard.

usr.sbin/bhyve/fwctl.c
476 ↗(On Diff #125451)

Reading the signature without resetting the state machine only works for the first io read at boot up. So guests shouldn't rely on that behaviour!

This revision was automatically updated to reflect the committed changes.