qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Diana Craciun <diana.craciun@nxp.com>
To: qemu-devel@nongnu.org
Cc: qemu-arm@nongnu.org, christoffer.dall@linaro.org, mst@redhat.com,
	marcel@redhat.com, eric.auger@redhat.com, bharat.bhushan@nxp.com,
	mike.caraman@nxp.com, laurentiu.tudor@nxp.com,
	Diana Craciun <diana.craciun@nxp.com>
Subject: [Qemu-devel] [PATCH v2 1/2] Increased the size of requester_id field from MemTxAttrs
Date: Tue, 23 May 2017 14:12:44 +0300	[thread overview]
Message-ID: <1495537965-4187-2-git-send-email-diana.craciun@nxp.com> (raw)
In-Reply-To: <1495537965-4187-1-git-send-email-diana.craciun@nxp.com>

The PCI requester ID field is 16 bits. The requester_id field
from MemTxAttrs is used for MSIs to specify the device ID for
the platforms where this device ID is needed (e.g virt machine + GICv3
ITS). However, if more entities that uses MSIs in the system are used,
16 bit is no longer enough to represent the device ID. Increased the size
of this field to 24 bits in order to accomodate 256 entities.
Also the name requester_id does no longer reflect the content, so
the name was changed to stream_id.

Signed-off-by: Diana Craciun <diana.craciun@nxp.com>
---
 hw/i386/amd_iommu.c                    | 2 +-
 hw/i386/intel_iommu.c                  | 2 +-
 hw/intc/arm_gicv3_its_common.c         | 2 +-
 hw/intc/arm_gicv3_its_kvm.c            | 2 +-
 hw/pci/msi.c                           | 2 +-
 include/exec/memattrs.h                | 4 ++--
 include/hw/intc/arm_gicv3_its_common.h | 2 +-
 7 files changed, 8 insertions(+), 8 deletions(-)

