A bit long post so bare with me.
I've managed to pass through the ethernet adapter of imx8qm but the adater is not yet fully functional in guest. The problem has been identified to ethernet device interrupts not firing. The device is detected correctly by our qemu KVM guest with correct MAC address and so on. The link can be turned on/off and link speed can be changed with ifconfig & ethtool so somethings are working.
On the host device tree i've setup fec1, fec2, enet0_lpcg enet1_lpcg and lsio_mu2 devices to a same vfio group for passthrough. The device driver was removed from host to prevent it from loading and the fec device compatible was set to "fsl,dummy". The device status was set "okay" to allow the device to be seen and passed trough by host. Some of the properties (power-domains, clocks, clock-names, assigned-clocks, assigned-clock-rates, pinctrl-0, phy-supply) were deleted from host devicetree to prevent uboot from changing the device configuration on the fly.
Also the lsio_mu2 device needed to be activated on host devicetree similar as was done in xen config adding "IMX_SC_R_MU_2A" tag to init_on_rsrcs list to get lsio_mu2 activated. The passed through device identifiers "IMX_SC_R_MU_2A", "IMX_SC_R_ENET_0" and "IMX_SC_R_ENET_1" need to be passed to rsrcs list to get the devices reserved to guest VM.
See: https://community.nxp.com/t5/i-MX-Processors/imx8qm-enable-lsio-mu2/td-p/1469782
As for the guest VM device tree the SCU device needs to use lsio_mu2 instead of the default (mu1). The passed through devices along with their requirements (some clock devices and most of scu content) needs to be added to the default QEMU KVM device trees platform bus path (platform@c000000 by default). The interrupts need to be updated to match the ones which are used in QEMU passthroug (starting from 0x70...). The order of the interrupts is a bit unclear for me but I'm assuming the order is based on in which order the devices are passed through to QEMU on command line.
In my current setup the lsio_mu2 does get a few interrupts but the ethernet devices do not get any and the ethernet connection remains unresponsive. However the link can be turned on/off and link speed can be changed with ifconfig & ethtool so somethings are working.
I think the interrupts are missing because I have been unable to disable ethernet from uboot which causes Uboot to take over and activate the ethernet adapter at boot.
Any hints how to conpletely disable network from or even before uboot?
Also the driver/device does not seem to support device reset which may have an effect on the device not being in the initial state when the driver is loaded at guest. Is there a way to force the ethernet device to reset?