Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753318AbbG2PXJ (ORCPT ); Wed, 29 Jul 2015 11:23:09 -0400 Received: from mx1.redhat.com ([209.132.183.28]:53102 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751577AbbG2PXI (ORCPT ); Wed, 29 Jul 2015 11:23:08 -0400 Date: Wed, 29 Jul 2015 18:23:05 +0300 From: "Michael S. Tsirkin" To: Paolo Bonzini Cc: Igor Mammedov , linux-kernel@vger.kernel.org, kvm@vger.kernel.org Subject: Re: [PATCH 1/2] vhost: add ioctl to query nregions upper limit Message-ID: <20150729181346-mutt-send-email-mst@redhat.com> References: <1438180163-275465-1-git-send-email-imammedo@redhat.com> <1438180163-275465-2-git-send-email-imammedo@redhat.com> <20150729174229-mutt-send-email-mst@redhat.com> <20150729165351.16ae62ff@nial.brq.redhat.com> <20150729175434-mutt-send-email-mst@redhat.com> <55B8EAD7.70809@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <55B8EAD7.70809@redhat.com> Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1506 Lines: 36 On Wed, Jul 29, 2015 at 05:01:43PM +0200, Paolo Bonzini wrote: > > > On 29/07/2015 16:56, Michael S. Tsirkin wrote: > >>>> > > > Also, document our contract with legacy userspace: when running on an > >>>> > > > old kernel, you get -1 and you can assume at least 64 slots. Since 0 > >>>> > > > value's left unused, let's make that mean that the current userspace > >>>> > > > behaviour (trial and error) is required, just in case we want it back. > >>> > > > >>> > > What's wrong with reading the module parameter value? It's there in > >>> > > sysfs ... > >> > for most cases it would work but distro doesn't have to mount > >> > sysfs under /sys > > If it wants to rewrite all userspace, sure it doesn't. > > I agree, on the other hand it doesn't seem far fetched to have a per-fd > maximum in the future. So I think this patch is more future-proof. > > Paolo Possibly, but this calls for some kind of priveledge separation model, where a priveledged app can set the per-fd limit while regular ones can only read it. Sounds very complex. Let's see some of this code first. And I really think there are better ways to future proof it, e.g. teach userspace to do error handling, revert adding a slot if one of the components can't support it. -- MST -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/