Many system monitoring tools, such as htop, can express the CPU time spent by the system in the execution of virtual machine guests. To facilitate such metrics on FreeBSD, I add a new performance counter in the vmm subsystem and expose it through a new sysctl, hw.vmm.stat. Access to this sysctl is restricted by a new privilege, PRIV_VMM_HOST_STAT.
(This feature differs from the existing vmm_stats code in that the existing code expresses per-vm information on a per-virtual-cpu basis. This new patch provides a per-physical-cpu counter of the aggregate number of ticks dedicated to executing guest-mode code since the vmm.ko module was loaded.)