mbox series

[0/3] Add a new command in kgdb for vmcoreinfo

Message ID 20241210133448.3684593-1-tjarlama@gmail.com
Headers show
Series Add a new command in kgdb for vmcoreinfo | expand

Message

Amal Raj T Dec. 10, 2024, 1:34 p.m. UTC
From: Amal Raj T <amalrajt@meta.com>

This patch set introduces a new custom query packet,
`qlinux.vmcoreinfo`, to kgdb. This packet retrieves kernel's
vmcoreinfo text, which contains crucial debugging information
such as the KASLR offset, kernel release, `phys_base` etc.

This implementation includes a new binary-encoder (`mem2ebin`)
instead of the existing hex-encoder (`mem2hex`) to reduce the
amount of data sent over the wire.

These changes also move the LF -> CRLF replacement logic from
serial drivers to KDB, since KDB is the only user of this
logic, and the existing replacement results in incorrect
checksums generated by KGDB.

Link:
- https://github.com/osandov/drgn/wiki/GDB-Remote-Protocol-proposal:-linux.vmcoreinfo-query-packet

Amal Raj T (3):
  kgdb: Add kgdb_mem2ebin function for converting memory to binary
    format
  serial: Move LF -> CRLF replacement from serial console to kdb
  kgdb: Add command linux.vmcoreinfo to kgdb

 drivers/tty/serial/serial_core.c |  4 ----
 include/linux/kgdb.h             |  1 +
 kernel/debug/gdbstub.c           | 41 +++++++++++++++++++++++++++++++-
 kernel/debug/kdb/kdb_io.c        |  2 ++
 lib/Kconfig.kgdb                 |  1 +
 5 files changed, 44 insertions(+), 5 deletions(-)