intel / gvt-linux

Other
503 stars 94 forks source link

i915 sends multiple "add" udev events for drm/card0 when GVT-g is used #232

Open uriesk opened 7 months ago

uriesk commented 7 months ago

When a guest VM uses a vGPU created by GVT-g, i915 send multiple "add" udev events for the intel gpu itself on the host. This isn't only at launch or at the creation of the virtual GPU either, it happens randomly during operation of the VM. This confuses some Wayland Compositors, because they think that the same GPU got added another time.

Here the output of udevadm monitor -k on the host while a VM is started, vgpu is created, the VM is running for a minute or two, and then being shutdown again and the vpu removed. Notice the 4x add /devices/pci0000:00/0000:00:02.0/drm/card0 (drm) that happen while the VM is running.

monitor will print the received events for:
KERNEL - the kernel uevent

KERNEL[900.543380] change   /devices/virtual/misc/kvm (misc)
KERNEL[900.543582] change   /devices/virtual/misc/kvm (misc)
KERNEL[903.429278] change   /devices/virtual/misc/kvm (misc)
KERNEL[903.429553] change   /devices/virtual/misc/kvm (misc)
KERNEL[903.467393] change   /devices/virtual/misc/kvm (misc)
KERNEL[903.467591] change   /devices/virtual/misc/kvm (misc)
KERNEL[905.900163] add      /module/llc (module)
KERNEL[905.902039] add      /module/stp (module)
KERNEL[905.940992] add      /module/bridge (module)
KERNEL[905.941579] add      /devices/virtual/net/virbr0 (net)
KERNEL[905.941605] add      /devices/virtual/net/virbr0/queues/rx-0 (queues)
KERNEL[905.941622] add      /devices/virtual/net/virbr0/queues/tx-0 (queues)
KERNEL[906.149197] add      /module/nf_conntrack_tftp (module)
KERNEL[906.152558] add      /module/nf_conntrack_broadcast (module)
KERNEL[906.154034] add      /module/nf_conntrack_netbios_ns (module)
KERNEL[906.169723] add      /module/nf_nat_tftp (module)
KERNEL[906.209374] add      /module/ipt_REJECT (module)
KERNEL[906.226801] add      /module/xt_conntrack (module)
KERNEL[906.234943] add      /module/xt_MASQUERADE (module)
KERNEL[906.253413] add      /module/xt_CHECKSUM (module)
KERNEL[913.969200] add      /devices/virtual/misc/iommu (misc)
KERNEL[913.969429] add      /module/iommufd (module)
KERNEL[913.975036] add      /devices/virtual/misc/vfio (misc)
KERNEL[913.975069] add      /class/vfio (class)
KERNEL[913.975240] add      /class/vfio-dev (class)
KERNEL[913.975299] add      /module/vfio (module)
KERNEL[913.980556] add      /module/vfio_iommu_type1 (module)
KERNEL[913.983171] add      /bus/mdev (bus)
KERNEL[913.983204] add      /module/mdev (module)
KERNEL[914.039865] change   /devices/pci0000:00/0000:00:02.0 (pci)
KERNEL[914.039906] add      /bus/mdev/drivers/intel_vgpu_mdev (drivers)
KERNEL[914.039919] add      /module/kvmgt (module)
KERNEL[914.040635] add      /devices/pci0000:00/0000:00:02.0/af5972fb-5530-41a7-0000-fd836204445c (mdev)
KERNEL[914.043991] add      /devices/virtual/vfio/12 (vfio)
KERNEL[914.044034] add      /devices/pci0000:00/0000:00:02.0/af5972fb-5530-41a7-0000-fd836204445c/vfio-dev/vfio0 (vfio-dev)
KERNEL[914.044057] bind     /devices/pci0000:00/0000:00:02.0/af5972fb-5530-41a7-0000-fd836204445c (mdev)
KERNEL[914.111370] add      /devices/virtual/misc/tun (misc)
KERNEL[914.111402] add      /module/tun (module)
KERNEL[914.111913] add      /devices/virtual/net/vnet0 (net)
KERNEL[914.111945] add      /devices/virtual/net/vnet0/queues/rx-0 (queues)
KERNEL[914.111961] add      /devices/virtual/net/vnet0/queues/tx-0 (queues)
KERNEL[914.118990] add      /module/tap (module)
KERNEL[914.121055] add      /module/vhost_iotlb (module)
KERNEL[914.128898] add      /module/vhost (module)
KERNEL[914.133480] add      /devices/virtual/misc/vhost-net (misc)
KERNEL[914.133516] add      /module/vhost_net (module)
KERNEL[914.534151] change   /devices/virtual/misc/kvm (misc)
KERNEL[930.611567] add      /devices/pci0000:00/0000:00:02.0/drm/card0 (drm)
KERNEL[935.498840] add      /devices/pci0000:00/0000:00:02.0/drm/card0 (drm)
KERNEL[1014.326438] add      /devices/pci0000:00/0000:00:02.0/drm/card0 (drm)
KERNEL[1016.286217] add      /devices/pci0000:00/0000:00:02.0/drm/card0 (drm)
KERNEL[1046.585240] remove   /devices/virtual/net/vnet0/queues/rx-0 (queues)
KERNEL[1046.585643] remove   /devices/virtual/net/vnet0/queues/tx-0 (queues)
KERNEL[1046.585796] remove   /devices/virtual/net/vnet0 (net)
KERNEL[1046.816223] change   /devices/virtual/misc/kvm (misc)
KERNEL[1047.124995] remove   /devices/pci0000:00/0000:00:02.0/af5972fb-5530-41a7-0000-fd836204445c/vfio-dev/vfio0 (vfio-dev)
KERNEL[1047.125352] remove   /devices/virtual/vfio/12 (vfio)
KERNEL[1047.187705] unbind   /devices/pci0000:00/0000:00:02.0/af5972fb-5530-41a7-0000-fd836204445c (mdev)
KERNEL[1047.187740] remove   /devices/pci0000:00/0000:00:02.0/af5972fb-5530-41a7-0000-fd836204445c (mdev)
KERNEL[1047.202279] remove   /bus/mdev/drivers/intel_vgpu_mdev (drivers)
KERNEL[1047.202397] change   /devices/pci0000:00/0000:00:02.0 (pci)
KERNEL[1047.256186] remove   /module/kvmgt (module)
KERNEL[1047.267733] remove   /bus/mdev (bus)
KERNEL[1047.268130] remove   /module/mdev (module)