mirror of
https://github.com/Fishwaldo/Star64_linux.git
synced 2025-07-03 21:01:50 +00:00
Merge branch 'x86-debug-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip
Pull x86 kgdb fixlet from Ingo Molnar: "A single debugging related commit: compress the memory usage of a kgdb data structure" * 'x86-debug-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: x86/kgdb: Replace bool_int_array[NR_CPUS] with bitmap
This commit is contained in:
commit
0f25f2c1b1
1 changed files with 11 additions and 6 deletions
|
@ -511,26 +511,31 @@ single_step_cont(struct pt_regs *regs, struct die_args *args)
|
||||||
return NOTIFY_STOP;
|
return NOTIFY_STOP;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int was_in_debug_nmi[NR_CPUS];
|
static DECLARE_BITMAP(was_in_debug_nmi, NR_CPUS);
|
||||||
|
|
||||||
static int kgdb_nmi_handler(unsigned int cmd, struct pt_regs *regs)
|
static int kgdb_nmi_handler(unsigned int cmd, struct pt_regs *regs)
|
||||||
{
|
{
|
||||||
|
int cpu;
|
||||||
|
|
||||||
switch (cmd) {
|
switch (cmd) {
|
||||||
case NMI_LOCAL:
|
case NMI_LOCAL:
|
||||||
if (atomic_read(&kgdb_active) != -1) {
|
if (atomic_read(&kgdb_active) != -1) {
|
||||||
/* KGDB CPU roundup */
|
/* KGDB CPU roundup */
|
||||||
kgdb_nmicallback(raw_smp_processor_id(), regs);
|
cpu = raw_smp_processor_id();
|
||||||
was_in_debug_nmi[raw_smp_processor_id()] = 1;
|
kgdb_nmicallback(cpu, regs);
|
||||||
|
set_bit(cpu, was_in_debug_nmi);
|
||||||
touch_nmi_watchdog();
|
touch_nmi_watchdog();
|
||||||
|
|
||||||
return NMI_HANDLED;
|
return NMI_HANDLED;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case NMI_UNKNOWN:
|
case NMI_UNKNOWN:
|
||||||
if (was_in_debug_nmi[raw_smp_processor_id()]) {
|
cpu = raw_smp_processor_id();
|
||||||
was_in_debug_nmi[raw_smp_processor_id()] = 0;
|
|
||||||
|
if (__test_and_clear_bit(cpu, was_in_debug_nmi))
|
||||||
return NMI_HANDLED;
|
return NMI_HANDLED;
|
||||||
}
|
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
/* do nothing */
|
/* do nothing */
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue