From patchwork Mon Jul 6 13:24:38 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Eric Auger X-Patchwork-Id: 6723961 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 F07AD9F319 for ; Mon, 6 Jul 2015 13:27:51 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 34CBB205F3 for ; Mon, 6 Jul 2015 13:27:51 +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 57DF3205E9 for ; Mon, 6 Jul 2015 13:27:50 +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 1ZC6PJ-0000eZ-Tu; Mon, 06 Jul 2015 13:26:01 +0000 Received: from mail-wi0-f172.google.com ([209.85.212.172]) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1ZC6Ov-0000Gr-6s for linux-arm-kernel@lists.infradead.org; Mon, 06 Jul 2015 13:25:37 +0000 Received: by widjy10 with SMTP id jy10so160858324wid.1 for ; Mon, 06 Jul 2015 06:25:15 -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=E2D4o/dFHFY1HEwOcBjgFx6+24mLAsfBdjvEh6qqaB8=; b=kTP/FYghczA/HnyX/sHjjx5bB3iOYqwyhdEvPqaQ2+zH685KNrlU1svYFobd5Gi9ff ckr/OznQ3A1LWF+33MaXNcv1bLxBa6UiE9mkvtbJWT/rIif1LOUTSu0OUgTVsu0pODIv tSI5gT4571ZpwbNqka71NAvKuWr99D+X6ls3en6mf5G5sTWav6NDXG7KuimiNm4sOUMR EIPH8ckbdukwWzN1V5aIWmEDGLOuLZgfheZl0pmdUvO5iHcxviSvKzd9Xt/Hnj1Y6Yw7 KibxcXWu12ixnzEylHe4RwTTOClARCNoWmuBZAX6+e4e28YvlIt1FfdjfK92Zv4gmPna +NrA== X-Gm-Message-State: ALoCoQm91ErXJypO83yUvtiPclrYWbg1N/+0LVff/DByMZBqLhrIKK94lazURasflqMhGC0yvvaY X-Received: by 10.180.99.2 with SMTP id em2mr90778447wib.59.1436189115748; Mon, 06 Jul 2015 06:25:15 -0700 (PDT) Received: from gnx2579.home (LCaen-156-56-7-90.w80-11.abo.wanadoo.fr. [80.11.198.90]) by mx.google.com with ESMTPSA id q4sm28148131wju.14.2015.07.06.06.25.13 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 06 Jul 2015 06:25:14 -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, avi.kivity@gmail.com, mtosatti@redhat.com, feng.wu@intel.com, joro@8bytes.org, b.reynal@virtualopensystems.com Subject: [RFC v2 4/9] VFIO: platform: add vfio_platform_set_automasked Date: Mon, 6 Jul 2015 15:24:38 +0200 Message-Id: <1436189083-32527-5-git-send-email-eric.auger@linaro.org> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1436189083-32527-1-git-send-email-eric.auger@linaro.org> References: <1436189083-32527-1-git-send-email-eric.auger@linaro.org> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20150706_062537_409539_4E96B564 X-CRM114-Status: GOOD ( 12.28 ) 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, alex.williamson@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.9 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 --- --- drivers/vfio/platform/vfio_platform_irq.c | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/drivers/vfio/platform/vfio_platform_irq.c b/drivers/vfio/platform/vfio_platform_irq.c index 7f8d27c..aa540db 100644 --- a/drivers/vfio/platform/vfio_platform_irq.c +++ b/drivers/vfio/platform/vfio_platform_irq.c @@ -186,6 +186,23 @@ 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->flags |= VFIO_IRQ_INFO_AUTOMASKED; + irq->handler = vfio_automasked_irq_handler; + } else { + 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) { }