Project

General

Profile

Actions

Bug #14635

closed

bhyve should expose additional vcpu state

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

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

100%

Estimated time:
Difficulty:
Medium
Tags:
Gerrit CR:

Description

Just as #14261 strives to expose the state of devices emulated in-kernel (vlapic, pit, etc), so too should architectural state associated with the vCPUs (MSRs, queued exceptions, etc) be exposed. This can be done as a separate effort, using the same data transfer interfaces exposed via #14261.

Actions #1

Updated by Electric Monk about 1 month ago

  • Gerrit CR set to 2157
Actions #2

Updated by Patrick Mooney 8 days ago

The added functionality in this change was primarily tested with out-of-gate software, namely Propolis with some draft patches to enable save/restore of a running bhyve guest. With the proposed change, Propolis was able to save the contents of a running guest to a file before destroying the in-kernel vmm resources and exiting the userspace process. Subsequently, the saved state was loaded from the file in a new Propolis process, which created a new vmm instance, populated it with the saved state, and then resumed execution of the guest. This was done with a subset of devices, not including viona, which requires more work per #14755. The ability to import state into a kernel vmm instance is still guarded by the vmm_allow_state_writes variable, which defaults to off, requiring mdb -kw modification to enable access.

Actions #3

Updated by Patrick Mooney 8 days ago

With the change in place, the existing bhyve test suite still passes (on AMD and Intel):

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/inst_emul/triple_fault (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      21

Running Time:   00:00:13
Percent passed: 100.0%

Actions #4

Updated by Patrick Mooney 8 days ago

The typical battery of test guests booted and ran fine on these bits (atop AMD and Intel gear).

Actions #5

Updated by Electric Monk 4 days ago

  • Status changed from In Progress to Closed
  • % Done changed from 0 to 100

git commit 54cf5b63effe805271443d5dd7afd37ec184fbab

commit  54cf5b63effe805271443d5dd7afd37ec184fbab
Author: Patrick Mooney <pmooney@pfmooney.com>
Date:   2022-06-27T23:20:35.000Z

    14635 bhyve should expose additional vcpu state
    Reviewed by: Luqman Aden <luqman@oxide.computer>
    Reviewed by: Jordan Paige Hendricks <jordan@oxidecomputer.com>
    Approved by: Robert Mustacchi <rm@fingolfin.org>

Actions

Also available in: Atom PDF