Project

General

Profile

Actions

Bug #14660

closed

expose bhyve kernel interface version

Added by Patrick Mooney 4 months ago. Updated 4 months ago.

Status:
Closed
Priority:
Normal
Category:
bhyve
Start date:
Due date:
% Done:

100%

Estimated time:
Difficulty:
Medium
Tags:
Gerrit CR:

Description

While the kernel interface to bhyve (the vmm portion) is considered Private, there are external projects (such as Propolis) which consume it. They choose to bear the cost of tracking the bhyve interface, sometimes encountering breakage when otherwise incompatible updates are made. If bhyve were to publish an "interface version", exposed as a simple numeric value which increases monotonically as changes are made to the userspace/kernel interface, then those consumers could at least throw their hands up with an appropriate error when a mismatch was detected. This is contrast to the situation today, where changes to the interface result in behavior which can be quietly broken, or that fails in seemingly strange ways.

I propose that this version number be made available via a dedicated ioctl on the /dev/vmmctl device. Like the rest of the bhyve kernel interface, the new ioctl would still be considered Private from a stability standpoint. There would be no implied contract for how/when to update the exposed version. It would be incremented on a best-effort basis by those making changes to bhyve kernel interfaces.

Actions #1

Updated by Patrick Mooney 4 months ago

  • Description updated (diff)
Actions #2

Updated by Electric Monk 4 months ago

  • Gerrit CR set to 2130
Actions #3

Updated by Patrick Mooney 4 months ago

With the new test in place to check for the versioning information, all of the bhyve unit tests still pass:

Test: /opt/bhyve-tests/tests/mevent/vnode_zvol (run as root)      [00:02] [PASS]
Test: /opt/bhyve-tests/tests/inst_emul/rdmsr (run as root)        [00:00] [PASS]
Test: /opt/bhyve-tests/tests/inst_emul/wrmsr (run as root)        [00:00] [PASS]
Test: /opt/bhyve-tests/tests/kdev/vatpit_freq (run as root)       [00:00] [PASS]
Test: /opt/bhyve-tests/tests/kdev/vhpet_freq (run as root)        [00:00] [PASS]
Test: /opt/bhyve-tests/tests/kdev/vlapic_freq (run as root)       [00:00] [PASS]
Test: /opt/bhyve-tests/tests/kdev/vlapic_freq_periodic (run as root) [00:00] [PASS]
Test: /opt/bhyve-tests/tests/kdev/vlapic_mmio_access (run as root) [00:00] [PASS]
Test: /opt/bhyve-tests/tests/kdev/vlapic_msr_access (run as root) [00:00] [PASS]
Test: /opt/bhyve-tests/tests/kdev/vpmtmr_freq (run as root)       [00:00] [PASS]
Test: /opt/bhyve-tests/tests/mevent/lists_delete (run as root)    [00:00] [PASS]
Test: /opt/bhyve-tests/tests/mevent/read_disable (run as root)    [00:00] [PASS]
Test: /opt/bhyve-tests/tests/mevent/read_pause (run as root)      [00:00] [PASS]
Test: /opt/bhyve-tests/tests/mevent/read_requeue (run as root)    [00:00] [PASS]
Test: /opt/bhyve-tests/tests/mevent/vnode_file (run as root)      [00:09] [PASS]
Test: /opt/bhyve-tests/tests/vmm/fpu_getset (run as root)         [00:00] [PASS]
Test: /opt/bhyve-tests/tests/vmm/interface_version (run as root)  [00:00] [PASS]
Test: /opt/bhyve-tests/tests/vmm/mem_devmem (run as root)         [00:00] [PASS]
Test: /opt/bhyve-tests/tests/vmm/mem_partial (run as root)        [00:00] [PASS]
Test: /opt/bhyve-tests/tests/vmm/mem_seg_map (run as root)        [00:00] [PASS]

Results Summary
PASS      20

Running Time:   00:00:13
Percent passed: 100.0%
Log directory:  /var/tmp/test_results/20220502T212119

No other functionality should have changed, but I also checked that guests could boot and run for completeness. No issues were detected there.

Actions #4

Updated by Electric Monk 4 months ago

  • Status changed from New to Closed
  • % Done changed from 0 to 100

git commit 3466010b6f73e5cbeb612e538494c9d42c6d4a68

commit  3466010b6f73e5cbeb612e538494c9d42c6d4a68
Author: Patrick Mooney <pmooney@pfmooney.com>
Date:   2022-05-02T21:35:55.000Z

    14660 expose bhyve kernel interface version
    Reviewed by: Andy Fiddaman <andy@omnios.org>
    Reviewed by: Toomas Soome <tsoome@me.com>
    Approved by: Richard Lowe <richlowe@richlowe.net>

Actions

Also available in: Atom PDF