From mboxrd@z Thu Jan 1 00:00:00 1970 From: Sheng Yang Subject: [PATCH] qemu-kvm: device assignment: Reflect assigned device's MSI data/address modification to KVM Date: Tue, 28 Sep 2010 16:34:51 +0800 Message-ID: <1285662891-23667-1-git-send-email-sheng@linux.intel.com> Cc: kvm@vger.kernel.org, Sheng Yang To: Avi Kivity , Marcelo Tosatti Return-path: Received: from mga09.intel.com ([134.134.136.24]:55077 "EHLO mga09.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1758383Ab0I1IfB (ORCPT ); Tue, 28 Sep 2010 04:35:01 -0400 Sender: kvm-owner@vger.kernel.org List-ID: Device driver can modify MSI data/address when MSI is enabled. This patch reflect the moditication to KVM. Signed-off-by: Sheng Yang --- 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