From patchwork Thu Nov 19 14:53:53 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Eric Auger X-Patchwork-Id: 7657891 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 090CF9F2E2 for ; Thu, 19 Nov 2015 14:57:07 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 169CF20699 for ; Thu, 19 Nov 2015 14:57:06 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.9]) (using TLSv1.2 with cipher AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 38E51204D9 for ; Thu, 19 Nov 2015 14:57:05 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1ZzQcE-0002WR-KL; Thu, 19 Nov 2015 14:55:14 +0000 Received: from mail-wm0-x229.google.com ([2a00:1450:400c:c09::229]) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1ZzQbc-00016S-Pm for linux-arm-kernel@lists.infradead.org; Thu, 19 Nov 2015 14:54:38 +0000 Received: by wmec201 with SMTP id c201so121300166wme.1 for ; Thu, 19 Nov 2015 06:54:15 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro-org.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=3SdPQeGXjtwujZCm+J1FZpKbFxFECFRnkDod/goUhTI=; b=igG4RlJRDQFAPjf7e3TaIa5yXqVaevTkl/cxquapiMCvqicpVYS/XqieqOGB4571YM uOVFq32NWa6N3BZ8Bz3ORObc+JDtlBmU2383u8/QUW9MFDucxplObYiRGDPKnk4EeRkg 3AUr8ZwiWEgPS4IdnrVhp8zDfdzYEA/2FDvEgEm+Eq3t1SOU5gw/rI5fAi4CzY8ahG8R +rTyBQLhk6o/pdFam1x2zRjeZ4+BSNAbYADPyefwsO3yORKTRN1XejzqHhatJSRVnzJP 5DKaBWc3wnQXIXFAVd9X6KeVnYSaTrG5Iej504C/yNw6nyHNlPHJz9tQajY9UVG5AX8q fL0A== 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=3SdPQeGXjtwujZCm+J1FZpKbFxFECFRnkDod/goUhTI=; b=BXV2ekKVhgxsUw4BvlCHhSDvtne9cSwwcJEzKRmC/V4+4qraCwjXfEVfS1tMZu8ZLB pNCLWM/LA7epBZMjNCRV6oR2VQFiNe+RJiRZSNMf76s4WYrTjh6B/FS0pbLCNeDxsPki N8o1EYBgNvbvkZhgo79nDgKCzfoVxqYlxu2rubDCLsMdD7YG0D3mQUqH3vtu+IdEbq8i mF+04NCA1xTRA2BURqiUsD402kfa0o9EhTQWF7aplshHszygWsGPEPV626BtzSvJhbVd DlPKlkRpC5l0OoQCGyUtAwAWWTrv4PJT+NAtbkZhLLIwNuh0Mi51ZLERGtFq8OYUj+vd dOxA== X-Gm-Message-State: ALoCoQmpUbtJ/hC4hjllgwWJuEjkoCj8rXCQxSqN0uRTjB/U5HmVd1jx/xzubEs+c/b7iiYEnEGg X-Received: by 10.194.93.164 with SMTP id cv4mr8585097wjb.43.1447944855173; Thu, 19 Nov 2015 06:54:15 -0800 (PST) Received: from new-host-3.home (LMontsouris-657-1-37-90.w80-11.abo.wanadoo.fr. [80.11.198.90]) by smtp.gmail.com with ESMTPSA id h67sm34493865wmf.17.2015.11.19.06.54.13 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 19 Nov 2015 06:54:14 -0800 (PST) From: Eric Auger To: eric.auger@st.com, eric.auger@linaro.org, alex.williamson@redhat.com, b.reynal@virtualopensystems.com, christoffer.dall@linaro.org, marc.zyngier@arm.com, linux-arm-kernel@lists.infradead.org, kvmarm@lists.cs.columbia.edu, kvm@vger.kernel.org Subject: [PATCH v4 03/13] VFIO: platform: test forwarded state when selecting the IRQ handler Date: Thu, 19 Nov 2015 14:53:53 +0000 Message-Id: <1447944843-17731-4-git-send-email-eric.auger@linaro.org> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1447944843-17731-1-git-send-email-eric.auger@linaro.org> References: <1447944843-17731-1-git-send-email-eric.auger@linaro.org> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20151119_065437_196165_F0A25B9F X-CRM114-Status: GOOD ( 13.52 ) X-Spam-Score: -1.9 (-) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: andre.przywara@arm.com, linux-kernel@vger.kernel.org, patches@linaro.org MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Spam-Status: No, score=-4.6 required=5.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_MED,RP_MATCHES_RCVD,T_DKIM_INVALID,UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Add a new forwarded flag in vfio_platform_irq. In case the IRQ is forwarded, the VFIO platform IRQ handler does not need to disable the IRQ anymore. When setting the IRQ handler we now also test the forwarded state. In case the IRQ is forwarded we select the vfio_irq_handler. Signed-off-by: Eric Auger --- v2: - add a new forwarded flag and do not use irqd_irq_forwarded anymore --- drivers/vfio/platform/vfio_platform_irq.c | 3 ++- drivers/vfio/platform/vfio_platform_private.h | 1 + 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/drivers/vfio/platform/vfio_platform_irq.c b/drivers/vfio/platform/vfio_platform_irq.c index ab7658a..d4462fd 100644 --- a/drivers/vfio/platform/vfio_platform_irq.c +++ b/drivers/vfio/platform/vfio_platform_irq.c @@ -265,7 +265,8 @@ static int vfio_platform_set_irq_trigger(struct vfio_platform_device *vdev, struct vfio_platform_irq *irq = &vdev->irqs[index]; irq_handler_t handler; - if (vdev->irqs[index].flags & VFIO_IRQ_INFO_AUTOMASKED) + if (vdev->irqs[index].flags & VFIO_IRQ_INFO_AUTOMASKED && + !irq->forwarded) handler = vfio_automasked_irq_handler; else handler = vfio_irq_handler; diff --git a/drivers/vfio/platform/vfio_platform_private.h b/drivers/vfio/platform/vfio_platform_private.h index 979c191..55e8043 100644 --- a/drivers/vfio/platform/vfio_platform_private.h +++ b/drivers/vfio/platform/vfio_platform_private.h @@ -39,6 +39,7 @@ struct vfio_platform_irq { struct virqfd *unmask; struct virqfd *mask; struct irq_bypass_producer producer; + bool forwarded; }; struct vfio_platform_region {