qemu-devel.nongnu.org archive mirror
 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 0/3] vfio: reusing address space for the same iommu group devices
Date: Tue, 12 Sep 2017 02:56:29 +0800	[thread overview]
Message-ID: <1505156192-18994-1-git-send-email-wexu@redhat.com> (raw)

From: Wei Xu <wexu@redhat.com>

Recently I have been testing passing through 2 ixgbe(82599ES) nics which
belong to the same iommu group to a guest with virtual iommu(vIOMMU) on
my desktop, while vfio failed to realize the second device and prompted
error message as 'group xxx used in multiple address spaces'.

It turned out to be that vtd doesn't know any group info while choosing
an address space for the two devices, therefore it creates two separate
address space for each which breaks granularity isolation.

This patch fixes this by looking up if there is any exist device within
the same iommu group and shares the address space before creating a new
one.

I am not sure if this fixes the problem in a correct way due to my limited
knowledge about vfio, please come back to me for any feedback & comments,
Thanks.

Wei Xu (3):
  vfio: reusing address space for the same iommu group devices
  vfio: invoke looking up address space.
  vfio: remove checking duplicated vfio device

 hw/vfio/common.c              | 28 ++++++++++++++++++++++++++++
 hw/vfio/pci.c                 | 15 ++++++---------
 include/hw/vfio/vfio-common.h |  1 +
 3 files changed, 35 insertions(+), 9 deletions(-)

-- 
1.8.3.1

             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 wexu [this message]
2017-09-11 18:51 ` [Qemu-devel] [Patch 0/3] vfio: reusing address space for the same iommu group devices 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 ` [Qemu-devel] [Patch 2/3] vfio: invoke looking up address space wexu
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-1-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 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).