virt: acrn: Introduce interfaces for MMIO device passthrough
authorShuo Liu <shuo.a.liu@intel.com>
Thu, 23 Sep 2021 08:41:27 +0000 (16:41 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 5 Oct 2021 14:14:10 +0000 (16:14 +0200)
commit29a9f27574692a71c04fd41ca4bbf8eae842af13
tree2a0df5a1bfa9322704c3e6576a42ff622bcecf3b
parentc31bbc140b94d0e40481966d974038569051433e
virt: acrn: Introduce interfaces for MMIO device passthrough

MMIO device passthrough enables an OS in a virtual machine to directly
access a MMIO device in the host. It promises almost the native
performance, which is required in performance-critical scenarios of
ACRN.

HSM provides the following ioctls:
  - Assign - ACRN_IOCTL_ASSIGN_MMIODEV
    Pass data struct acrn_mmiodev from userspace to the hypervisor, and
    inform the hypervisor to assign a MMIO device to a User VM.

  - De-assign - ACRN_IOCTL_DEASSIGN_PCIDEV
    Pass data struct acrn_mmiodev from userspace to the hypervisor, and
    inform the hypervisor to de-assign a MMIO device from a User VM.

These new APIs will be used by user space code vm_assign_mmiodev and
vm_deassign_mmiodev in
https://github.com/projectacrn/acrn-hypervisor/blob/master/devicemodel/core/vmmapi.c

Signed-off-by: Shuo Liu <shuo.a.liu@intel.com>
Signed-off-by: Fei Li <fei1.li@intel.com>
Link: https://lore.kernel.org/r/20210923084128.18902-2-fei1.li@intel.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/virt/acrn/hsm.c
drivers/virt/acrn/hypercall.h
include/uapi/linux/acrn.h