From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from [140.186.70.92] (port=53253 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PHZxq-0004ch-T4 for qemu-devel@nongnu.org; Sun, 14 Nov 2010 05:37:40 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1PHZxp-0001J7-SI for qemu-devel@nongnu.org; Sun, 14 Nov 2010 05:37:38 -0500 Received: from mail-wy0-f173.google.com ([74.125.82.173]:62852) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1PHZxp-0001Iz-Ny for qemu-devel@nongnu.org; Sun, 14 Nov 2010 05:37:37 -0500 Received: by wyj26 with SMTP id 26so5023700wyj.4 for ; Sun, 14 Nov 2010 02:37:36 -0800 (PST) MIME-Version: 1.0 In-Reply-To: <4CDFBB19.7010702@redhat.com> References: <1289483242-6069-1-git-send-email-stefanha@linux.vnet.ibm.com> <1289483242-6069-3-git-send-email-stefanha@linux.vnet.ibm.com> <20101111164518.GA28773@infradead.org> <4CDFBB19.7010702@redhat.com> Date: Sun, 14 Nov 2010 10:37:36 +0000 Message-ID: Subject: Re: [Qemu-devel] Re: [PATCH 2/3] virtio-pci: Use ioeventfd for virtqueue notify From: Stefan Hajnoczi Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Avi Kivity Cc: Christoph Hellwig , "Michael S. Tsirkin" , Stefan Hajnoczi , kvm@vger.kernel.org, qemu-devel@nongnu.org On Sun, Nov 14, 2010 at 10:34 AM, Avi Kivity wrote: > On 11/12/2010 11:20 AM, Stefan Hajnoczi wrote: >> >> > =A0Who guarantees that less common virtio-blk and virtio-net guest dri= vers >> > =A0for non-Linux OSes are fine with it? =A0Maybe you should add a feat= ure >> > flag >> > =A0that the guest has to ACK to enable it. >> >> Virtio-blk and virtio-net are fine. =A0Both of those devices are >> expected to operate asynchronously. =A0SeaBIOS and gPXE virtio-net >> drivers spin but they expect to and it is okay in those environments. >> They already burn CPU today. >> >> Virtio-console expects synchronous virtqueue kick. =A0In Linux, >> virtio_console.c __send_control_msg() and send_buf() will spin. =A0Qemu >> userspace is able to complete those requests synchronously so that the >> guest never actually burns CPU (e.g. >> hw/virtio-serial-bus.c:send_control_msg()). =A0I don't want to burn CPU >> in places where we previously didn't. > > This is a horrible bug. =A0virtio is an asynchronous API. =A0Some hypervi= sor > implementations cannot even provide synchronous notifications. > >> It's good that QEMU can decide whether or not to handle virtqueue kick >> in the vcpu thread. =A0For high performance asynchronous devices like >> virtio-net and virtio-blk it makes sense to use ioeventfd. =A0For others >> it may not be useful. =A0I'm not sure a feature bit that exposes this >> detail to the guest would be useful. > > The guest should always assume that virtio devices are asynchronous. I agree, but let's enable virtio-ioeventfd carefully because bad code is out there. Stefan