PIO region passthrough enables an OS in a virtual machine to directly
access a PIO device in the host. It promises almost the native
performance, which is required in performance-critical scenarios of
ACRN.
ACRN hypervisor will pass through most resource to Service VM at the
begining except those pre-allocated to hypervisor itself and pre-launched
VM. GPA and HPA of all these passthrough resource are identical mapped in
Service VM. In this case, user space program can manipulate the PIO region
in Service VM as PIO region in Host, such as delivering GPA in Service VM
to hypervisor to assign PIO region to other post launched VM.
HSM provides the following ioctls:
- Assign - ACRN_IOCTL_ASSIGN_PIO_REGION
Pass data struct acrn_pio_region from userspace to the hypervisor, and
inform the hypervisor to assign a PIO region to a User VM.
- De-assign - ACRN_IOCTL_DEASSIGN_PIO_REGION
Pass data struct acrn_pio_region from userspace to the hypervisor, and
inform the hypervisor to de-assign a PIO region from a User VM.
These hypercalls are for ACPI device passthrough function of ACRN.
Now ACRN only support legacy UART which has a PIO region. Before passing
through this PIO region to a post-launched VM, ACRN device model would
unbind UART device from Service VM through sysfs node
/sys/bus/pnp/drivers/serial/unbind.
Tracked-On: projectacrn/acrn-hypervisor#8635
Signed-off-by: Yichong Tang <yichong.tang@intel.com>