]> git.kernelconcepts.de Git - karo-tx-linux.git/commit
x86/unwind: Properly zero-pad 32-bit values in unwind_dump()
authorJosh Poimboeuf <jpoimboe@redhat.com>
Tue, 18 Apr 2017 13:12:56 +0000 (08:12 -0500)
committerIngo Molnar <mingo@kernel.org>
Wed, 19 Apr 2017 07:59:47 +0000 (09:59 +0200)
commit9b135b234644c9881eee4f5d5683da0f4524722f
tree59bb5449bf33f8169ff07c298bec0a4aacb0bfe5
parente335bb51cc15e80ac180701a0d335ef1c050828e
x86/unwind: Properly zero-pad 32-bit values in unwind_dump()

On x86-32, 32-bit stack values printed by unwind_dump() are confusingly
zero-padded to 16 characters (64 bits):

  unwind stack type:0 next_sp:  (null) mask:a graph_idx:0
  f50cdebc00000000f50cdec4 (0xf50cdec4)
  f50cdec000000000c40489b7 (irq_exit+0x87/0xa0)
  ...

Instead, base the field width on the size of a long integer so that it
looks right on both x86-32 and x86-64.

x86-32:

  unwind stack type:1 next_sp:  (null) mask:0x2 graph_idx:0
  c0ee9d98c0ee9de0 (init_thread_union+0x1de0/0x2000)
  c0ee9d9cc043fd90 (__save_stack_trace+0x50/0xe0)
  ...

x86-64:

  unwind stack type:1 next_sp:          (null) mask:0x2 graph_idx:0
  ffffffff81e03b88ffffffff81e03c10 (init_thread_union+0x3c10/0x4000)
  ffffffff81e03b90ffffffff81048f8e (__save_stack_trace+0x5e/0x100)
  ...

Reported-by: H. Peter Anvin <hpa@zytor.com>
Signed-off-by: Josh Poimboeuf <jpoimboe@redhat.com>
Cc: Andy Lutomirski <luto@kernel.org>
Cc: Borislav Petkov <bp@alien8.de>
Cc: Brian Gerst <brgerst@gmail.com>
Cc: Denys Vlasenko <dvlasenk@redhat.com>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Thomas Gleixner <tglx@linutronix.de>
Link: http://lkml.kernel.org/r/36b743812e7eb291d74af4e5067736736622daad.1492520933.git.jpoimboe@redhat.com
Signed-off-by: Ingo Molnar <mingo@kernel.org>
arch/x86/kernel/unwind_frame.c