@@ -50,6 +50,7 @@ static inline void arch_kgdb_breakpoint(void)
extern void kgdb_handle_bus_error(void);
extern int kgdb_fault_expected;
+extern int kgdb_fiq_enabled;
extern char kgdb_fiq_handler;
extern char kgdb_fiq_handler_end;
asmlinkage void __exception_irq_entry kgdb_fiq_do_handle(struct pt_regs *regs);
@@ -175,14 +175,26 @@ static struct undef_hook kgdb_compiled_brkpt_hook = {
static void kgdb_call_nmi_hook(void *ignored)
{
- kgdb_nmicallback(raw_smp_processor_id(), get_irq_regs());
+ kgdb_nmicallback(raw_smp_processor_id(), get_irq_regs());
}
void kgdb_roundup_cpus(unsigned long flags)
{
- local_irq_enable();
- smp_call_function(kgdb_call_nmi_hook, NULL, 0);
- local_irq_disable();
+#ifdef CONFIG_FIQ
+ struct cpumask mask;
+
+ if (kgdb_fiq_enabled) {
+ cpumask_copy(&mask, cpu_online_mask);
+ cpumask_clear_cpu(raw_smp_processor_id(), &mask);
+ if (!cpumask_empty(&mask))
+ send_fiq_ipi_mask(&mask);
+ return;
+ }
+#endif
+
+ local_irq_enable();
+ smp_call_function(kgdb_call_nmi_hook, NULL, 0);
+ local_irq_disable();
}
static int __kgdb_notify(struct die_args *args, unsigned long cmd)
@@ -24,7 +24,7 @@
#include <asm/fiq.h>
#include <asm/exception.h>
-static int kgdb_fiq_enabled;
+int kgdb_fiq_enabled;
module_param_named(enable, kgdb_fiq_enabled, int, 0600);
MODULE_PARM_DESC(enable, "set to 1 to enable FIQ KGDB");
@@ -40,6 +40,11 @@ asmlinkage void __exception_irq_entry kgdb_fiq_do_handle(struct pt_regs *regs)
{
int actual;
+ if (!kgdb_nmicallback(raw_smp_processor_id(), regs)) {
+ handle_IPI_FIQ(regs);
+ return;
+ }
+
nmi_enter();
actual = ack_fiq(kgdb_fiq);
WARN_ON(actual != kgdb_fiq);
Rounding up the other CPUs using FIQ improves debugger robustness. Signed-off-by: Daniel Thompson <daniel.thompson@linaro.org> --- arch/arm/include/asm/kgdb.h | 1 + arch/arm/kernel/kgdb.c | 20 ++++++++++++++++---- arch/arm/kernel/kgdb_fiq.c | 7 ++++++- 3 files changed, 23 insertions(+), 5 deletions(-)