2005-04-17 06:20:36 +08:00
|
|
|
/*
|
|
|
|
* This file is subject to the terms and conditions of the GNU General Public
|
|
|
|
* License. See the file "COPYING" in the main directory of this archive
|
|
|
|
* for more details.
|
|
|
|
*
|
|
|
|
* Copyright (C) 1994 by Waldorf GMBH, written by Ralf Baechle
|
|
|
|
* Copyright (C) 1995, 96, 97, 98, 99, 2000, 01, 02, 03 by Ralf Baechle
|
|
|
|
*/
|
|
|
|
#ifndef _ASM_IRQ_H
|
|
|
|
#define _ASM_IRQ_H
|
|
|
|
|
|
|
|
#include <linux/linkage.h>
|
2009-06-19 21:05:26 +08:00
|
|
|
#include <linux/smp.h>
|
2006-04-05 16:45:45 +08:00
|
|
|
|
|
|
|
#include <asm/mipsmtregs.h>
|
|
|
|
|
2005-04-17 06:20:36 +08:00
|
|
|
#include <irq.h>
|
|
|
|
|
2016-12-19 22:20:56 +08:00
|
|
|
#define IRQ_STACK_SIZE THREAD_SIZE
|
2017-07-10 16:43:31 +08:00
|
|
|
#define IRQ_STACK_START (IRQ_STACK_SIZE - 16)
|
2016-12-19 22:20:56 +08:00
|
|
|
|
|
|
|
extern void *irq_stack[NR_CPUS];
|
|
|
|
|
2017-03-21 22:52:25 +08:00
|
|
|
/*
|
|
|
|
* The highest address on the IRQ stack contains a dummy frame put down in
|
|
|
|
* genex.S (handle_int & except_vec_vi_handler) which is structured as follows:
|
|
|
|
*
|
|
|
|
* top ------------
|
|
|
|
* | task sp | <- irq_stack[cpu] + IRQ_STACK_START
|
|
|
|
* ------------
|
|
|
|
* | | <- First frame of IRQ context
|
|
|
|
* ------------
|
|
|
|
*
|
|
|
|
* task sp holds a copy of the task stack pointer where the struct pt_regs
|
|
|
|
* from exception entry can be found.
|
|
|
|
*/
|
|
|
|
|
2016-12-19 22:20:56 +08:00
|
|
|
static inline bool on_irq_stack(int cpu, unsigned long sp)
|
|
|
|
{
|
|
|
|
unsigned long low = (unsigned long)irq_stack[cpu];
|
|
|
|
unsigned long high = low + IRQ_STACK_SIZE;
|
|
|
|
|
|
|
|
return (low <= sp && sp <= high);
|
|
|
|
}
|
|
|
|
|
2005-04-17 06:20:36 +08:00
|
|
|
#ifdef CONFIG_I8259
|
|
|
|
static inline int irq_canonicalize(int irq)
|
|
|
|
{
|
2007-01-14 22:41:42 +08:00
|
|
|
return ((irq == I8259A_IRQ_BASE + 2) ? I8259A_IRQ_BASE + 9 : irq);
|
2005-04-17 06:20:36 +08:00
|
|
|
}
|
|
|
|
#else
|
|
|
|
#define irq_canonicalize(irq) (irq) /* Sane hardware, sane code ... */
|
|
|
|
#endif
|
|
|
|
|
2014-08-14 06:09:36 +08:00
|
|
|
asmlinkage void plat_irq_dispatch(void);
|
|
|
|
|
2009-11-20 20:34:33 +08:00
|
|
|
extern void do_IRQ(unsigned int irq);
|
2005-04-17 06:20:36 +08:00
|
|
|
|
2021-07-06 18:38:59 +08:00
|
|
|
struct irq_domain;
|
|
|
|
extern void do_domain_IRQ(struct irq_domain *domain, unsigned int irq);
|
|
|
|
|
2005-04-17 06:20:36 +08:00
|
|
|
extern void arch_init_irq(void);
|
2006-10-08 02:44:33 +08:00
|
|
|
extern void spurious_interrupt(void);
|
2005-04-17 06:20:36 +08:00
|
|
|
|
2007-06-21 05:27:10 +08:00
|
|
|
/*
|
|
|
|
* Before R2 the timer and performance counter interrupts were both fixed to
|
2013-01-22 19:59:30 +08:00
|
|
|
* IE7. Since R2 their number has to be read from the c0_intctl register.
|
2007-06-21 05:27:10 +08:00
|
|
|
*/
|
|
|
|
#define CP0_LEGACY_COMPARE_IRQ 7
|
2012-07-07 05:56:00 +08:00
|
|
|
#define CP0_LEGACY_PERFCNT_IRQ 7
|
2007-06-21 05:27:10 +08:00
|
|
|
|
|
|
|
extern int cp0_compare_irq;
|
2009-12-22 09:49:22 +08:00
|
|
|
extern int cp0_compare_irq_shift;
|
2007-06-21 05:27:10 +08:00
|
|
|
extern int cp0_perfcount_irq;
|
2015-01-29 19:14:07 +08:00
|
|
|
extern int cp0_fdc_irq;
|
|
|
|
|
2015-07-13 07:11:46 +08:00
|
|
|
extern int get_c0_fdc_int(void);
|
2007-06-21 05:27:10 +08:00
|
|
|
|
nmi_backtrace: add more trigger_*_cpu_backtrace() methods
Patch series "improvements to the nmi_backtrace code" v9.
This patch series modifies the trigger_xxx_backtrace() NMI-based remote
backtracing code to make it more flexible, and makes a few small
improvements along the way.
The motivation comes from the task isolation code, where there are
scenarios where we want to be able to diagnose a case where some cpu is
about to interrupt a task-isolated cpu. It can be helpful to see both
where the interrupting cpu is, and also an approximation of where the
cpu that is being interrupted is. The nmi_backtrace framework allows us
to discover the stack of the interrupted cpu.
I've tested that the change works as desired on tile, and build-tested
x86, arm, mips, and sparc64. For x86 I confirmed that the generic
cpuidle stuff as well as the architecture-specific routines are in the
new cpuidle section. For arm, mips, and sparc I just build-tested it
and made sure the generic cpuidle routines were in the new cpuidle
section, but I didn't attempt to figure out which the platform-specific
idle routines might be. That might be more usefully done by someone
with platform experience in follow-up patches.
This patch (of 4):
Currently you can only request a backtrace of either all cpus, or all
cpus but yourself. It can also be helpful to request a remote backtrace
of a single cpu, and since we want that, the logical extension is to
support a cpumask as the underlying primitive.
This change modifies the existing lib/nmi_backtrace.c code to take a
cpumask as its basic primitive, and modifies the linux/nmi.h code to use
the new "cpumask" method instead.
The existing clients of nmi_backtrace (arm and x86) are converted to
using the new cpumask approach in this change.
The other users of the backtracing API (sparc64 and mips) are converted
to use the cpumask approach rather than the all/allbutself approach.
The mips code ignored the "include_self" boolean but with this change it
will now also dump a local backtrace if requested.
Link: http://lkml.kernel.org/r/1472487169-14923-2-git-send-email-cmetcalf@mellanox.com
Signed-off-by: Chris Metcalf <cmetcalf@mellanox.com>
Tested-by: Daniel Thompson <daniel.thompson@linaro.org> [arm]
Reviewed-by: Aaron Tomlin <atomlin@redhat.com>
Reviewed-by: Petr Mladek <pmladek@suse.com>
Cc: "Rafael J. Wysocki" <rjw@rjwysocki.net>
Cc: Russell King <linux@arm.linux.org.uk>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: Ingo Molnar <mingo@elte.hu>
Cc: Ralf Baechle <ralf@linux-mips.org>
Cc: David Miller <davem@davemloft.net>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2016-10-08 08:02:45 +08:00
|
|
|
void arch_trigger_cpumask_backtrace(const struct cpumask *mask,
|
|
|
|
bool exclude_self);
|
|
|
|
#define arch_trigger_cpumask_backtrace arch_trigger_cpumask_backtrace
|
2014-10-22 14:39:56 +08:00
|
|
|
|
2005-04-17 06:20:36 +08:00
|
|
|
#endif /* _ASM_IRQ_H */
|