From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([140.186.70.92]:40756) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Ry70M-0004o4-U1 for qemu-devel@nongnu.org; Thu, 16 Feb 2012 14:28:38 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Ry70G-0000oL-F6 for qemu-devel@nongnu.org; Thu, 16 Feb 2012 14:28:34 -0500 Received: from mx1.redhat.com ([209.132.183.28]:1025) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Ry70G-0000nw-15 for qemu-devel@nongnu.org; Thu, 16 Feb 2012 14:28:28 -0500 Message-ID: <4F3D58CE.2070209@redhat.com> Date: Thu, 16 Feb 2012 21:28:14 +0200 From: Avi Kivity MIME-Version: 1.0 References: <4F2AB552.2070909@redhat.com> <1328597934.6802.6.camel@concordia> <201202152221.36154.arnd@arndb.de> <1329354245.6976.25.camel@concordia> In-Reply-To: <1329354245.6976.25.camel@concordia> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [RFC] Next gen kvm api List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: michael@ellerman.id.au Cc: Alexander Graf , Arnd Bergmann , KVM list , linux-kernel , qemu-devel@nongnu.org, Eric Northup , Scott Wood On 02/16/2012 03:04 AM, Michael Ellerman wrote: > > > > ioctl is good for hardware devices and stuff that you want to enumerate > > and/or control permissions on. For something like KVM that is really a > > core kernel service, a syscall makes much more sense. > > Yeah maybe. That distinction is at least in part just historical. > > The first problem I see with using a syscall is that you don't need one > syscall for KVM, you need ~90. OK so you wouldn't do that, you'd use a > multiplexed syscall like epoll_ctl() - or probably several > (vm/vcpu/etc). No. Many of our ioctls are for state save/restore - we reduce that to two. Many others are due to the with/without irqchip support - we slash that as well. The device assignment stuff is relegated to vfio. I still have to draw up a concrete proposal, but I think we'll end up with 10-15. > > Secondly you still need a handle/context for those syscalls, and I think > the most sane thing to use for that is an fd. The context is the process (for vm-wide calls) and thread (for vcpu local calls). > > At that point you've basically reinvented ioctl :) > > I also think it is an advantage that you have a node in /dev for > permissions. I know other "core kernel" interfaces don't use a /dev > node, but arguably that is their loss. Have to agree with that. Theoretically we don't need permissions for /dev/kvm, but in practice we do. -- I have a truly marvellous patch that fixes the bug which this signature is too narrow to contain.