From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:44430) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZwsgT-0006oO-2Z for qemu-devel@nongnu.org; Thu, 12 Nov 2015 09:17:06 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZwsgP-0002T4-Rd for qemu-devel@nongnu.org; Thu, 12 Nov 2015 09:17:05 -0500 Received: from mx1.redhat.com ([209.132.183.28]:55629) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZwsgP-0002Sk-MM for qemu-devel@nongnu.org; Thu, 12 Nov 2015 09:17:01 -0500 Message-ID: <1447337819.3946.35.camel@redhat.com> From: Alex Williamson Date: Thu, 12 Nov 2015 07:16:59 -0700 In-Reply-To: <00fb01d11d19$fc458f20$f4d0ad60$@samsung.com> References: <00fb01d11d19$fc458f20$f4d0ad60$@samsung.com> Content-Type: text/plain; charset="UTF-8" Mime-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH] vfio: Fix handling VFIO_IOMMU_GET_INFO results List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Pavel Fedin Cc: qemu-devel@nongnu.org On Thu, 2015-11-12 at 10:16 +0300, Pavel Fedin wrote: > 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: I don't see how this implies that it becomes part of the ABI. In fact, as the defacto userspace driver for vfio, QEMU honoring the flag and not using the value the kernel provides implies the ABI is still valid. We should fix the kernel instead. Thanks, Alex > 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)) {