From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:41770) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZfARX-0005Uq-JI for qemu-devel@nongnu.org; Thu, 24 Sep 2015 13:36:28 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZfART-0006qu-C7 for qemu-devel@nongnu.org; Thu, 24 Sep 2015 13:36:27 -0400 Received: from mail-pa0-f53.google.com ([209.85.220.53]:36775) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZfART-0006qR-7B for qemu-devel@nongnu.org; Thu, 24 Sep 2015 13:36:23 -0400 Received: by pacgz1 with SMTP id gz1so12271563pac.3 for ; Thu, 24 Sep 2015 10:36:22 -0700 (PDT) References: <1442962830-7437-1-git-send-email-eric.auger@linaro.org> <1442962830-7437-3-git-send-email-eric.auger@linaro.org> <1443036490.23936.506.camel@redhat.com> From: Eric Auger Message-ID: <56043451.10308@linaro.org> Date: Thu, 24 Sep 2015 19:35:13 +0200 MIME-Version: 1.0 In-Reply-To: <1443036490.23936.506.camel@redhat.com> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH 2/2] hw/vfio/platform: do not set resamplefd for edge-sensitive IRQS List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Alex Williamson Cc: peter.maydell@linaro.org, eric.auger@st.com, qemu-devel@nongnu.org, christoffer.dall@linaro.org, patches@linaro.org On 09/23/2015 09:28 PM, Alex Williamson wrote: > On Wed, 2015-09-23 at 00:00 +0100, Eric Auger wrote: >> In irqfd mode, current code attempts to set a resamplefd whatever >> the type of the IRQ. For an edge-sensitive IRQ this attempt fails >> and as a consequence the whole irqfd setup fails and we fall back >> to the slow mode. This patch bypasses the resamplefd setting for >> non level-sentive IRQs. >> >> Signed-off-by: Eric Auger >> --- >> hw/vfio/platform.c | 4 ++++ >> 1 file changed, 4 insertions(+) >> >> diff --git a/hw/vfio/platform.c b/hw/vfio/platform.c >> index 38eaccf..2c91650 100644 >> --- a/hw/vfio/platform.c >> +++ b/hw/vfio/platform.c >> @@ -352,6 +352,10 @@ static int vfio_set_resample_eventfd(VFIOINTp *intp) >> int argsz, ret; >> int32_t *pfd; >> >> + if (!(intp->flags & VFIO_IRQ_INFO_AUTOMASKED)) { >> + return 0; >> + } >> + >> argsz = sizeof(*irq_set) + sizeof(*pfd); >> irq_set = g_malloc0(argsz); >> irq_set->argsz = argsz; > > Aren't we also wasting a file descriptor for intp->unmask on edge IRQs > as well? I'd be tempted to make a helper function that does this test > and use it both to avoid calling this in vfio_start_irqfd_injection() > and also to avoid creating the unused eventfd in vfio_init_intp(). > Thanks, Makes sense Thanks Eric > > Alex >