Skip to content

Commit

Permalink
powerpc/xmon: Don't signal we've entered until we're finished printing
Browse files Browse the repository at this point in the history
Currently we set our cpu's bit in cpus_in_xmon, and then we take the
output lock and print the exception information.

This can race with the master cpu entering the command loop and printing
the backtrace. The result is that the backtrace gets garbled with
another cpu's exception print out.

Fix it by delaying the set of cpus_in_xmon until we are finished
printing.

Signed-off-by: Michael Ellerman <[email protected]>
Signed-off-by: Benjamin Herrenschmidt <[email protected]>
  • Loading branch information
mpe authored and ozbenh committed Feb 11, 2014
1 parent 1507589 commit d2b496e
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion arch/powerpc/xmon/xmon.c
Original file line number Diff line number Diff line change
Expand Up @@ -404,7 +404,6 @@ static int xmon_core(struct pt_regs *regs, int fromipi)
}

xmon_fault_jmp[cpu] = recurse_jmp;
cpumask_set_cpu(cpu, &cpus_in_xmon);

bp = NULL;
if ((regs->msr & (MSR_IR|MSR_PR|MSR_64BIT)) == (MSR_IR|MSR_64BIT))
Expand All @@ -426,6 +425,8 @@ static int xmon_core(struct pt_regs *regs, int fromipi)
release_output_lock();
}

cpumask_set_cpu(cpu, &cpus_in_xmon);

waiting:
secondary = 1;
while (secondary && !xmon_gate) {
Expand Down

0 comments on commit d2b496e

Please sign in to comment.