dmar_iommu_notify_scope_dev(info);
 }
 
+static inline void vf_inherit_msi_domain(struct pci_dev *pdev)
+{
+       dev_set_msi_domain(&pdev->dev, dev_get_msi_domain(&pdev->physfn->dev));
+}
+
 static int dmar_pci_bus_notifier(struct notifier_block *nb,
                                 unsigned long action, void *data)
 {
        /* Only care about add/remove events for physical functions.
         * For VFs we actually do the lookup based on the corresponding
         * PF in device_to_iommu() anyway. */
-       if (pdev->is_virtfn)
+       if (pdev->is_virtfn) {
+               /*
+                * Ensure that the VF device inherits the irq domain of the
+                * PF device. Ideally the device would inherit the domain
+                * from the bus, but DMAR can have multiple units per bus
+                * which makes this impossible. The VF 'bus' could inherit
+                * from the PF device, but that's yet another x86'sism to
+                * inflict on everybody else.
+                */
+               if (action == BUS_NOTIFY_ADD_DEVICE)
+                       vf_inherit_msi_domain(pdev);
                return NOTIFY_DONE;
+       }
+
        if (action != BUS_NOTIFY_ADD_DEVICE &&
            action != BUS_NOTIFY_REMOVED_DEVICE)
                return NOTIFY_DONE;