]> git.baikalelectronics.ru Git - kernel.git/commit
vmcore: add API to collect hardware dump in second kernel
authorRahul Lakkireddy <rahul.lakkireddy@chelsio.com>
Wed, 2 May 2018 09:47:17 +0000 (15:17 +0530)
committerDavid S. Miller <davem@davemloft.net>
Mon, 14 May 2018 17:46:04 +0000 (13:46 -0400)
commit04cb01c9a88f189d2f650d908cae355034eb0a03
treed814285445675db025d5b4f3cf9eaf088466eefd
parentf56871a480ba57093daf5bc96b38c02add829981
vmcore: add API to collect hardware dump in second kernel

The sequence of actions done by device drivers to append their device
specific hardware/firmware logs to /proc/vmcore are as follows:

1. During probe (before hardware is initialized), device drivers
register to the vmcore module (via vmcore_add_device_dump()), with
callback function, along with buffer size and log name needed for
firmware/hardware log collection.

2. vmcore module allocates the buffer with requested size. It adds
an Elf note and invokes the device driver's registered callback
function.

3. Device driver collects all hardware/firmware logs into the buffer
and returns control back to vmcore module.

Ensure that the device dump buffer size is always aligned to page size
so that it can be mmaped.

Also, rename alloc_elfnotes_buf() to vmcore_alloc_buf() to make it more
generic and reserve NT_VMCOREDD note type to indicate vmcore device
dump.

Suggested-by: Eric Biederman <ebiederm@xmission.com>.
Signed-off-by: Rahul Lakkireddy <rahul.lakkireddy@chelsio.com>
Signed-off-by: Ganesh Goudar <ganeshgr@chelsio.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
fs/proc/Kconfig
fs/proc/vmcore.c
include/linux/crash_dump.h
include/linux/kcore.h
include/uapi/linux/elf.h
include/uapi/linux/vmcore.h [new file with mode: 0644]