mbox series

[0/2] dump: add 32-bit guest Windows support

Message ID 20211229175255.133073-1-viktor.prutyanov@phystech.edu (mailing list archive)
Headers show
Series dump: add 32-bit guest Windows support | expand

Message

Viktor Prutyanov Dec. 29, 2021, 5:52 p.m. UTC
Since 32-bit versions of Windows still exist, there is a need to take
live and crash dumps of such guests along with 64-bit guests. So, add
an ability for 'dump-guest-memory -w' to take dumps from 32-bit guest.
When running the command QEMU consumes 32-bit Complete Memory Dump
header passed by guest driver through vmcoreinfo device as it was
previously done for 64-bit headers. 32-bit vmcoreinfo guest driver in
upstream virtio-win can fill such a header.

Viktor Prutyanov (2):
  include/qemu: add 32-bit Windows dump structures and definitions
  dump/win_dump: add 32-bit guest Windows support for dump-guest-memory

 contrib/elf2dmp/main.c       |   6 +-
 dump/win_dump.c              | 293 ++++++++++++++++++++++-------------
 hmp-commands.hx              |   2 +-
 include/qemu/win_dump_defs.h | 115 +++++++++++++-
 4 files changed, 300 insertions(+), 116 deletions(-)

Comments

Philippe Mathieu-Daudé Dec. 29, 2021, 11:44 p.m. UTC | #1
Hi Viktor,

On 12/29/21 18:52, Viktor Prutyanov wrote:
> Since 32-bit versions of Windows still exist, there is a need to take
> live and crash dumps of such guests along with 64-bit guests. So, add
> an ability for 'dump-guest-memory -w' to take dumps from 32-bit guest.
> When running the command QEMU consumes 32-bit Complete Memory Dump
> header passed by guest driver through vmcoreinfo device as it was
> previously done for 64-bit headers. 32-bit vmcoreinfo guest driver in
> upstream virtio-win can fill such a header.
> 
> Viktor Prutyanov (2):
>   include/qemu: add 32-bit Windows dump structures and definitions
>   dump/win_dump: add 32-bit guest Windows support for dump-guest-memory

Looking at your series, the patches are doing a bit too much.

Suggestion to ease review:
- Rename WinContext -> WinContext64 (+ add union) in a preliminary patch
- Rename WinDumpHeader -> WinDumpHeader64 in another patch
- Add *WIN_DUMP_FIELD* macros only using the 64-bit
- Add 32-bit structures
- Add 32-bit code
  (better name 'bool x64', maybe 'is_64bit' or 'guest64'?)

Otherwise LGTM.

Regards,

Phil.