public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [RFC PATCH -tip 00/16] in-kernel x86 disassember
@ 2012-04-01 16:02 Masami Hiramatsu
  2012-04-01 16:02 ` [RFC PATCH -tip 01/16] x86: Split default64 flag from force64 flag Masami Hiramatsu
                   ` (18 more replies)
  0 siblings, 19 replies; 25+ messages in thread
From: Masami Hiramatsu @ 2012-04-01 16:02 UTC (permalink / raw)
  To: linux-kernel
  Cc: Huang Ying, Ananth N Mavinakayanahalli, Frederic Weisbecker,
	H. Peter Anvin, Ingo Molnar, Jason Wessel, Thomas Gleixner,
	Peter Zijlstra

Hi,

Here is a series of patches of the in-kernel x86 disassembler
for the latest tip tree.
This will show you a pretty disassembled code instead of
just a digital code sequence when you gets a kernel panic etc.
(I know, we also have script/decodecode for the panic use)

This feature is not for users, but mainly for kernel developers
who can understand disassembly code of x86 ;). This is just like
a joke feature in kernel. (yeah, I spend my spare time for this.
It's my fun :))

Currently, this can disassemble only most popular instructions
in-kernel, such as non-SSE, non-MMX, non-AVX, and so on, becuase
these extended instructions are rarely used in kernel :)
This series supports AT&T syntax, but not fully same as objdump.
Still it doesn't decode instruction suffix of operand size
(w,d,q etc).

The series is also hosted on a repository on GitHub,
you can get the latest version from below public repository.

 git://github.com/mhiramat/linux.git

This series adds below features:

 - Debugfs disassembler interface for kernel function. You can disassemble
   running kernel function on-line.
 - Panic dump shows disassembly code instead of instruction byte stream.
   It generates more human-readable report. (I strongly recommend you to
   add a serial logger if it is enabled :))
 - Disassemble command for KDB. 'dis' command is now available.
 - User-land disassembly tool.

Thank you,

---

Masami Hiramatsu (16):
      x86: Split default64 flag from force64 flag
      x86: Change the order of segment prefix macro
      x86: Add bogus disassembler support
      x86: Show kernel symbol in disassembler
      x86: Disassemble x86-64 only instructions
      x86: Change asm syntax to AT&T-like one
      kdb: Provide original instruction modified by sw breakpoint
      x86/kprobes: Recover breakpoint instruction if KGDB knows
      x86: kernel function disassembly interface
      x86/disasm: Indicate modified instructions
      tracing/docs: add explanation about disassembler interface
      x86: Merge code dump in show_registers
      x86: Disassemble support in register dump
      x86: Indicate trapped address and probed address
      x86/kdb: Add x86 disassembe command
      tools/bogodis: Add bogus disassembler tool in userspace


 Documentation/trace/kprobetrace.txt      |   14 +
 arch/x86/Kconfig.debug                   |   16 +
 arch/x86/include/asm/disasm.h            |   14 +
 arch/x86/include/asm/inat.h              |   38 ++
 arch/x86/include/asm/insn.h              |   16 +
 arch/x86/include/asm/kdebug.h            |    1 
 arch/x86/include/asm/kprobes.h           |    2 
 arch/x86/kernel/dumpstack.c              |  146 +++++++++
 arch/x86/kernel/dumpstack_32.c           |   26 --
 arch/x86/kernel/dumpstack_64.c           |   25 -
 arch/x86/kernel/kdebugfs.c               |  159 +++++++++
 arch/x86/kernel/kgdb.c                   |   72 ++++
 arch/x86/kernel/kprobes.c                |    9 +
 arch/x86/lib/Makefile                    |   18 +
 arch/x86/lib/disasm.c                    |  508 ++++++++++++++++++++++++++++++
 arch/x86/lib/insn.c                      |    2 
 arch/x86/lib/mnemonic.c                  |   96 ++++++
 arch/x86/tools/gen-insn-attr-x86.awk     |    7 
 arch/x86/tools/gen-insn-mnemonic-x86.awk |  352 +++++++++++++++++++++
 include/linux/kdb.h                      |    3 
 include/linux/kgdb.h                     |    1 
 kernel/debug/debug_core.c                |   14 +
 kernel/debug/kdb/kdb_main.c              |   35 ++
 tools/bogodis/Makefile                   |   51 +++
 tools/bogodis/bogodis.c                  |  202 ++++++++++++
 25 files changed, 1759 insertions(+), 68 deletions(-)
 create mode 100644 arch/x86/include/asm/disasm.h
 create mode 100644 arch/x86/lib/disasm.c
 create mode 100644 arch/x86/lib/mnemonic.c
 create mode 100644 arch/x86/tools/gen-insn-mnemonic-x86.awk
 create mode 100644 tools/bogodis/Makefile
 create mode 100644 tools/bogodis/bogodis.c

