vmm(4): send all port io emulation to userland
authordv <dv@openbsd.org>
Thu, 1 Sep 2022 22:01:40 +0000 (22:01 +0000)
committerdv <dv@openbsd.org>
Thu, 1 Sep 2022 22:01:40 +0000 (22:01 +0000)
commit33de4f94699c48eab363d0762965d68f5f40c087
tree37540102b66efd8c58ad55310ef3bd509712b5ab
parent0dd33aec28dee1f6478cb4795258690328304366
vmm(4): send all port io emulation to userland

Simplify things by sending any io exits from IN/OUT instructions
to userland instead of trying to emulate anything in the kernel.
vmm was sending most pertinent exits to vmd anyways, so this
functionally changes little.

An added benefit is this solves an issue reported by tb@ where i386
OpenBSD guests would probe for a pc keyboard repeatedly and cause
excessive vm exits. (The emulation in vmm was not properly handling
these port reads.)

While here, make the assignment of the VEI_DIR_{IN,OUT} enum values
not assume the underlying integer the compiler may assign.

ok mlarkin@
sys/arch/amd64/amd64/vmm.c
sys/arch/amd64/include/vmmvar.h
usr.sbin/vmd/i8253.h
usr.sbin/vmd/i8259.h
usr.sbin/vmd/vm.c