When I consolidated duplicated vmm code in sys/dev/vmm, I added an ioctl
table which describes the locking protocol for each ioctl. Lookups are
done with a linear scan of the table, which is a bit clumsy given how
frequently bhyve will invoke vmm ioctls when running a guest.
Switch to a direct-addressed lookup table. Each ioctl's number (the low
8 bits in the encoding) is the index. Rename a few numbers (IOCNUM_*
constants) so that the ioctl names and number names are consistent.
This trades a bit of space (the largest ioctl number today is 115) for a
constant-time lookup, which is probably a better tradeoff.
Micro-optimize a bit: try to keep the table as small as possible.
Though, the natural next step would be to make each handler a proper
subroutine looked up via the same table.
As a bonus, we don't need to list compat ioctls in the table anymore,
since they share ioctl numbers with the main version of the ioctl
definition.
While here, remove a bogus entry from the MI ioctl table,
VM_INJECT_EXCEPTION is handled in MD code.
No functional change intended.