Project

General

Profile

Actions

Bug #12750

closed

bhyve should not hold HMA registration with no running VMs

Added by Andy Fiddaman about 2 years ago. Updated almost 2 years ago.

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

100%

Estimated time:
Difficulty:
Medium
Tags:
Gerrit CR:

Description

At present, the bhyve vmm driver grabs a HMA registration when it is loaded, and only releases it when unloaded.

In order to make it easier to switch between hypervisors which co-operate and can be run together (KVM and bhyve) and others that require exclusive HMA access (virtualbox) it would be nice if vmm
only held a HMA registration when there were instantiated bhyve VMs in the system.

Actions #1

Updated by Andy Fiddaman almost 2 years ago

Testing of latest patch set:

theeo# zadm list
NAME              STATUS     BRAND       RAM    CPUS  SHARES
humax-dev         running    lx            -       -       1
deb               installed  bhyve        2G   1/2/1       1
ldap              installed  pkgsrc        -       -       1
openbsd           installed  kvm          2G       4       1
theeo#
theeo# mdb -ke 'hma_registrations::walk list | ::print -t hma_reg_t hr_name'
theeo#
theeo# zadm boot deb
theeo# mdb -ke 'hma_registrations::walk list | ::print -t hma_reg_t hr_name'
const char *hr_name = 0xfffffffff8715156 "bhyve" 

theeo# zadm boot openbsd
theeo# mdb -ke 'hma_registrations::walk list | ::print -t hma_reg_t hr_name'
const char *hr_name = 0xfffffffff8715156 "bhyve" 
const char *hr_name = 0xfffffffff87d8add "SmartOS KVM" 
theeo# zadm list
NAME              STATUS     BRAND       RAM    CPUS  SHARES
deb               running    bhyve        2G   1/2/1       1
humax-dev         running    lx            -       -       1
openbsd           running    kvm          2G       4       1
ldap              installed  pkgsrc        -       -       1
theeo#
theeo# zadm stop openbsd
theeo# zadm stop deb

theeo# mdb -ke 'hma_registrations::walk list | ::print -t hma_reg_t hr_name'
theeo#
theeo# for f in `seq 1 5`; bhyvectl --vm=test$f --create
theeo# mdb -ke 'hma_registrations::walk list | ::print -t hma_reg_t hr_name'
const char *hr_name = 0xfffffffff8715156 "bhyve" 
theeo# mdb -ke 'vmmdev_hma_ref/x'
vmmdev_hma_ref:
vmmdev_hma_ref: 5
theeo# for f in `seq 1 5`; bhyvectl --vm=test$f --destroy
theeo# mdb -ke 'hma_registrations::walk list | ::print -t hma_reg_t hr_name'
theeo# mdb -ke 'vmmdev_hma_ref/x'
vmmdev_hma_ref:
vmmdev_hma_ref: 0
theeo# zadm boot deb
theeo# mdb -b deb
mdb: target stopped at:
0xfffcd347:     subl   %r12d,%r9d
[0]>

zsh: suspended  mdb -b deb
theeo# zadm poweroff deb
theeo# zadm list
NAME              STATUS     BRAND       RAM    CPUS  SHARES
humax-dev         running    lx            -       -       1
deb               installed  bhyve        2G   1/2/1       1
ldap              installed  pkgsrc        -       -       1
openbsd           installed  kvm          2G       4       1
theeo# ls /dev/vmm
theeo# mdb -ke 'hma_registrations::walk list | ::print -t hma_reg_t hr_name'
const char *hr_name = 0xfffffffff8715156 "bhyve" 
theeo# mdb -ke 'vmmdev_hma_ref/x'
vmmdev_hma_ref:
vmmdev_hma_ref: 1

theeo# fg
[1]  + continued  mdb -b deb
[0]> ^D
theeo# mdb -ke 'hma_registrations::walk list | ::print -t hma_reg_t hr_name'
theeo# mdb -ke 'vmmdev_hma_ref/x'
vmmdev_hma_ref:
vmmdev_hma_ref: 0
Actions #2

Updated by Andy Fiddaman almost 2 years ago

  • Gerrit CR set to 680
Actions #3

Updated by Electric Monk almost 2 years ago

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

git commit 8e3a263e496f0b896b62a8ebe101c0b2b56c9a15

commit  8e3a263e496f0b896b62a8ebe101c0b2b56c9a15
Author: Andy Fiddaman <omnios@citrus-it.co.uk>
Date:   2020-06-01T20:02:32.000Z

    12750 bhyve should not hold HMA registration with no running VMs
    Reviewed by: Patrick Mooney <pmooney@pfmooney.com>
    Reviewed by: Yuri Pankov <yuri.pankov@nexenta.com>
    Approved by: Dan McDonald <danmcd@joyent.com>

Actions

Also available in: Atom PDF