[PATCH] qemu-kvm: device assignment: Reflect assigned device's MSI data/address modification to KVM

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Device driver can modify MSI data/address when MSI is enabled. This patch
reflect the moditication to KVM.

Signed-off-by: Sheng Yang <sheng@xxxxxxxxxxxxxxx>
---
 hw/device-assignment.c |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/hw/device-assignment.c b/hw/device-assignment.c
index 87f7418..1e83495 100644
--- a/hw/device-assignment.c
+++ b/hw/device-assignment.c
@@ -1283,7 +1283,8 @@ static void assigned_device_pci_cap_write_config(PCIDevice *pci_dev, uint32_t ad
 #ifdef KVM_CAP_DEVICE_MSI
     if (assigned_dev->cap.available & ASSIGNED_DEVICE_CAP_MSI) {
         ctrl_pos = pos + PCI_MSI_FLAGS;
-        if (address <= ctrl_pos && address + len > ctrl_pos)
+        /* Cover control, MSI data/addr fields */
+        if (pos <= address && address + len < pos + PCI_MSI_DATA_32 + 2)
             assigned_dev_update_msi(pci_dev, ctrl_pos);
         pos += PCI_CAPABILITY_CONFIG_MSI_LENGTH;
     }
-- 
1.7.0.1

--
To unsubscribe from this list: send the line "unsubscribe kvm" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [KVM ARM]     [KVM ia64]     [KVM ppc]     [Virtualization Tools]     [Spice Development]     [Libvirt]     [Libvirt Users]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite Questions]     [Linux Kernel]     [Linux SCSI]     [XFree86]
  Powered by Linux