Skip to content

dump: Add custom arch section support

Janosch Frank qemu-devel 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest5 patches 4 repliesIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/5dump: Allocate headerdump/dump.c include/sysemu/dump.h+62 -541 reply
2/5dump: Split write of section headers and data and add a prepare stepdump/dump.c include/sysemu/dump.h+90 -261 reply
3/5dump: Reorder struct DumpStateinclude/sysemu/dump.h+11 -71 reply
4/5dump/dump: Add section string table supportdump/dump.c include/sysemu/dump.h+94 -131 reply
5/5dump/dump: Add arch section supportdump/dump.c include/sysemu/dump-arch.h+45 -30 replies

Reviews trailers per patch

2 of 5 patches have a Reviewed-by or Acked-by.

PatchRichard Henderson
1/5
2/5
3/5R-b
4/5R-b
5/5

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v1 thread

Cover letter [PATCH 0/5] dump: Add custom arch section support

Architectures already provide custom cpu data via elf notes but there's currently no way for an architecture to add other custom data to dumps.

s390x for instance needs to store special data in the dump when dumping protected guests so the vm owner can decrypt the dump and access the vm data.

Similar to the cpu notes which work by using hooks we introduce new hooks to add custom sections. The ArchDumpInfo struct now contains three new functions hooks that the architectures can set:

void (*arch_sections_add_fn)(void *opaque);
This function can be used to manipulate the number of sections and the size of the cummulative section data.

uint64_t (*arch_sections_write_hdr_fn)(void *opaque, uint8_t *buff); This function is used to write the elf headers for the custom sections so architectures can control all values in the section headers.

void (*arch_sections_write_fn)(void *opaque, uint8_t *buff); Lastly this function is used to write out the section data.

To make section identification easier we also introduce section string table support.

Based on:
https://lore.kernel.org/qemu-devel/[email protected]/T/#t

Janosch Frank (5):
dump: Allocate header
dump: Split write of section headers and data and add a prepare step
dump: Reorder struct DumpState
dump/dump: Add section string table support
dump/dump: Add arch section support

 dump/dump.c                | 338 +++++++++++++++++++++++++++----------
 include/sysemu/dump-arch.h |  27 +++
 include/sysemu/dump.h      |  24 ++-
 3 files changed, 294 insertions(+), 95 deletions(-)
Signature · 1 line
2.32.0