Project

General

Profile

Actions

Feature #13825

closed

consolidate vm-related headers for bhyve

Added by Dan Cross about 1 month ago. Updated 19 days ago.

Status:
Closed
Priority:
Normal
Assignee:
-
Category:
-
Start date:
Due date:
% Done:

100%

Estimated time:
Difficulty:
Medium
Tags:
Gerrit CR:

Description

When bhyve was ported to illumos, care was taken to maintain compatibility headers in order to minimize source changes from upstream. As work has continued on the in-kernel portions of bhyve, minimization of that delta is no longer a concern, and we've been cleaning things up to bring them closer in line with the expectations of illumos style and organization.

It would be good to do the same with the VM-related headers as those are particularly messy. Doing so will leave us in a better position to implement new features like live migration.

Actions #1

Updated by Patrick Mooney about 1 month ago

  • Subject changed from Bhyve memory-related data structures need to be refactored to support live migration. to consolidate vm-related headers for bhyve
Actions #2

Updated by Patrick Mooney about 1 month ago

  • Description updated (diff)
Actions #3

Updated by Electric Monk about 1 month ago

  • Gerrit CR set to 1510
Actions #4

Updated by Dan Cross 24 days ago

TESTING: I built against HEAD with and without this change and used `wsdiff`; the only changes were either trivial code location moves, but identical code (a lot of code shifted by 16 bytes), and the simplified `if` in `vmm_mmap_memseg`: a "can't happen" scenario was pulled out of the code: the symbol `KERN_RESOURCE_SHORTAGE` was `#define`'d to `ENOMEM`; however, that symbol was never used anywhere other than the conditional in `vmm_mmap_memseg`, which compared it to the `error` value returned `vm_map_wire` in the non-zero case. However, inspection of `vm_map_wire` shows that it can only ever return 0 (success) or `FC_NOMAP`, which is a fault code for when a mapping doesn't exist: it never returns `ENOMEM`, let alone `KERN_RESOURCE_SHORTAGE` (which has been entirely removed, anyway). Thus, in the failure case in this code stanza, we should only ever return `EFAULT`; the condition for `ENOMEM` was superfluous.

The only other differences were hardcoded strings: either the `git` commit ID, or date/time in `motd`.

Actions #5

Updated by Patrick Mooney 23 days ago

I took this for a spin on both AMD and Intel hardware using the typical variety of guests. It appeared to function as normal.

Actions #6

Updated by Electric Monk 19 days ago

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

git commit cf409e3f26ef8db450f46ba9760eb9734f603ae0

commit  cf409e3f26ef8db450f46ba9760eb9734f603ae0
Author: Dan Cross <cross@oxidecomputer.com>
Date:   2021-06-01T02:20:34.000Z

    13825 consolidate vm-related headers for bhyve
    Reviewed by: Patrick Mooney <pmooney@pfmooney.com>
    Reviewed by: Yuri Pankov <ypankov@tintri.com>
    Reviewed by: Andy Fiddaman <andy@omnios.org>
    Approved by: Robert Mustacchi <rm@fingolfin.org>

Actions

Also available in: Atom PDF