From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:37430) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZwtsU-0004fg-G9 for qemu-devel@nongnu.org; Thu, 12 Nov 2015 10:33:35 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZwtsQ-00068Y-9i for qemu-devel@nongnu.org; Thu, 12 Nov 2015 10:33:34 -0500 Received: from mx1.redhat.com ([209.132.183.28]:38046) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZwtsQ-00068T-4J for qemu-devel@nongnu.org; Thu, 12 Nov 2015 10:33:30 -0500 Message-ID: <1447342408.3946.54.camel@redhat.com> From: Alex Williamson Date: Thu, 12 Nov 2015 08:33:28 -0700 In-Reply-To: <014c01d11d57$5a101a20$0e304e60$@samsung.com> References: <00fb01d11d19$fc458f20$f4d0ad60$@samsung.com> <1447337819.3946.35.camel@redhat.com> <014c01d11d57$5a101a20$0e304e60$@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 17:35 +0300, Pavel Fedin wrote: > Hello! > > > > 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. > > Well... I intentionally put two links to LXR. From the very > beginning, this ioctl returned valid page sizes. And it never set this > flag. We simply cannot have a kernel which does not report page sizes. Isn't that the state we've been in since the very beginning? QEMU gets along ok assuming a minimum page size. If that assumption were to be invalid, DMA map would fail. The fact that this bug has been there since the very beginning and that QEMU has still been honoring the flag suggests to me that it's not sufficiently critical to change the ABI. > If we fix qemu, it will automatically start working with all > available kernels which are there in the wild. If we fix kernel, older > versions will still not work, however they can. > That's why i think that we should adapt qemu to what already exists. > But, well, you are The Boss, so you can just say "i don't care". So, > just let me now if you strongly disagree with this. I do care, in fact I care enough about the ABI that I'm suggesting what I think is the correct fix rather than taking the quick and dirty solution. It's an unfortunate bug, but it's not worth changing the ABI and removing the kernel's ability to indicate whether the pgsize bitmap field is valid IMO. Thanks, Alex