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: Auger Eric X-Patchwork-Id: 57004 Delivered-To: patches@linaro.org Received: by 10.112.155.196 with SMTP id vy4csp3227005lbb; Thu, 19 Nov 2015 06:54:15 -0800 (PST) X-Received: by 10.28.194.135 with SMTP id s129mr15563867wmf.38.1447944855396; Thu, 19 Nov 2015 06:54:15 -0800 (PST) Return-Path: Received: from mail-wm0-x22b.google.com (mail-wm0-x22b.google.com. [2a00:1450:400c:c09::22b]) by mx.google.com with ESMTPS id vn6si11796447wjc.38.2015.11.19.06.54.15 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 19 Nov 2015 06:54:15 -0800 (PST) Received-SPF: pass (google.com: domain of eric.auger@linaro.org designates 2a00:1450:400c:c09::22b as permitted sender) client-ip=2a00:1450:400c:c09::22b; Authentication-Results: mx.google.com; spf=pass (google.com: domain of eric.auger@linaro.org designates 2a00:1450:400c:c09::22b as permitted sender) smtp.mailfrom=eric.auger@linaro.org; dkim=pass header.i=@linaro-org.20150623.gappssmtp.com Received: by wmww144 with SMTP id w144so241826423wmw.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=fapNHKhd6LDurcYLwRYMHl+WKm8vqpyoPwV3ITHg3RFEFULz+q0HhBHtKVFLk5Xr6q ogyR/n+P97zpUyUyokWoUcW2Kfis3YEjxHUSNy8DblIGqlTwrx810xZg/AxHU2I9sDmu X5Qh0s7LNeEtS/+Yec0ojkCnQR3hUWXLvQr7GPGvDtl6N1CCT5Ga4AnZcj4tiRYlC0fU 3J1iaCQAlGF5rM4b+ekP5JYZJKvGGjtR7UCHrPN+6dkfOVhO5urDOfQ54q83k0766Bzv oZ1RogEjmlnUHu/qv73r5Qf34KHsTPuZDv/j+2ERwFlOM8ZBVyoqC2jOlL4PzBJebRRD ZCjQ== X-Gm-Message-State: ALoCoQnePDXGX0KFHLNH/lg/nuByu20jThbn2JfXYLLdVqS6Us8dBDLWfe69zum5+tch6e7fH4s5 X-Received: by 10.194.93.164 with SMTP id cv4mr8585097wjb.43.1447944855173; Thu, 19 Nov 2015 06:54:15 -0800 (PST) Return-Path: 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 Cc: andre.przywara@arm.com, linux-kernel@vger.kernel.org, patches@linaro.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> 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(-) -- 1.9.1 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 {