Received: from eggs.gnu.org ([209.51.188.92]:51165) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hH5Hu-000466-6A for qemu-devel@nongnu.org; Thu, 18 Apr 2019 07:33:08 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hH5Ht-0006Zi-2W for qemu-devel@nongnu.org; Thu, 18 Apr 2019 07:33:06 -0400 Date: Thu, 18 Apr 2019 12:32:49 +0100 From: Daniel =?utf-8?B?UC4gQmVycmFuZ8Op?= Message-ID: <20190418113249.GP13773@redhat.com> Reply-To: Daniel =?utf-8?B?UC4gQmVycmFuZ8Op?= References: <20190417115343.30527-1-pbonzini@redhat.com> <20190418104737.GC5242@linux.fritz.box> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <20190418104737.GC5242@linux.fritz.box> Subject: Re: [Qemu-devel] [Qemu-block] [PATCH] scsi-generic: prevent guest from exceeding SG_IO limits List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Kevin Wolf Cc: Paolo Bonzini , Stefan Hajnoczi , qemu block , qemu-devel , Stefan Hajnoczi , qemu-stable On Thu, Apr 18, 2019 at 12:47:37PM +0200, Kevin Wolf wrote: > Am 18.04.2019 um 11:48 hat Paolo Bonzini geschrieben: > > On 17/04/19 14:30, Stefan Hajnoczi wrote: > > > On Wed, Apr 17, 2019 at 12:54 PM Paolo Bonzini wrote: > > >> Linux places a limit of UIO_MAXIOV pages on SG_IO ioctls (and if the limit > > >> is exceeded, a confusing ENOMEM error is returned[1]). Prevent the guest > > >> from exceeding these limits, by capping the maximum transfer length to > > >> that value in the block limits VPD page. > > >> > > >> [1] Oh well, at least it was easier to follow the kernel source knowing > > >> it had to end as ENOMEM... > > >> > > >> Cc: qemu-stable@nongnu.org > > >> Cc: qemu-block@nongnu.org > > >> Cc: Stefan Hajnoczi > > >> Signed-off-by: Paolo Bonzini > > >> --- > > >> hw/scsi/scsi-generic.c | 17 +++++++++++++---- > > >> 1 file changed, 13 insertions(+), 4 deletions(-) > > > > > > Reviewed-by: Stefan Hajnoczi > > > > > > > This is acually only an issue with kernels prior to 4.5, so it should be > > fixed downstream instead. > > I don't think that upstream QEMU has kernels > 4.5 as an official > requirement, though? We try to be compatible with quite old libs, so we > should stay compatible with old kernels, too. We've not explicitly stated or checked a min kernel version, but our min kernel is defined implicitly by our targetted build platforms: https://qemu.weilnetz.de/doc/qemu-doc.html#Supported-build-platforms The oldest Linux distro under those rules is RHEL-7 (3.10.0), since Debian Jessie actually updates its kernel version so is already on version 4.5 Regards, Daniel -- |: https://berrange.com -o- https://www.flickr.com/photos/dberrange :| |: https://libvirt.org -o- https://fstop138.berrange.com :| |: https://entangle-photo.org -o- https://www.instagram.com/dberrange :|