From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga18.intel.com (mga18.intel.com [134.134.136.126]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by lists.ozlabs.org (Postfix) with ESMTPS id 4157k92gkGzDqsx for ; Wed, 13 Jun 2018 11:01:37 +1000 (AEST) From: Ricardo Neri To: Thomas Gleixner , Ingo Molnar , "H. Peter Anvin" Cc: Andi Kleen , Ashok Raj , Borislav Petkov , Tony Luck , "Ravi V. Shankar" , x86@kernel.org, sparclinux@vger.kernel.org, linuxppc-dev@lists.ozlabs.org, linux-kernel@vger.kernel.org, Ricardo Neri , Jacob Pan , Marc Zyngier , Bartosz Golaszewski , Doug Berger , Palmer Dabbelt , Randy Dunlap , iommu@lists.linux-foundation.org Subject: [RFC PATCH 02/23] genirq: Introduce IRQD_DELIVER_AS_NMI Date: Tue, 12 Jun 2018 17:57:22 -0700 Message-Id: <1528851463-21140-3-git-send-email-ricardo.neri-calderon@linux.intel.com> In-Reply-To: <1528851463-21140-1-git-send-email-ricardo.neri-calderon@linux.intel.com> References: <1528851463-21140-1-git-send-email-ricardo.neri-calderon@linux.intel.com> List-Id: Linux on PowerPC Developers Mail List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Certain interrupt controllers (e.g., APIC) are capable of delivering interrupts to the CPU as non-maskable. Add the new IRQD_DELIVER_AS_NMI interrupt state flag. The purpose of this flag is to communicate to the underlying irqchip whether the interrupt must be delivered in this manner. Cc: Ashok Raj Cc: Andi Kleen Cc: Tony Luck Cc: Borislav Petkov Cc: Jacob Pan Cc: Marc Zyngier Cc: Bartosz Golaszewski Cc: Doug Berger Cc: Palmer Dabbelt Cc: Randy Dunlap Cc: "Ravi V. Shankar" Cc: x86@kernel.org Cc: iommu@lists.linux-foundation.org Signed-off-by: Ricardo Neri --- include/linux/irq.h | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/include/linux/irq.h b/include/linux/irq.h index 65916a3..7271a2c 100644 --- a/include/linux/irq.h +++ b/include/linux/irq.h @@ -208,6 +208,7 @@ struct irq_data { * IRQD_SINGLE_TARGET - IRQ allows only a single affinity target * IRQD_DEFAULT_TRIGGER_SET - Expected trigger already been set * IRQD_CAN_RESERVE - Can use reservation mode + * IRQD_DELIVER_AS_NMI - Deliver this interrupt as non-maskable */ enum { IRQD_TRIGGER_MASK = 0xf, @@ -230,6 +231,7 @@ enum { IRQD_SINGLE_TARGET = (1 << 24), IRQD_DEFAULT_TRIGGER_SET = (1 << 25), IRQD_CAN_RESERVE = (1 << 26), + IRQD_DELIVER_AS_NMI = (1 << 27), }; #define __irqd_to_state(d) ACCESS_PRIVATE((d)->common, state_use_accessors) @@ -389,6 +391,16 @@ static inline bool irqd_can_reserve(struct irq_data *d) return __irqd_to_state(d) & IRQD_CAN_RESERVE; } +static inline void irqd_set_deliver_as_nmi(struct irq_data *d) +{ + __irqd_to_state(d) |= IRQD_DELIVER_AS_NMI; +} + +static inline bool irqd_deliver_as_nmi(struct irq_data *d) +{ + return __irqd_to_state(d) & IRQD_DELIVER_AS_NMI; +} + #undef __irqd_to_state static inline irq_hw_number_t irqd_to_hwirq(struct irq_data *d) -- 2.7.4