From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:39131) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Wzuqk-0003BQ-3C for qemu-devel@nongnu.org; Wed, 25 Jun 2014 17:35:33 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Wzuqc-0008PT-EZ for qemu-devel@nongnu.org; Wed, 25 Jun 2014 17:35:25 -0400 Received: from cantor2.suse.de ([195.135.220.15]:57244 helo=mx2.suse.de) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Wzuqc-0008PO-7b for qemu-devel@nongnu.org; Wed, 25 Jun 2014 17:35:18 -0400 Message-ID: <53AB4094.20201@suse.de> Date: Wed, 25 Jun 2014 23:35:16 +0200 From: Alexander Graf MIME-Version: 1.0 References: <1401695374-4287-1-git-send-email-eric.auger@linaro.org> <1401695374-4287-11-git-send-email-eric.auger@linaro.org> In-Reply-To: <1401695374-4287-11-git-send-email-eric.auger@linaro.org> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [RFC v3 10/10] vfio: Add irqfd support in platform device List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Eric Auger , eric.auger@st.com, christoffer.dall@linaro.org, qemu-devel@nongnu.org, kim.phillips@freescale.com, a.rigo@virtualopensystems.com Cc: peter.maydell@linaro.org, patches@linaro.org, stuart.yoder@freescale.com, alex.williamson@redhat.com, christophe.barnichon@st.com, a.motakis@virtualopensystems.com, kvmarm@lists.cs.columbia.edu On 02.06.14 09:49, Eric Auger wrote: > This patch aims at optimizing IRQ handling using irqfd framework. > It brings significant performance improvement over "traditional" IRQ > handling introduced in : > "vfio: Add initial IRQ support in platform device". > > This new IRQ handling method depends on kernel KVM irqfd/GSI routing > capability. > > The IRQ handling method can be dynamically chosen (default is irqfd, > if kernel supports it obviously). For example to disable irqfd > handling, use: > > -device vfio-platform,vfio_device="fff51000.ethernet",\ > compat="calxeda/hb-xgmac",mmap-timeout-ms=110,irqfd=false\ > > Performances are improved for the following reasons: > - eventfds signalled by the VFIO platform driver are handled on > kernel side by the KVM irqfd framework. > - the end of interrupt(EOI) is trapped at GIC level and not at MMIO > region level. As a reminder, in traditional IRQ handling QEMU > assumed the first guest access to a device MMIO region after IRQ > hit was the IRQ status register reset. This trap was approximate > and obliged to swap to slow path after IRQ hit. A mmap timer > mechanism enabled to swap back to fast path after the mmap period > introducing extra complexity. Now GIC detects the completion of > the virtual IRQ and signals a resampler eventfd on maintenance > IRQ. The corresponding handler re-enables the physical IRQ. Ah, so if you're using irqfd you do unmask the interrupt on EOI. Why not without irqfd? And if the answer is "because it's too difficult" - why support VFIO without irqfd at all then? Alex