Skip to content

Commit d2b496e

Browse files
mpeozbenh
authored andcommitted
powerpc/xmon: Don't signal we've entered until we're finished printing
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]>
1 parent 1507589 commit d2b496e

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

arch/powerpc/xmon/xmon.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -404,7 +404,6 @@ static int xmon_core(struct pt_regs *regs, int fromipi)
404404
}
405405

406406
xmon_fault_jmp[cpu] = recurse_jmp;
407-
cpumask_set_cpu(cpu, &cpus_in_xmon);
408407

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

428+
cpumask_set_cpu(cpu, &cpus_in_xmon);
429+
429430
waiting:
430431
secondary = 1;
431432
while (secondary && !xmon_gate) {

0 commit comments

Comments
 (0)