aboutsummaryrefslogtreecommitdiff
path: root/hw/pci
diff options
context:
space:
mode:
authorPavel Fedin <p.fedin@samsung.com>2015-05-27 15:59:59 +0300
committerMichael S. Tsirkin <mst@redhat.com>2015-05-31 20:29:02 +0200
commit38d40ff10f71657ea913a63d1f8477be368b92c1 (patch)
tree37afaace244c657ced80784054cea6c66c61e885 /hw/pci
parentc3bdc56c183f6ca6baa502bd7861583ca98b333b (diff)
downloadqemu-38d40ff10f71657ea913a63d1f8477be368b92c1.zip
qemu-38d40ff10f71657ea913a63d1f8477be368b92c1.tar.gz
qemu-38d40ff10f71657ea913a63d1f8477be368b92c1.tar.bz2
Add stream ID to MSI write
GICv3 ITS distinguishes between devices by using hardwired device IDs passed on the bus. This patch implements passing these IDs in qemu. SMMU is also known to use stream IDs, therefore this addition can also be useful for implementing platforms with SMMU. Signed-off-by: Pavel Fedin <p.fedin@samsung.com> Reviewed-by: Michael S. Tsirkin <mst@redhat.com> Changes from v1: - Added bus number to the stream ID - Added stream ID not only to MSI-X, but also to plain MSI. Some common code was made into msi_send_message() function. Reviewed-by: Michael S. Tsirkin <mst@redhat.com> Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Diffstat (limited to 'hw/pci')
-rw-r--r--hw/pci/msi.c10
-rw-r--r--hw/pci/msix.c3
2 files changed, 10 insertions, 3 deletions
diff --git a/hw/pci/msi.c b/hw/pci/msi.c
index 2949938..c111dba 100644
--- a/hw/pci/msi.c
+++ b/hw/pci/msi.c
@@ -291,8 +291,16 @@ void msi_notify(PCIDevice *dev, unsigned int vector)
"notify vector 0x%x"
" address: 0x%"PRIx64" data: 0x%"PRIx32"\n",
vector, msg.address, msg.data);
+ msi_send_message(dev, msg);
+}
+
+void msi_send_message(PCIDevice *dev, MSIMessage msg)
+{
+ MemTxAttrs attrs = {};
+
+ attrs.stream_id = (pci_bus_num(dev->bus) << 8) | dev->devfn;
address_space_stl_le(&dev->bus_master_as, msg.address, msg.data,
- MEMTXATTRS_UNSPECIFIED, NULL);
+ attrs, NULL);
}
/* Normally called by pci_default_write_config(). */
diff --git a/hw/pci/msix.c b/hw/pci/msix.c
index 9935f98..7716bf3 100644
--- a/hw/pci/msix.c
+++ b/hw/pci/msix.c
@@ -443,8 +443,7 @@ void msix_notify(PCIDevice *dev, unsigned vector)
msg = msix_get_message(dev, vector);
- address_space_stl_le(&dev->bus_master_as, msg.address, msg.data,
- MEMTXATTRS_UNSPECIFIED, NULL);
+ msi_send_message(dev, msg);
}
void msix_reset(PCIDevice *dev)