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: 6724011 Return-Path: X-Original-To: patchwork-kvm@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 05733C05AC for ; Mon, 6 Jul 2015 13:28:15 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 38E5F20519 for ; Mon, 6 Jul 2015 13:28:14 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 1CBF620254 for ; Mon, 6 Jul 2015 13:28:13 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755542AbbGFN1y (ORCPT ); Mon, 6 Jul 2015 09:27:54 -0400 Received: from mail-wi0-f176.google.com ([209.85.212.176]:34695 "EHLO mail-wi0-f176.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755822AbbGFNZR (ORCPT ); Mon, 6 Jul 2015 09:25:17 -0400 Received: by wifm2 with SMTP id m2so29740670wif.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=VWmKrvhERH5TH8ZmQd8oX/IdRbPpCY/DeHiONira6isZ+Eb77hil1xDRoc9q0ZAuod O6olYf2KoQTohg3jIZR3Xg8NkNvs1plPPEaJt2z03zWlPksOn5+Q/08sJxoEGPrunUzA ZYJ2GIa6YFWWH7KCDAzsxGFWZcaK1M/RtvrbLc7OaQxJClcj3Pn20F+wAQjhdMs5G+89 lFS5bW1xnts+EUZ9nGaZpia6QdSnTd5Pyd0J2rn6aak6tZ0jItj/6WDNawO9VjaVu90x YVlQOL0DcG7/S7m9nzqpZ+ZG2CMUXihqBD2TQLFsJft1kAR+AmZ0SZBEjmiOwfCe1jiF LSmQ== X-Gm-Message-State: ALoCoQmpzTDTOcCM6CsuHHdwY7ylLz2/Zz0mII1zYx5zYNPz4pWWsjhz62YLgvVxxi8N8oqcJLPK 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 Cc: linux-kernel@vger.kernel.org, patches@linaro.org, alex.williamson@redhat.com, pbonzini@redhat.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> Sender: kvm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: kvm@vger.kernel.org X-Spam-Status: No, score=-7.6 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 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) { }