qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Pavel Fedin <p.fedin@samsung.com>
To: qemu-devel@nongnu.org
Cc: 'Alex Williamson' <alex.williamson@redhat.com>
Subject: [Qemu-devel] [PATCH] vfio: Fix handling VFIO_IOMMU_GET_INFO results
Date: Thu, 12 Nov 2015 10:16:00 +0300	[thread overview]
Message-ID: <00fb01d11d19$fc458f20$f4d0ad60$@samsung.com> (raw)

Kernel headers define VFIO_IOMMU_INFO_PGSIZES flag, however it has
actually been never used, probably by mistake which now became a part
of the ABI. The kernel always sets info.flags to 0:

http://lxr.free-electrons.com/source/drivers/vfio/vfio_iommu_type1.c?v=3.7#L675
http://lxr.free-electrons.com/source/drivers/vfio/vfio_iommu_type1.c#L974

Signed-off-by: Pavel Fedin <p.fedin@samsung.com>
---
 hw/vfio/common.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/hw/vfio/common.c b/hw/vfio/common.c
index 6797208..afc10c7 100644
--- a/hw/vfio/common.c
+++ b/hw/vfio/common.c
@@ -704,7 +704,7 @@ static int vfio_connect_container(VFIOGroup *group, AddressSpace *as)
         info.argsz = sizeof(info);
         ret = ioctl(fd, VFIO_IOMMU_GET_INFO, &info);
         /* Ignore errors */
-        if ((ret == 0) && (info.flags & VFIO_IOMMU_INFO_PGSIZES)) {
+        if (ret == 0) {
             container->iova_pgsizes = info.iova_pgsizes;
         }
     } else if (ioctl(fd, VFIO_CHECK_EXTENSION, VFIO_SPAPR_TCE_IOMMU)) {
-- 
1.9.5.msysgit.0

             reply	other threads:[~2015-11-12  7:16 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-11-12  7:16 Pavel Fedin [this message]
2015-11-12 14:16 ` [Qemu-devel] [PATCH] vfio: Fix handling VFIO_IOMMU_GET_INFO results Alex Williamson
2015-11-12 14:35   ` Pavel Fedin
2015-11-12 15:33     ` Alex Williamson
2015-11-13  9:33       ` Pavel Fedin
2015-11-13 17:23         ` 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='00fb01d11d19$fc458f20$f4d0ad60$@samsung.com' \
    --to=p.fedin@samsung.com \
    --cc=alex.williamson@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).