All of lore.kernel.org
 help / color / mirror / Atom feed
From: wexu@redhat.com
To: qemu-devel@nongnu.org
Cc: jasowang@redhat.com, marcel@redhat.com,
	alex.williamson@redhat.com, Wei Xu <wexu@redhat.com>
Subject: [Qemu-devel]  [Patch 2/3] vfio: invoke looking up address space.
Date: Tue, 12 Sep 2017 02:56:31 +0800	[thread overview]
Message-ID: <1505156192-18994-3-git-send-email-wexu@redhat.com> (raw)
In-Reply-To: <1505156192-18994-1-git-send-email-wexu@redhat.com>

From: Wei Xu <wexu@redhat.com>

Invoke looking up correct address space before getting an
IOMMU group.

Signed-off-by: Wei Xu <wexu@redhat.com>
---
 hw/vfio/pci.c | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/hw/vfio/pci.c b/hw/vfio/pci.c
index 31e1edf..856cefd 100644
--- a/hw/vfio/pci.c
+++ b/hw/vfio/pci.c
@@ -2640,6 +2640,7 @@ static void vfio_realize(PCIDevice *pdev, Error **errp)
     struct stat st;
     int groupid;
     int i, ret;
+    AddressSpace *as;
 
     if (!vdev->vbasedev.sysfsdev) {
         if (!(~vdev->host.domain || ~vdev->host.bus ||
@@ -2686,7 +2687,12 @@ static void vfio_realize(PCIDevice *pdev, Error **errp)
 
     trace_vfio_realize(vdev->vbasedev.name, groupid);
 
-    group = vfio_get_group(groupid, pci_device_iommu_address_space(pdev), errp);
+    as = vfio_lookup_as(groupid, pdev, errp);
+    if (!as) {
+        goto error;
+    }
+
+    group = vfio_get_group(groupid, as, errp);
     if (!group) {
         goto error;
     }
-- 
1.8.3.1

  parent reply	other threads:[~2017-09-11 18:36 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-09-11 18:56 [Qemu-devel] [Patch 0/3] vfio: reusing address space for the same iommu group devices wexu
2017-09-11 18:51 ` no-reply
2017-09-11 18:56 ` [Qemu-devel] [Patch 1/3] vfio: reusing address space for the same IOMMU " wexu
2017-09-11 18:56 ` wexu [this message]
2017-09-11 18:56 ` [Qemu-devel] [Patch 3/3] vfio: remove checking duplicated vfio device wexu
2017-09-11 19:18 ` [Qemu-devel] [Patch 0/3] vfio: reusing address space for the same iommu group devices Alex Williamson

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=1505156192-18994-3-git-send-email-wexu@redhat.com \
    --to=wexu@redhat.com \
    --cc=alex.williamson@redhat.com \
    --cc=jasowang@redhat.com \
    --cc=marcel@redhat.com \
    --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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.