From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:36345) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Zwm77-00005n-Sl for qemu-devel@nongnu.org; Thu, 12 Nov 2015 02:16:12 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Zwm74-0004Al-Fp for qemu-devel@nongnu.org; Thu, 12 Nov 2015 02:16:09 -0500 Received: from mailout3.w1.samsung.com ([210.118.77.13]:33735) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Zwm74-000497-6O for qemu-devel@nongnu.org; Thu, 12 Nov 2015 02:16:06 -0500 Received: from eucpsbgm2.samsung.com (unknown [203.254.199.245]) by mailout3.w1.samsung.com (Oracle Communications Messaging Server 7.0.5.31.0 64bit (built May 5 2014)) with ESMTP id <0NXO00CYIXIP3B60@mailout3.w1.samsung.com> for qemu-devel@nongnu.org; Thu, 12 Nov 2015 07:16:01 +0000 (GMT) From: Pavel Fedin Date: Thu, 12 Nov 2015 10:16:00 +0300 Message-id: <00fb01d11d19$fc458f20$f4d0ad60$@samsung.com> MIME-version: 1.0 Content-type: text/plain; charset=us-ascii Content-transfer-encoding: 7bit Content-language: ru Subject: [Qemu-devel] [PATCH] vfio: Fix handling VFIO_IOMMU_GET_INFO results List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: 'Alex Williamson' 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 --- 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