1.. _mmio-device-passthrough: 2 3MMIO Device Passthrough 4######################## 5 6The ACRN Hypervisor supports both PCI and MMIO device passthrough. 7However there are some constraints on and hypervisor assumptions about 8MMIO devices: there can be no DMA access to the MMIO device and the MMIO 9device may not use IRQs. 10 11Here is how ACRN supports MMIO device passthrough: 12 13* For a pre-launched VM, the VM configuration tells the ACRN hypervisor 14 the addresses of the physical MMIO device's regions and where they are 15 mapped to in the pre-launched VM. The hypervisor then removes these 16 MMIO regions from the Service VM and fills the vACPI table for this MMIO 17 device based on the device's physical ACPI table. 18 19* For a post-launched VM, the same actions are done as in a 20 pre-launched VM, plus we use the command line to tell which MMIO 21 device we want to pass through to the post-launched VM. 22 23 If the MMIO device has ACPI Tables, use ``--acpidev_pt HID[,UID]`` and 24 if not, use ``--mmiodev_pt MMIO_regions``. 25 26.. note:: 27 The vTPM and PT TPM in the ACRN-DM have the same HID so we 28 can't support them both at the same time. The VM will fail to boot if 29 both are used. 30 31These issues remain to be implemented: 32 33* Save the MMIO regions in a field of the VM structure in order to 34 release the resources when the post-launched VM shuts down abnormally. 35* Allocate the guest MMIO regions for the MMIO device in a guest-reserved 36 MMIO region instead of being hard-coded. With this, we could add more 37 passthrough MMIO devices. 38* De-assign the MMIO device from the Service VM first before passing 39 through it to the post-launched VM and not only removing the MMIO 40 regions from the Service VM. 41