|
|
9ae3a8 |
From 7596bd04d37a608d06cf7a2f589a67d332a21dfb Mon Sep 17 00:00:00 2001
|
|
|
9ae3a8 |
From: Alex Williamson <alex.williamson@redhat.com>
|
|
|
9ae3a8 |
Date: Fri, 1 Nov 2013 19:50:26 +0100
|
|
|
9ae3a8 |
Subject: [PATCH 01/25] pci-assign: Add MSI affinity support
|
|
|
9ae3a8 |
|
|
|
9ae3a8 |
RH-Author: Alex Williamson <alex.williamson@redhat.com>
|
|
|
9ae3a8 |
Message-id: <20131101195026.25461.63530.stgit@bling.home>
|
|
|
9ae3a8 |
Patchwork-id: 55233
|
|
|
9ae3a8 |
O-Subject: [RHEL7 qemu-kvm PATCH 1/3] pci-assign: Add MSI affinity support
|
|
|
9ae3a8 |
Bugzilla: 1025877
|
|
|
9ae3a8 |
RH-Acked-by: Bandan Das <bsd@redhat.com>
|
|
|
9ae3a8 |
RH-Acked-by: Jeffrey Cody <jcody@redhat.com>
|
|
|
9ae3a8 |
RH-Acked-by: Orit Wasserman <owasserm@redhat.com>
|
|
|
9ae3a8 |
|
|
|
9ae3a8 |
Bugzilla: 1025877
|
|
|
9ae3a8 |
Upstream commit: 3459f01b2d9612070ec23221a4ccb60a41b775ae
|
|
|
9ae3a8 |
|
|
|
9ae3a8 |
To support guest MSI affinity changes update the MSI message any time
|
|
|
9ae3a8 |
the guest writes to the address or data fields.
|
|
|
9ae3a8 |
|
|
|
9ae3a8 |
Signed-off-by: Alex Williamson <alex.williamson@redhat.com>
|
|
|
9ae3a8 |
Acked-by: Michael S. Tsirkin <mst@redhat.com>
|
|
|
9ae3a8 |
Message-id: 20130513201840.5430.86331.stgit@bling.home
|
|
|
9ae3a8 |
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
|
|
|
9ae3a8 |
---
|
|
|
9ae3a8 |
hw/i386/kvm/pci-assign.c | 18 ++++++++++++++++++
|
|
|
9ae3a8 |
1 file changed, 18 insertions(+)
|
|
|
9ae3a8 |
|
|
|
9ae3a8 |
Signed-off-by: Miroslav Rezanina <mrezanin@redhat.com>
|
|
|
9ae3a8 |
---
|
|
|
9ae3a8 |
hw/i386/kvm/pci-assign.c | 18 ++++++++++++++++++
|
|
|
9ae3a8 |
1 files changed, 18 insertions(+), 0 deletions(-)
|
|
|
9ae3a8 |
|
|
|
9ae3a8 |
diff --git a/hw/i386/kvm/pci-assign.c b/hw/i386/kvm/pci-assign.c
|
|
|
9ae3a8 |
index 1684f8c..221a8f7 100644
|
|
|
9ae3a8 |
--- a/hw/i386/kvm/pci-assign.c
|
|
|
9ae3a8 |
+++ b/hw/i386/kvm/pci-assign.c
|
|
|
9ae3a8 |
@@ -1026,6 +1026,21 @@ static void assigned_dev_update_msi(PCIDevice *pci_dev)
|
|
|
9ae3a8 |
}
|
|
|
9ae3a8 |
}
|
|
|
9ae3a8 |
|
|
|
9ae3a8 |
+static void assigned_dev_update_msi_msg(PCIDevice *pci_dev)
|
|
|
9ae3a8 |
+{
|
|
|
9ae3a8 |
+ AssignedDevice *assigned_dev = DO_UPCAST(AssignedDevice, dev, pci_dev);
|
|
|
9ae3a8 |
+ uint8_t ctrl_byte = pci_get_byte(pci_dev->config + pci_dev->msi_cap +
|
|
|
9ae3a8 |
+ PCI_MSI_FLAGS);
|
|
|
9ae3a8 |
+
|
|
|
9ae3a8 |
+ if (assigned_dev->assigned_irq_type != ASSIGNED_IRQ_MSI ||
|
|
|
9ae3a8 |
+ !(ctrl_byte & PCI_MSI_FLAGS_ENABLE)) {
|
|
|
9ae3a8 |
+ return;
|
|
|
9ae3a8 |
+ }
|
|
|
9ae3a8 |
+
|
|
|
9ae3a8 |
+ kvm_irqchip_update_msi_route(kvm_state, assigned_dev->msi_virq[0],
|
|
|
9ae3a8 |
+ msi_get_message(pci_dev, 0));
|
|
|
9ae3a8 |
+}
|
|
|
9ae3a8 |
+
|
|
|
9ae3a8 |
static bool assigned_dev_msix_masked(MSIXTableEntry *entry)
|
|
|
9ae3a8 |
{
|
|
|
9ae3a8 |
return (entry->ctrl & cpu_to_le32(0x1)) != 0;
|
|
|
9ae3a8 |
@@ -1201,6 +1216,9 @@ static void assigned_dev_pci_write_config(PCIDevice *pci_dev, uint32_t address,
|
|
|
9ae3a8 |
if (range_covers_byte(address, len,
|
|
|
9ae3a8 |
pci_dev->msi_cap + PCI_MSI_FLAGS)) {
|
|
|
9ae3a8 |
assigned_dev_update_msi(pci_dev);
|
|
|
9ae3a8 |
+ } else if (ranges_overlap(address, len, /* 32bit MSI only */
|
|
|
9ae3a8 |
+ pci_dev->msi_cap + PCI_MSI_ADDRESS_LO, 6)) {
|
|
|
9ae3a8 |
+ assigned_dev_update_msi_msg(pci_dev);
|
|
|
9ae3a8 |
}
|
|
|
9ae3a8 |
}
|
|
|
9ae3a8 |
if (assigned_dev->cap.available & ASSIGNED_DEVICE_CAP_MSIX) {
|
|
|
9ae3a8 |
--
|
|
|
9ae3a8 |
1.7.1
|
|
|
9ae3a8 |
|