Received: by 2002:ac0:a594:0:0:0:0:0 with SMTP id m20-v6csp3275412imm; Fri, 25 May 2018 02:54:31 -0700 (PDT) X-Google-Smtp-Source: AB8JxZoaqiMApAsVcgP7kG+0lYaC7FTajivrxEkcYc1213BgvrCufF7QkOwI/polyioZfJGwb9BT X-Received: by 2002:a17:902:8c83:: with SMTP id t3-v6mr1872246plo.357.1527242071935; Fri, 25 May 2018 02:54:31 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1527242071; cv=none; d=google.com; s=arc-20160816; b=CDgGI2OI/7DYWW3I3qe4aaJqlc23wAOJvXJfPZvzew4UCT/4Sd3oKQHblYBL7qNKOW vlwklYpyt4CGAYvmApE4qjc4h/kJ6+kjXVMYXbWL8RS2byUZLb97WKMvxyzipQZYF36y cPn6ADrBCUdH9El0iJkIVdIm+1w6SWo0reR8SoXmNEJskOYZONffXDgqFn9dow6Ov7dU 2pdYjOy0PddQI8cCYUMnrDthMYPuz/e3wySgtT0Wb72XcSrW9nri4s6G0RHJdydGAORk OySLqK52KLu3O0uMljI3V/3LwtLvMP2dm9bG7z9GUItvF/3+eJ5vyuGjZBXUgz+0WxY1 u5eg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:arc-authentication-results; bh=nZ35Mk3FRyqoNC07WRyAs+ubGf12J0uWFj33rvvrGZM=; b=b7U3KaOB0xRiZxXKnjDnNpzF/I1OLnfoNnEeo907Jya52ZAA0VUdQ86c+Ki/eyvD1b CHrFZarEpR86+w5nzkQouW4CdVEPAQ6Ou0/xL+zSuiel389Gn/TS5OtYAHK7z8iFUOhw 1Mdu3vx/ggwIPRNAcdqbC9jWLcgVFGtzbh5t86OYEsir/3BiZ6JYx3pPZN4Q7L88JquV vkHZM4L64C9ACXLe6YCr7CyQQzuS7t52KVqsN0JrPXGLIqHWM0/365Yzj5dJ9oQLJHK3 aWXdV9TQJ0LfHRN6gBItYQLSJyDeLBDsLH6MuH1oWHMZRN0nmKpAJB1ysK5lnoXabiDe tw5w== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id r59-v6si23178377plb.187.2018.05.25.02.54.16; Fri, 25 May 2018 02:54:31 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S965748AbeEYJu7 (ORCPT + 99 others); Fri, 25 May 2018 05:50:59 -0400 Received: from foss.arm.com ([217.140.101.70]:57682 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S965466AbeEYJu5 (ORCPT ); Fri, 25 May 2018 05:50:57 -0400 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.72.51.249]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 4A7A780D; Fri, 25 May 2018 02:50:57 -0700 (PDT) Received: from e112298-lin.cambridge.arm.com (usa-sjc-imap-foss1.foss.arm.com [10.72.51.249]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPA id 248553F25D; Fri, 25 May 2018 02:50:54 -0700 (PDT) From: Julien Thierry To: linux-arm-kernel@lists.infradead.org Cc: linux-kernel@vger.kernel.org, daniel.thompson@linaro.org, joel@joelfernandes.org, marc.zyngier@arm.com, mark.rutland@arm.com, christoffer.dall@arm.com, james.morse@arm.com, catalin.marinas@arm.com, will.deacon@arm.com, Julien Thierry , Thomas Gleixner , Jason Cooper Subject: [PATCH v4 25/26] irqchip/gic-v3: Provide NMI handlers Date: Fri, 25 May 2018 10:49:31 +0100 Message-Id: <1527241772-48007-26-git-send-email-julien.thierry@arm.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1527241772-48007-1-git-send-email-julien.thierry@arm.com> References: <1527241772-48007-1-git-send-email-julien.thierry@arm.com> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Provide irqchip handlers that are NMI safe for PPIs and SPIs. Signed-off-by: Julien Thierry Cc: Thomas Gleixner Cc: Jason Cooper Cc: Marc Zyngier --- drivers/irqchip/irq-gic-v3.c | 44 ++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 44 insertions(+) diff --git a/drivers/irqchip/irq-gic-v3.c b/drivers/irqchip/irq-gic-v3.c index 4be5996..fa23d12 100644 --- a/drivers/irqchip/irq-gic-v3.c +++ b/drivers/irqchip/irq-gic-v3.c @@ -34,6 +34,8 @@ #include #include +#include + #include #include #include @@ -261,6 +263,48 @@ static inline bool gic_supports_nmi(void) && static_branch_likely(&have_non_secure_prio_view); } +/* + * Chip flow handler for SPIs set as NMI + */ +static void handle_fasteoi_nmi(struct irq_desc *desc) +{ + struct irq_chip *chip = irq_desc_get_chip(desc); + struct irqaction *action = desc->action; + unsigned int irq = irq_desc_get_irq(desc); + irqreturn_t res; + + if (chip->irq_ack) + chip->irq_ack(&desc->irq_data); + + trace_irq_handler_entry(irq, action); + res = action->handler(irq, action->dev_id); + trace_irq_handler_exit(irq, action, res); + + if (chip->irq_eoi) + chip->irq_eoi(&desc->irq_data); +} + +/* + * Chip flow handler for PPIs set as NMI + */ +static void handle_percpu_devid_nmi(struct irq_desc *desc) +{ + struct irq_chip *chip = irq_desc_get_chip(desc); + struct irqaction *action = desc->action; + unsigned int irq = irq_desc_get_irq(desc); + irqreturn_t res; + + if (chip->irq_ack) + chip->irq_ack(&desc->irq_data); + + trace_irq_handler_entry(irq, action); + res = action->handler(irq, raw_cpu_ptr(action->percpu_dev_id)); + trace_irq_handler_exit(irq, action, res); + + if (chip->irq_eoi) + chip->irq_eoi(&desc->irq_data); +} + static int gic_irq_set_irqchip_state(struct irq_data *d, enum irqchip_irq_state which, bool val) { -- 1.9.1