From patchwork Mon Aug 10 13:20:58 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Eric Auger X-Patchwork-Id: 6984591 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id DC7E7C05AC for ; Mon, 10 Aug 2015 13:42:11 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 201D62050B for ; Mon, 10 Aug 2015 13:42:11 +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 4BC1220173 for ; Mon, 10 Aug 2015 13:42:10 +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 1ZOnJ8-0004he-EN; Mon, 10 Aug 2015 13:40:06 +0000 Received: from mail-wi0-f179.google.com ([209.85.212.179]) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1ZOn9L-00008z-EJ for linux-arm-kernel@lists.infradead.org; Mon, 10 Aug 2015 13:30:07 +0000 Received: by wicne3 with SMTP id ne3so136057869wic.1 for ; Mon, 10 Aug 2015 06:29:38 -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=LWPjxtg96frESmXioLbRdGYu9TmTxyKA03NkBYLx7rQ=; b=HTHNOc/5V6edqFHUwi6fGn/hvsg+EjFBbiHoIUoVzARXKskjcEbnxGMcs/cgOrL1tw kOC6iZlWDLxagrmkk+6jjIvhUDd2gfb/GqHgoyf8jDm6Zhirz+3SCfcJCI8EnkKU6l+6 unCyn4tL5+MjZZwI0bGbu8QSiKjyhMg8CXMZqaqjXg3YLUOaJm/BniOO7dqvOgPnp+V7 QVu5D2Yo9S/LpAAKmfwNKaeNQTjp+e3FmKCrB16JAlGg4QnLJcoaTlEcjSVluMXk3cJa gG6Nv9GGBdo6bns1iTuNqT/X4Xa3wRlvT0NgPg9w7TN3QduoTUJfTSAt8zPoj2U2M3e0 af8A== X-Gm-Message-State: ALoCoQlH389YcdFT569eJ/IvxxMfHIWdycAeIb4qejAW92YdrMnX0cmR5dQpWdkMR88krDb2Yp8E X-Received: by 10.194.238.168 with SMTP id vl8mr45652792wjc.128.1439212917952; Mon, 10 Aug 2015 06:21:57 -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.56 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 10 Aug 2015 06:21:57 -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 Subject: [PATCH v3 04/10] VFIO: platform: add vfio_platform_set_automasked Date: Mon, 10 Aug 2015 15:20:58 +0200 Message-Id: <1439212864-12954-5-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-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20150810_063000_104768_06B1425F X-CRM114-Status: GOOD ( 12.83 ) X-Spam-Score: -2.6 (--) 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: pbonzini@redhat.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.2 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_MED, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable 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 This function makes possible to change the automasked mode. Signed-off-by: Eric Auger --- v1 -> v2: - set forwarded flag --- drivers/vfio/platform/vfio_platform_irq.c | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/drivers/vfio/platform/vfio_platform_irq.c b/drivers/vfio/platform/vfio_platform_irq.c index b31b1f0..a285384 100644 --- a/drivers/vfio/platform/vfio_platform_irq.c +++ b/drivers/vfio/platform/vfio_platform_irq.c @@ -186,6 +186,25 @@ static irqreturn_t vfio_handler(int irq, void *dev_id) return ret; } +static int vfio_platform_set_automasked(struct vfio_platform_irq *irq, + bool automasked) +{ + unsigned long flags; + + spin_lock_irqsave(&irq->lock, flags); + if (automasked) { + irq->forwarded = true; + irq->flags |= VFIO_IRQ_INFO_AUTOMASKED; + irq->handler = vfio_automasked_irq_handler; + } else { + irq->forwarded = false; + irq->flags &= ~VFIO_IRQ_INFO_AUTOMASKED; + irq->handler = vfio_irq_handler; + } + spin_unlock_irqrestore(&irq->lock, flags); + return 0; +} + static void vfio_platform_irq_bypass_stop(struct irq_bypass_producer *prod) { }