From patchwork Tue Sep 22 23:00:30 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Eric Auger X-Patchwork-Id: 521477 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 06CFA140783 for ; Wed, 23 Sep 2015 09:02:15 +1000 (AEST) Received: from localhost ([::1]:43633 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZeWZh-0002NM-5o for incoming@patchwork.ozlabs.org; Tue, 22 Sep 2015 19:02:13 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:57398) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZeWYG-0000FS-K9 for qemu-devel@nongnu.org; Tue, 22 Sep 2015 19:00:45 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZeWYB-0003Ar-NR for qemu-devel@nongnu.org; Tue, 22 Sep 2015 19:00:44 -0400 Received: from mail-wi0-f171.google.com ([209.85.212.171]:35327) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZeWYB-0003AX-Hg for qemu-devel@nongnu.org; Tue, 22 Sep 2015 19:00:39 -0400 Received: by wicge5 with SMTP id ge5so183039401wic.0 for ; Tue, 22 Sep 2015 16:00:39 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=jjj5ossZHJnvIM6BlUyR2q+lGAUn7TKZ+BJWmncAafA=; b=Zc9JLS162uhbk9Nl0GTNxGxkO3nxqa3sieud/70u3aSo1NDbhBO0uiPsRhPq78HWAi iFLD9HLhn7GEdS3Z0mTYUmdDZol9MhoiM5g6Bj9y3zpW+JYeBh71ff4b+23qemrSrCvX 16UdszXKD+O8l0/UOmpGyLkG4XELshJ8R1MKijBydByTvx6fUK/ursDI7fEVYBPJU4l3 LyvVOQx4qPMTmDC+TFCHhDNN0e9sVD7yMlemnOXWt91enPRwOiA+51G5c3R4BP4fRbWk OjvxrR9yCXxGuhqSzL+Zb841c/ounuf94am2EM77/CziG4fvlmB8QW2kp05CZzVUjt81 Fsvg== X-Gm-Message-State: ALoCoQmMrF8d5N7f7L48LZndcwQPURuNZa3zteZvnp2NjlSCzIudHSjRrngnHUZbqpmBOwHVGrJg X-Received: by 10.194.60.115 with SMTP id g19mr30785051wjr.29.1442962838959; Tue, 22 Sep 2015 16:00:38 -0700 (PDT) Received: from midway01-04-00.lavalab ([81.128.185.50]) by smtp.gmail.com with ESMTPSA id qc4sm4127010wjc.33.2015.09.22.16.00.37 (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Tue, 22 Sep 2015 16:00:37 -0700 (PDT) From: Eric Auger To: eric.auger@st.com, eric.auger@linaro.org, qemu-devel@nongnu.org, alex.williamson@redhat.com Date: Wed, 23 Sep 2015 00:00:30 +0100 Message-Id: <1442962830-7437-3-git-send-email-eric.auger@linaro.org> X-Mailer: git-send-email 1.8.3.2 In-Reply-To: <1442962830-7437-1-git-send-email-eric.auger@linaro.org> References: <1442962830-7437-1-git-send-email-eric.auger@linaro.org> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 209.85.212.171 Cc: peter.maydell@linaro.org, christoffer.dall@linaro.org, patches@linaro.org Subject: [Qemu-devel] [PATCH 2/2] hw/vfio/platform: do not set resamplefd for edge-sensitive IRQS X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org 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;