diff --git a/hw/i386/amd_iommu.c b/hw/i386/amd_iommu.c
index f86a40a..b61bdd5 100644
--- a/hw/i386/amd_iommu.c
+++ b/hw/i386/amd_iommu.c
@@ -145,7 +145,7 @@ static void amdvi_generate_msi_interrupt(AMDVIState *s)
 {
     MSIMessage msg = {};
     MemTxAttrs attrs = {
-        .requester_id = pci_requester_id(&s->pci.dev)
+        .stream_id = pci_requester_id(&s->pci.dev)
     };
 
     if (msi_enabled(&s->pci.dev)) {
diff --git a/hw/i386/intel_iommu.c b/hw/i386/intel_iommu.c
index 02f047c..9cdcc62 100644
--- a/hw/i386/intel_iommu.c
+++ b/hw/i386/intel_iommu.c
@@ -2597,7 +2597,7 @@ static MemTxResult vtd_mem_ir_write(void *opaque, hwaddr addr,
 
     if (!attrs.unspecified) {
         /* We have explicit Source ID */
-        sid = attrs.requester_id;
+        sid = attrs.stream_id;
     }
 
     ret = vtd_interrupt_remap_msi(opaque, &from, &to, sid);
diff --git a/hw/intc/arm_gicv3_its_common.c b/hw/intc/arm_gicv3_its_common.c
index 9d67c5c..efdb1b3 100644
--- a/hw/intc/arm_gicv3_its_common.c
+++ b/hw/intc/arm_gicv3_its_common.c
@@ -66,7 +66,7 @@ static MemTxResult gicv3_its_trans_write(void *opaque, hwaddr offset,
     if (offset == 0x0040 && ((size == 2) || (size == 4))) {
         GICv3ITSState *s = ARM_GICV3_ITS_COMMON(opaque);
         GICv3ITSCommonClass *c = ARM_GICV3_ITS_COMMON_GET_CLASS(s);
-        int ret = c->send_msi(s, le64_to_cpu(value), attrs.requester_id);
+        int ret = c->send_msi(s, le64_to_cpu(value), attrs.stream_id);
 
         if (ret <= 0) {
             qemu_log_mask(LOG_GUEST_ERROR,
diff --git a/hw/intc/arm_gicv3_its_kvm.c b/hw/intc/arm_gicv3_its_kvm.c
index bd4f3aa..9006907 100644
--- a/hw/intc/arm_gicv3_its_kvm.c
+++ b/hw/intc/arm_gicv3_its_kvm.c
@@ -29,7 +29,7 @@
 #define TYPE_KVM_ARM_ITS "arm-its-kvm"
 #define KVM_ARM_ITS(obj) OBJECT_CHECK(GICv3ITSState, (obj), TYPE_KVM_ARM_ITS)
 
-static int kvm_its_send_msi(GICv3ITSState *s, uint32_t value, uint16_t devid)
+static int kvm_its_send_msi(GICv3ITSState *s, uint32_t value, uint32_t devid)
 {
     struct kvm_msi msi;
 
diff --git a/hw/pci/msi.c b/hw/pci/msi.c
index a87b227..7925851 100644
--- a/hw/pci/msi.c
+++ b/hw/pci/msi.c
@@ -336,7 +336,7 @@ void msi_send_message(PCIDevice *dev, MSIMessage msg)
 {
     MemTxAttrs attrs = {};
 
-    attrs.requester_id = pci_requester_id(dev);
+    attrs.stream_id = pci_requester_id(dev);
     address_space_stl_le(&dev->bus_master_as, msg.address, msg.data,
                          attrs, NULL);
 }
diff --git a/include/exec/memattrs.h b/include/exec/memattrs.h
index e601061..b13e1b8 100644
--- a/include/exec/memattrs.h
+++ b/include/exec/memattrs.h
@@ -35,8 +35,8 @@ typedef struct MemTxAttrs {
     unsigned int secure:1;
     /* Memory access is usermode (unprivileged) */
     unsigned int user:1;
-    /* Requester ID (for MSI for example) */
-    unsigned int requester_id:16;
+    /* Stream ID (for MSI for example) */
+    unsigned int stream_id:24;
 } MemTxAttrs;
 
 /* Bus masters which don't specify any attributes will get this,
diff --git a/include/hw/intc/arm_gicv3_its_common.h b/include/hw/intc/arm_gicv3_its_common.h
index 1ba1894..6140fc6 100644
--- a/include/hw/intc/arm_gicv3_its_common.h
+++ b/include/hw/intc/arm_gicv3_its_common.h
@@ -68,7 +68,7 @@ struct GICv3ITSCommonClass {
     SysBusDeviceClass parent_class;
     /*< public >*/
 
-    int (*send_msi)(GICv3ITSState *s, uint32_t data, uint16_t devid);
+    int (*send_msi)(GICv3ITSState *s, uint32_t data, uint32_t devid);
     void (*pre_save)(GICv3ITSState *s);
     void (*post_load)(GICv3ITSState *s);
 };
-- 
2.5.5

  reply	other threads:[~2017-05-23 11:13 UTC|newest]

Thread overview: 31+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-05-23 11:12 [Qemu-devel] [PATCH v2 0/2] Add global device ID in virt machine Diana Craciun
2017-05-23 11:12 ` Diana Craciun [this message]
2017-07-26 12:22   ` [Qemu-devel] [PATCH v2 1/2] Increased the size of requester_id field from MemTxAttrs Auger Eric
2017-08-11 14:32     ` Diana Madalina Craciun
2017-08-11 16:50       ` [Qemu-devel] [Qemu-arm] " Peter Maydell
2017-05-23 11:12 ` [Qemu-devel] [PATCH v2 2/2] Add a unique ID in the virt machine to be used as device ID Diana Craciun
2017-07-26 12:22   ` Auger Eric
2017-07-31 15:16     ` Edgar E. Iglesias
2017-07-31 15:39       ` Edgar E. Iglesias
2017-08-11 14:35       ` Diana Madalina Craciun
2017-08-11 15:50         ` Edgar E. Iglesias
2017-08-22 15:13           ` Diana Madalina Craciun
2017-08-22 19:04             ` Michael S. Tsirkin
2017-08-23 20:09               ` Edgar E. Iglesias
2017-09-01 14:32                 ` Diana Madalina Craciun
2017-09-01 15:32                   ` Michael S. Tsirkin
2017-09-01 13:21               ` Diana Madalina Craciun
2017-08-11 14:34     ` Diana Madalina Craciun
2017-05-24 22:12 ` [Qemu-devel] [PATCH v2 0/2] Add global device ID in virt machine Michael S. Tsirkin
2017-05-31 12:02   ` Diana Madalina Craciun
2017-07-05 23:44     ` Michael S. Tsirkin
2017-07-31 13:22       ` Diana Madalina Craciun
2017-07-31 14:06         ` Michael S. Tsirkin
2017-07-31 15:13           ` Diana Madalina Craciun
2017-08-01  2:05             ` Michael S. Tsirkin
2017-08-01  8:30               ` [Qemu-devel] [Qemu-arm] " Edgar E. Iglesias
2017-08-11 14:31               ` [Qemu-devel] " Diana Madalina Craciun
2017-07-04  7:15 ` Diana Madalina Craciun
2017-07-10 17:10 ` Peter Maydell
2017-07-21 11:47   ` Mike Caraman
2017-07-31 13:16   ` Diana Madalina Craciun

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=1495537965-4187-2-git-send-email-diana.craciun@nxp.com \
    --to=diana.craciun@nxp.com \
    --cc=bharat.bhushan@nxp.com \
    --cc=christoffer.dall@linaro.org \
    --cc=eric.auger@redhat.com \
    --cc=laurentiu.tudor@nxp.com \
    --cc=marcel@redhat.com \
    --cc=mike.caraman@nxp.com \
    --cc=mst@redhat.com \
    --cc=qemu-arm@nongnu.org \
    --cc=qemu-devel@nongnu.org \
    /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;
as well as URLs for NNTP newsgroup(s).