From: Sheng Yang <sheng@linux.intel.com>
To: Avi Kivity <avi@redhat.com>, Marcelo Tosatti <mtosatti@redhat.com>
Cc: kvm@vger.kernel.org, Sheng Yang <sheng@linux.intel.com>
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 [thread overview]
Message-ID: <1285662891-23667-1-git-send-email-sheng@linux.intel.com> (raw)
Device driver can modify MSI data/address when MSI is enabled. This patch
reflect the moditication to KVM.
Signed-off-by: Sheng Yang <sheng@linux.intel.com>
---
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
next reply other threads:[~2010-09-28 8:35 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-09-28 8:34 Sheng Yang [this message]
2010-09-30 2:05 ` [PATCH] qemu-kvm: device assignment: Reflect assigned device's MSI data/address modification to KVM Marcelo Tosatti
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1285662891-23667-1-git-send-email-sheng@linux.intel.com \
--to=sheng@linux.intel.com \
--cc=avi@redhat.com \
--cc=kvm@vger.kernel.org \
--cc=mtosatti@redhat.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox