From patchwork Mon Aug 10 13:20:56 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Eric Auger X-Patchwork-Id: 6984071 Return-Path: X-Original-To: patchwork-kvm@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 AB39A9F344 for ; Mon, 10 Aug 2015 13:25:23 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id CED79205FF for ; Mon, 10 Aug 2015 13:25:22 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id C7BE82074B for ; Mon, 10 Aug 2015 13:25:21 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932128AbbHJNZS (ORCPT ); Mon, 10 Aug 2015 09:25:18 -0400 Received: from mail-wi0-f171.google.com ([209.85.212.171]:34166 "EHLO mail-wi0-f171.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752015AbbHJNVz (ORCPT ); Mon, 10 Aug 2015 09:21:55 -0400 Received: by wicne3 with SMTP id ne3so135766470wic.1 for ; Mon, 10 Aug 2015 06:21:54 -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=Nqmpw/QK5ythe4o1Iml2LUOldy+0VaUDOaW6HTHasjE=; b=SRVv0Xb7DZMn493+wjrFbbIO3DG0AwSBI0UBMlqTVWt/wrRqElPBgGTdr9/IvGrtQH UmViAww4XJ+oMmS/9abOO8bwQ/m/JsHrGhJcYCfhfl2YJ/lN5axbfLVG5u88SF4y4Alj TvyuMo/VTU58Zlux0+O7IANVcDcOvPGyDH9kJElCzyR18HhKG9VgQV3t5IyNbHL6gH5L TPdlk5gZhhYzFOgGuOtvmnLcxVCbPoDmw2IO4zTu9T2ghNzVOc+t507z/w7g09ZrGYV7 /mVaypzhcr0ZOkphD2aFSB7O8S6v/cA1cRfsVcmEuscOJhI+3Jo//uhp2CcJtwgYm2zR zkkw== X-Gm-Message-State: ALoCoQnV08z1F/0NxIui2aWDyrKF45Wx9lgomP85kwB7qkYNj9EJsluwUaTua5hc4C4qldhY1niI X-Received: by 10.180.8.135 with SMTP id r7mr24766211wia.58.1439212914718; Mon, 10 Aug 2015 06:21:54 -0700 (PDT) Received: from gnx2579.home (LCaen-156-56-7-90.w80-11.abo.wanadoo.fr. [80.11.198.90]) by smtp.gmail.com with ESMTPSA id fq15sm29517024wjc.12.2015.08.10.06.21.53 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 10 Aug 2015 06:21:54 -0700 (PDT) From: Eric Auger To: eric.auger@st.com, eric.auger@linaro.org, linux-arm-kernel@lists.infradead.org, kvmarm@lists.cs.columbia.edu, kvm@vger.kernel.org, christoffer.dall@linaro.org, marc.zyngier@arm.com, alex.williamson@redhat.com, feng.wu@intel.com Cc: linux-kernel@vger.kernel.org, patches@linaro.org, pbonzini@redhat.com Subject: [PATCH v3 02/10] VFIO: platform: test forwarded state when selecting the IRQ handler Date: Mon, 10 Aug 2015 15:20:56 +0200 Message-Id: <1439212864-12954-3-git-send-email-eric.auger@linaro.org> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1439212864-12954-1-git-send-email-eric.auger@linaro.org> References: <1439212864-12954-1-git-send-email-eric.auger@linaro.org> Sender: kvm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: kvm@vger.kernel.org X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, 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 b5cb8c7..40f057a 100644 --- a/drivers/vfio/platform/vfio_platform_irq.c +++ b/drivers/vfio/platform/vfio_platform_irq.c @@ -262,7 +262,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 1d2d4d6..8b4f814 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 {