Project

General

Profile

Actions

Bug #15639

closed

want more NPT bit operations in bhyve

Added by Patrick Mooney about 1 year ago. Updated 3 months ago.

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

100%

Estimated time:
Difficulty:
Medium
Tags:
Gerrit CR:
External Bug:

Description

Bhyve kernel exposes the ability to read (and simultaneously clear) the "dirty" bits set in the nested page tables (EPT/RVI) underpinning a guest. Other operations on those bits such as read-but-not-clear, or explicitly-set, would be useful to userspace consumers wishing to handle more complicated situations related to page status. The interface presented to userspace will likely resemble what is already there from #14087.


Related issues

Related to illumos gate - Feature #14087: Bhyve exposes dirty page tracking interfaceClosedDan Cross

Actions
Related to illumos gate - Bug #14251: operationalize bhyve dirty page trackingClosedPatrick Mooney

Actions
Related to illumos gate - Bug #15699: bhyve should lift VM_MAXCPU limitNew

Actions
Actions #1

Updated by Patrick Mooney about 1 year ago

  • Related to Feature #14087: Bhyve exposes dirty page tracking interface added
  • Related to Bug #14251: operationalize bhyve dirty page tracking added
Actions #2

Updated by Patrick Mooney 10 months ago

  • Related to Bug #15699: bhyve should lift VM_MAXCPU limit added
Actions #3

Updated by Electric Monk 4 months ago

  • Gerrit CR set to 3266
Actions #4

Updated by Patrick Mooney 3 months ago

With the proposed enhancement in place, all of the bhyve tests (including the newly added npt_ops) pass:

Test: /opt/bhyve-tests/tests/mevent/vnode_zvol (run as root)      [00:02] [PASS]
Test: /opt/bhyve-tests/tests/inst_emul/cpuid (run as root)        [00:00] [PASS]
Test: /opt/bhyve-tests/tests/inst_emul/imul (run as root)         [00:00] [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/inst_emul/exit_paging (run as root)  [00:00] [PASS]
Test: /opt/bhyve-tests/tests/inst_emul/page_dirty (run as root)   [00:00] [PASS]
Test: /opt/bhyve-tests/tests/inst_emul/exit_consistent (run as root) [00:00] [PASS]
Test: /opt/bhyve-tests/tests/inst_emul/suspend_info (run as root) [00:00] [PASS]
Test: /opt/bhyve-tests/tests/inst_emul/vcpu_barrier (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/kdev/vrtc_ops (run as root)          [00:04] [PASS]
Test: /opt/bhyve-tests/tests/kdev/wrmsr_tsc (run as root)         [00:00] [PASS]
Test: /opt/bhyve-tests/tests/kdev/rdmsr_tsc (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/viona/interface_version (run as root) [00:00] [PASS]
Test: /opt/bhyve-tests/tests/vmm/auto_destruct (run as root)      [00:00] [PASS]
Test: /opt/bhyve-tests/tests/vmm/cpuid_ioctl (run as root)        [00:00] [PASS]
Test: /opt/bhyve-tests/tests/vmm/datarw_constraints (run as root) [00:00] [PASS]
Test: /opt/bhyve-tests/tests/vmm/datarw_msrs (run as root)        [00:00] [PASS]
Test: /opt/bhyve-tests/tests/vmm/datarw_vcpu (run as root)        [00:00] [PASS]
Test: /opt/bhyve-tests/tests/vmm/default_capabs (run as root)     [00:00] [PASS]
Test: /opt/bhyve-tests/tests/vmm/drv_hold (run as root)           [00:00] [PASS]
Test: /opt/bhyve-tests/tests/vmm/fpu_getset (run as root)         [00:00] [PASS]
Test: /opt/bhyve-tests/tests/vmm/import_vlapic (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/legacy_destruct (run as root)    [00:00] [PASS]
Test: /opt/bhyve-tests/tests/vmm/maxcpu (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]
Test: /opt/bhyve-tests/tests/vmm/npt_ops (run as root)            [00:00] [PASS]
Test: /opt/bhyve-tests/tests/vmm/pause_resume (run as root)       [00:00] [PASS]
Test: /opt/bhyve-tests/tests/vmm/self_destruct (run as root)      [00:00] [PASS]

Results Summary
PASS      45

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

This was repeated on Intel gear which lacks dirty-page tracking support, to confirm that the involved tests degrade gracefully. The expected behavior there was observed (all PASSED).

While the existing page_dirty and npt_ops tests do cover some of the involved behavior, I also wanted to confirm that live migration in Propolis was still functional. For that, I ran the PHD test suite, which exercises some migration cases (using, for now, the old VM_TRACK_DIRTY_PAGES ioctl interface, now emulated by the npt ops). The tests pass both before and after the change.

Actions #5

Updated by Electric Monk 3 months ago

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

git commit b9b43e848e8a93ea5f612b51b05c8bb8bf612ee2

commit  b9b43e848e8a93ea5f612b51b05c8bb8bf612ee2
Author: Patrick Mooney <pmooney@pfmooney.com>
Date:   2024-02-27T20:18:10.000Z

    15639 want more NPT bit operations in bhyve
    Reviewed by: Greg Colombo <greg@oxidecomputer.com>
    Reviewed by: Eliza Weisman <eliza@elizas.website>
    Approved by: Dan McDonald <danmcd@mnx.io>

Actions

Also available in: Atom PDF