--
Masami Hiramatsu <masami.hiramatsu@gmail.com>
 

^ permalink raw reply	[flat|nested] 25+ messages in thread

end of thread, other threads:[~2012-04-03 16:10 UTC | newest]

Thread overview: 25+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-04-01 16:02 [RFC PATCH -tip 00/16] in-kernel x86 disassember Masami Hiramatsu
2012-04-01 16:02 ` [RFC PATCH -tip 01/16] x86: Split default64 flag from force64 flag Masami Hiramatsu
2012-04-01 16:02 ` [RFC PATCH -tip 02/16] x86: Change the order of segment prefix macro Masami Hiramatsu
2012-04-01 16:02 ` [RFC PATCH -tip 03/16] x86: Add bogus disassembler support Masami Hiramatsu
2012-04-01 16:03 ` [RFC PATCH -tip 04/16] x86: Show kernel symbol in disassembler Masami Hiramatsu
2012-04-01 16:03 ` [RFC PATCH -tip 05/16] x86: Disassemble x86-64 only instructions Masami Hiramatsu
2012-04-01 16:03 ` [RFC PATCH -tip 06/16] x86: Change asm syntax to AT&T-like one Masami Hiramatsu
2012-04-01 16:03 ` [RFC PATCH -tip 07/16] kdb: Provide original instruction modified by sw breakpoint Masami Hiramatsu
2012-04-01 16:03 ` [RFC PATCH -tip 08/16] x86/kprobes: Recover breakpoint instruction if KGDB knows Masami Hiramatsu
2012-04-01 16:03 ` [RFC PATCH -tip 09/16] x86: kernel function disassembly interface Masami Hiramatsu
2012-04-01 16:03 ` [RFC PATCH -tip 10/16] x86/disasm: Indicate modified instructions Masami Hiramatsu
2012-04-01 16:04 ` [RFC PATCH -tip 11/16] tracing/docs: add explanation about disassembler interface Masami Hiramatsu
2012-04-01 16:04 ` [RFC PATCH -tip 12/16] x86: Merge code dump in show_registers Masami Hiramatsu
2012-04-01 16:04 ` [RFC PATCH -tip 13/16] x86: Disassemble support in register dump Masami Hiramatsu
2012-04-01 16:04 ` [RFC PATCH -tip 14/16] x86: Indicate trapped address and probed address Masami Hiramatsu
2012-04-01 16:04 ` [RFC PATCH -tip 15/16] x86/kdb: Add x86 disassembe command Masami Hiramatsu
2012-04-01 16:05 ` [RFC PATCH -tip 16/16] tools/bogodis: Add bogus disassembler tool in userspace Masami Hiramatsu
2012-04-01 19:58 ` [RFC PATCH -tip 00/16] in-kernel x86 disassember H. Peter Anvin
2012-04-02  7:04 ` Ingo Molnar
2012-04-02 22:17   ` H. Peter Anvin
2012-04-03  7:55     ` Masami Hiramatsu
2012-04-02 22:01 ` H. Peter Anvin
2012-04-03  7:31   ` Ingo Molnar
2012-04-03  8:39     ` Masami Hiramatsu
2012-04-03 16:10     ` H. Peter Anvin

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox