Skip to contentSkip to conversation

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

PATCH Applied Sheng Yang 2 participants 2 messages Sep 28, 2010 – Sep 30, 2010 KVM

lore
Share & tools
lore

Sheng Yang

author
#0 lore raw

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

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

---
 hw/device-assignment.c |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)
hw/device-assignment.c +2 -1
index 87f7418..1e83495 100644
@@ -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;
     }
Signature · 1 line
1.7.0.1
#1 lore raw
Quoted 7 lines · Sheng Yang

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

---
 hw/device-assignment.c |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

Applied, thanks.