OpenCloudOS-Kernel/arch/powerpc
Christophe Leroy fb2d9505c0 powerpc/process: Fix interleaved output in show_user_instructions()
When two processes crash at the same time, we sometimes encounter
interleaving in the middle of a line:

  init[1]: segfault (11) at 0 nip 0 lr 0 code 1
  init[1]: code: XXXXXXXX XXXXXXXX XXXXXXXX XXXXXXXX
  init[74]: segfault (11) at 10a74 nip 1000c198 lr 100078c8 code 1 in sh[10000000+14000]
  XXXXXXXX XXXXXXXX XXXXXXXX XXXXXXXX
  init[1]: code: XXXXXXXX XXXXXXXX XXXXXXXX XXXXXXXX XXXXXXXX XXXXXXXX XXXXXXXX XXXXXXXX
  init[74]: code: 90010024 bf61000c 91490a7c 3fa01002 3be00000 7d3e4b78 3bbd0c20 3b600000
  init[74]: code: 3b9d0040 7c7fe02e 2f830000 419e0028 <89230000> 2f890000 41be001c 4b7f6e79

This patch fixes it by preparing complete lines in a buffer and
printing it at once.

Fixes: 88b0fe1757 ("powerpc: Add show_user_instructions()")
Reviewed-by: Murilo Opsfelder Araujo <muriloo@linux.ibm.com>
Signed-off-by: Christophe Leroy <christophe.leroy@c-s.fr>
[mpe: Use seq_buf_printf() not seq_buf_puts() which doesn't NULL terminate]
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
2018-10-13 22:21:25 +11:00
..
boot powerpc/boot: Ensure _zimage_start is a weak symbol 2018-09-19 22:08:12 +10:00
configs powerpc/config: Enable CONFIG_PRINTK_TIME 2018-10-03 15:40:06 +10:00
crypto powerpc updates for 4.19 2018-08-17 11:32:50 -07:00
include Merge branch 'fixes' into next 2018-10-09 16:51:05 +11:00
kernel powerpc/process: Fix interleaved output in show_user_instructions() 2018-10-13 22:21:25 +11:00
kvm PPC KVM fixes for 4.19 2018-09-04 21:12:46 +02:00
lib Merge branch 'fixes' into next 2018-10-09 16:51:05 +11:00
math-emu License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
mm Merge branch 'fixes' into next 2018-10-09 16:51:05 +11:00
net powerpc updates for 4.19 2018-08-17 11:32:50 -07:00
oprofile treewide: kzalloc() -> kcalloc() 2018-06-12 16:19:22 -07:00
perf powerpc/perf: Add missing break in power7_marked_instr_event() 2018-10-03 15:39:45 +10:00
platforms Merge branch 'fixes' into next 2018-10-09 16:51:05 +11:00
purgatory powerpc updates for 4.19 2018-08-17 11:32:50 -07:00
sysdev powerpc/xive: Move a dereference below a NULL test 2018-10-03 15:40:02 +10:00
tools powerpc: Add a checkpatch wrapper with our preferred settings 2018-08-07 21:49:25 +10:00
xmon Revert "convert SLB miss handlers to C" and subsequent commits 2018-10-03 15:32:49 +10:00
Kconfig powerpc/64: add stack protector support 2018-10-03 15:40:03 +10:00
Kconfig.debug Kconfig: consolidate the "Kernel hacking" menu 2018-08-02 08:06:48 +09:00
Makefile powerpc: remove leftover code of old GCC version checks 2018-10-04 16:54:51 +10:00
Makefile.postlink License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00