From b0db682226f97f31fdf9bda9f19fd01f5e24da54 Mon Sep 17 00:00:00 2001 From: zr_yy Date: Sat, 3 Jun 2023 22:44:17 +0800 Subject: [PATCH 1/7] irqstat: Get rid of nmi_count() and __IRQ_STAT() commit 9e9893dc34dea3c18ce2c4c68891df604bffce11 upstream. Nothing uses this anymore. Signed-off-by: Thomas Gleixner Reviewed-by: Frederic Weisbecker Link: https://lore.kernel.org/r/20201113141733.005212732@linutronix.de Signed-off-by: Sebastian Andrzej Siewior --- include/linux/irq_cpustat.h | 4 ---- 1 file changed, 4 deletions(-) diff --git a/include/linux/irq_cpustat.h b/include/linux/irq_cpustat.h index 6e8895cd4d92..78fb2de3ea4d 100644 --- a/include/linux/irq_cpustat.h +++ b/include/linux/irq_cpustat.h @@ -19,10 +19,6 @@ #ifndef __ARCH_IRQ_STAT DECLARE_PER_CPU_ALIGNED(irq_cpustat_t, irq_stat); /* defined in asm/hardirq.h */ -#define __IRQ_STAT(cpu, member) (per_cpu(irq_stat.member, cpu)) #endif -/* arch dependent irq_stat fields */ -#define nmi_count(cpu) __IRQ_STAT((cpu), __nmi_count) /* i386 */ - #endif /* __irq_cpustat_h */ -- Gitee From 125d3b7a52f78b2a87d6f3d589f462fc726b6825 Mon Sep 17 00:00:00 2001 From: zr_yy Date: Sat, 3 Jun 2023 22:44:30 +0800 Subject: [PATCH 2/7] um/irqstat: Get rid of the duplicated declarations commit 65e2155fb147cf2fbaa5fb8a074da661178c6448 upstream. irq_cpustat_t and ack_bad_irq() are exactly the same as the asm-generic ones. Signed-off-by: Thomas Gleixner Reviewed-by: Frederic Weisbecker Link: https://lore.kernel.org/r/20201113141733.156361337@linutronix.de Signed-off-by: Sebastian Andrzej Siewior --- arch/um/include/asm/hardirq.h | 17 +---------------- 1 file changed, 1 insertion(+), 16 deletions(-) diff --git a/arch/um/include/asm/hardirq.h b/arch/um/include/asm/hardirq.h index b426796d26fd..52e2c36267a9 100644 --- a/arch/um/include/asm/hardirq.h +++ b/arch/um/include/asm/hardirq.h @@ -2,22 +2,7 @@ #ifndef __ASM_UM_HARDIRQ_H #define __ASM_UM_HARDIRQ_H -#include -#include - -typedef struct { - unsigned int __softirq_pending; -} ____cacheline_aligned irq_cpustat_t; - -#include /* Standard mappings for irq_cpustat_t above */ -#include - -#ifndef ack_bad_irq -static inline void ack_bad_irq(unsigned int irq) -{ - printk(KERN_CRIT "unexpected IRQ trap at vector %02x\n", irq); -} -#endif +#include #define __ARCH_IRQ_EXIT_IRQS_DISABLED 1 -- Gitee From edab88cce6c05ee9f4f6ab26cc36753381242293 Mon Sep 17 00:00:00 2001 From: zr_yy Date: Sat, 3 Jun 2023 22:48:03 +0800 Subject: [PATCH 3/7] ARM: irqstat: Get rid of duplicated declaration commit ecef70e8d30e1c10d3d33da011a46fe215f4cfb5 upstream. irq_cpustat_t is exactly the same as the asm-generic one. Define ack_bad_irq so the generic header does not emit the generic version of it. Signed-off-by: Thomas Gleixner Reviewed-by: Frederic Weisbecker Reviewed-by: Valentin Schneider Link: https://lore.kernel.org/r/20201113141733.276505871@linutronix.de Signed-off-by: Sebastian Andrzej Siewior --- arch/arm/include/asm/hardirq.h | 11 +++-------- arch/arm/include/asm/irq.h | 2 ++ 2 files changed, 5 insertions(+), 8 deletions(-) diff --git a/arch/arm/include/asm/hardirq.h b/arch/arm/include/asm/hardirq.h index b95848ed2bc7..706efafbf972 100644 --- a/arch/arm/include/asm/hardirq.h +++ b/arch/arm/include/asm/hardirq.h @@ -2,16 +2,11 @@ #ifndef __ASM_HARDIRQ_H #define __ASM_HARDIRQ_H -#include -#include #include -typedef struct { - unsigned int __softirq_pending; -} ____cacheline_aligned irq_cpustat_t; - -#include /* Standard mappings for irq_cpustat_t above */ - #define __ARCH_IRQ_EXIT_IRQS_DISABLED 1 +#define ack_bad_irq ack_bad_irq + +#include #endif /* __ASM_HARDIRQ_H */ diff --git a/arch/arm/include/asm/irq.h b/arch/arm/include/asm/irq.h index 54b0180c8aeb..36d040c68163 100644 --- a/arch/arm/include/asm/irq.h +++ b/arch/arm/include/asm/irq.h @@ -31,6 +31,8 @@ void handle_IRQ(unsigned int, struct pt_regs *); void init_IRQ(void); #ifdef CONFIG_SMP +#include + extern bool arch_trigger_cpumask_backtrace(const cpumask_t *mask, bool exclude_self); #define arch_trigger_cpumask_backtrace arch_trigger_cpumask_backtrace -- Gitee From 1ecf3c370ee11706d6aad056c71a7137cc37252f Mon Sep 17 00:00:00 2001 From: zr_yy Date: Sat, 3 Jun 2023 22:48:23 +0800 Subject: [PATCH 4/7] arm64: irqstat: Get rid of duplicated declaration commit 137ce79415dc26d19b76efb5a62322999c85a999 upstream. irq_cpustat_t is exactly the same as the asm-generic one. Define ack_bad_irq so the generic header does not emit the generic version of it. Signed-off-by: Thomas Gleixner Reviewed-by: Frederic Weisbecker Acked-by: Will Deacon Acked-by: Marc Zyngier Link: https://lore.kernel.org/r/20201113141733.392015387@linutronix.de Signed-off-by: Sebastian Andrzej Siewior --- arch/arm64/include/asm/hardirq.h | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/arch/arm64/include/asm/hardirq.h b/arch/arm64/include/asm/hardirq.h index 5ffa4bacdad3..cbfa7b6f2e09 100644 --- a/arch/arm64/include/asm/hardirq.h +++ b/arch/arm64/include/asm/hardirq.h @@ -13,11 +13,8 @@ #include #include -typedef struct { - unsigned int __softirq_pending; -} ____cacheline_aligned irq_cpustat_t; - -#include /* Standard mappings for irq_cpustat_t above */ +#define ack_bad_irq ack_bad_irq +#include #define __ARCH_IRQ_EXIT_IRQS_DISABLED 1 -- Gitee From b6f5b9c8bdba38e44d88210ef6adf33b80174a38 Mon Sep 17 00:00:00 2001 From: zr_yy Date: Sat, 3 Jun 2023 22:48:42 +0800 Subject: [PATCH 5/7] asm-generic/irqstat: Add optional __nmi_count member commit 2de9842e73a471c6f66bf2878290d0f404b9ef3b upstream. Add an optional __nmi_count member to irq_cpustat_t so more architectures can use the generic version. Signed-off-by: Thomas Gleixner Reviewed-by: Frederic Weisbecker Link: https://lore.kernel.org/r/20201113141733.501611990@linutronix.de Signed-off-by: Sebastian Andrzej Siewior --- include/asm-generic/hardirq.h | 3 +++ 1 file changed, 3 insertions(+) diff --git a/include/asm-generic/hardirq.h b/include/asm-generic/hardirq.h index d14214dfc10b..f5dd99781e3c 100644 --- a/include/asm-generic/hardirq.h +++ b/include/asm-generic/hardirq.h @@ -7,6 +7,9 @@ typedef struct { unsigned int __softirq_pending; +#ifdef ARCH_WANTS_NMI_IRQSTAT + unsigned int __nmi_count; +#endif } ____cacheline_aligned irq_cpustat_t; #include /* Standard mappings for irq_cpustat_t above */ -- Gitee From c3350a1c51f213e2fedf4061171932820cf02c7b Mon Sep 17 00:00:00 2001 From: zr_yy Date: Sat, 3 Jun 2023 22:48:49 +0800 Subject: [PATCH 6/7] sh: irqstat: Use the generic irq_cpustat_t commit dff05404810db1a9a32f8bedf102b4f29ce7216a upstream. SH can now use the generic irq_cpustat_t. Define ack_bad_irq so the generic header does not emit the generic version of it. Signed-off-by: Thomas Gleixner Reviewed-by: Frederic Weisbecker Link: https://lore.kernel.org/r/20201113141733.625146223@linutronix.de Signed-off-by: Sebastian Andrzej Siewior --- arch/sh/include/asm/hardirq.h | 14 ++++---------- 1 file changed, 4 insertions(+), 10 deletions(-) diff --git a/arch/sh/include/asm/hardirq.h b/arch/sh/include/asm/hardirq.h index edaea3559a23..9fe4495a8e90 100644 --- a/arch/sh/include/asm/hardirq.h +++ b/arch/sh/include/asm/hardirq.h @@ -2,16 +2,10 @@ #ifndef __ASM_SH_HARDIRQ_H #define __ASM_SH_HARDIRQ_H -#include -#include - -typedef struct { - unsigned int __softirq_pending; - unsigned int __nmi_count; /* arch dependent */ -} ____cacheline_aligned irq_cpustat_t; - -#include /* Standard mappings for irq_cpustat_t above */ - extern void ack_bad_irq(unsigned int irq); +#define ack_bad_irq ack_bad_irq +#define ARCH_WANTS_NMI_IRQSTAT + +#include #endif /* __ASM_SH_HARDIRQ_H */ -- Gitee From 9a31849fe01d1ab318c207e4387db25def263465 Mon Sep 17 00:00:00 2001 From: zr_yy Date: Sat, 3 Jun 2023 22:48:57 +0800 Subject: [PATCH 7/7] irqstat: Move declaration into asm-generic/hardirq.h commit 9a9ae83b678beb1b6d7d465a8db8a85a9e2e79d9 upstream. Move the declaration of the irq_cpustat per cpu variable to asm-generic/hardirq.h and remove the now empty linux/irq_cpustat.h header. Signed-off-by: Thomas Gleixner Reviewed-by: Frederic Weisbecker Link: https://lore.kernel.org/r/20201113141733.737377332@linutronix.de Signed-off-by: Sebastian Andrzej Siewior --- include/asm-generic/hardirq.h | 3 ++- include/linux/irq_cpustat.h | 24 ------------------------ 2 files changed, 2 insertions(+), 25 deletions(-) delete mode 100644 include/linux/irq_cpustat.h diff --git a/include/asm-generic/hardirq.h b/include/asm-generic/hardirq.h index f5dd99781e3c..7317e8258b48 100644 --- a/include/asm-generic/hardirq.h +++ b/include/asm-generic/hardirq.h @@ -12,7 +12,8 @@ typedef struct { #endif } ____cacheline_aligned irq_cpustat_t; -#include /* Standard mappings for irq_cpustat_t above */ +DECLARE_PER_CPU_ALIGNED(irq_cpustat_t, irq_stat); + #include #ifndef ack_bad_irq diff --git a/include/linux/irq_cpustat.h b/include/linux/irq_cpustat.h deleted file mode 100644 index 78fb2de3ea4d..000000000000 --- a/include/linux/irq_cpustat.h +++ /dev/null @@ -1,24 +0,0 @@ -/* SPDX-License-Identifier: GPL-2.0 */ -#ifndef __irq_cpustat_h -#define __irq_cpustat_h - -/* - * Contains default mappings for irq_cpustat_t, used by almost every - * architecture. Some arch (like s390) have per cpu hardware pages and - * they define their own mappings for irq_stat. - * - * Keith Owens July 2000. - */ - - -/* - * Simple wrappers reducing source bloat. Define all irq_stat fields - * here, even ones that are arch dependent. That way we get common - * definitions instead of differing sets for each arch. - */ - -#ifndef __ARCH_IRQ_STAT -DECLARE_PER_CPU_ALIGNED(irq_cpustat_t, irq_stat); /* defined in asm/hardirq.h */ -#endif - -#endif /* __irq_cpustat_h */ -- Gitee