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: Auger Eric X-Patchwork-Id: 52236 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-wi0-f197.google.com (mail-wi0-f197.google.com [209.85.212.197]) by patches.linaro.org (Postfix) with ESMTPS id 5365422919 for ; Mon, 10 Aug 2015 13:21:58 +0000 (UTC) Received: by wicja10 with SMTP id ja10sf14010101wic.2 for ; Mon, 10 Aug 2015 06:21:57 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:delivered-to:from:to:cc:subject :date:message-id:in-reply-to:references:x-original-sender :x-original-authentication-results:precedence:mailing-list:list-id :list-post:list-help:list-archive:list-unsubscribe; bh=Nqmpw/QK5ythe4o1Iml2LUOldy+0VaUDOaW6HTHasjE=; b=dXRU7DKquSk9WHkQtQh0R0VS532In71IN/3LhjHXIOVOd3GDFvODN64srTR3bclyX+ Y9q4iDk+CwtdP8nmFBz0BsjHVqhB6CmNCStGnKa1tEjfvVMt2e3WtCuJ5vxvPqTf+Sl1 VHPnxXOdAtZXJddRgWCCPMuLgdw9+cW843Z9wuTHrqNUsNDABaIGXmE3+a7vorsFuZw3 R0bpJAaT/ZrhCpU45CTPagYoTB3kB2QyEAdL1kly8WNrCw3SnqOcwbkUPGzQJjRQyt6Z uJ/cg80ys9gqdTKP0vBubmSDQXWXtOZLFg37ra2W8oeNsGmYw0D7LmHugy1g7xSBAR0l dUTg== X-Gm-Message-State: ALoCoQnvwWN2A5zcQ3jg+2zPKFGpBF3rE3txHKrNu66z+AvIhEHeTYSmj8b00svLP1iEHVYvGV1g X-Received: by 10.180.79.10 with SMTP id f10mr3724004wix.3.1439212917616; Mon, 10 Aug 2015 06:21:57 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.23.74 with SMTP id k10ls744669laf.30.gmail; Mon, 10 Aug 2015 06:21:57 -0700 (PDT) X-Received: by 10.112.198.71 with SMTP id ja7mr12946685lbc.109.1439212917332; Mon, 10 Aug 2015 06:21:57 -0700 (PDT) Received: from mail-lb0-f178.google.com (mail-lb0-f178.google.com. [209.85.217.178]) by mx.google.com with ESMTPS id b14si5514913lbo.147.2015.08.10.06.21.57 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 10 Aug 2015 06:21:57 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.217.178 as permitted sender) client-ip=209.85.217.178; Received: by lbbsx3 with SMTP id sx3so11259221lbb.0 for ; Mon, 10 Aug 2015 06:21:57 -0700 (PDT) X-Received: by 10.112.160.42 with SMTP id xh10mr20018341lbb.88.1439212917230; Mon, 10 Aug 2015 06:21:57 -0700 (PDT) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patches@linaro.org Received: by 10.112.7.198 with SMTP id l6csp1931689lba; Mon, 10 Aug 2015 06:21:56 -0700 (PDT) X-Received: by 10.180.99.71 with SMTP id eo7mr25307770wib.25.1439212914904; Mon, 10 Aug 2015 06:21:54 -0700 (PDT) Received: from mail-wi0-f177.google.com (mail-wi0-f177.google.com. [209.85.212.177]) by mx.google.com with ESMTPS id y3si16045230wie.92.2015.08.10.06.21.54 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 10 Aug 2015 06:21:54 -0700 (PDT) Received-SPF: pass (google.com: domain of eric.auger@linaro.org designates 209.85.212.177 as permitted sender) client-ip=209.85.212.177; Received: by wicja10 with SMTP id ja10so36944969wic.1 for ; Mon, 10 Aug 2015 06:21:54 -0700 (PDT) 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> X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: eric.auger@linaro.org X-Original-Authentication-Results: mx.google.com; spf=pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.217.178 as permitted sender) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org Precedence: list Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org List-ID: X-Google-Group-Id: 836684582541 List-Post: , List-Help: , List-Archive: List-Unsubscribe: , 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 {