98d16e5f | 07-Mar-2024 |
Akihiko Odaki <akihiko.odaki@daynix.com> |
contrib/elf2dmp: Ensure phdrs fit in file
Callers of elf64_getphdr() and elf_getphdrnum() assume phdrs are accessible.
Resolves: https://gitlab.com/qemu-project/qemu/-/issues/2202 Signed-off-by: Ak
contrib/elf2dmp: Ensure phdrs fit in file
Callers of elf64_getphdr() and elf_getphdrnum() assume phdrs are accessible.
Resolves: https://gitlab.com/qemu-project/qemu/-/issues/2202 Signed-off-by: Akihiko Odaki <akihiko.odaki@daynix.com> Tested-by: Viktor Prutyanov <viktor.prutyanov@phystech.edu> Reviewed-by: Peter Maydell <peter.maydell@linaro.org> Message-id: 20240307-elf2dmp-v4-19-4f324ad4d99d@daynix.com Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
show more ...
|
9de37c28 | 07-Mar-2024 |
Akihiko Odaki <akihiko.odaki@daynix.com> |
contrib/elf2dmp: Clamp QEMU note to file size
This fixes crashes with truncated dumps.
Signed-off-by: Akihiko Odaki <akihiko.odaki@daynix.com> Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
contrib/elf2dmp: Clamp QEMU note to file size
This fixes crashes with truncated dumps.
Signed-off-by: Akihiko Odaki <akihiko.odaki@daynix.com> Reviewed-by: Peter Maydell <peter.maydell@linaro.org> Tested-by: Viktor Prutyanov <viktor.prutyanov@phystech.edu> Message-id: 20240307-elf2dmp-v4-18-4f324ad4d99d@daynix.com Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
show more ...
|
0c94e32d | 07-Mar-2024 |
Akihiko Odaki <akihiko.odaki@daynix.com> |
contrib/elf2dmp: Use GPtrArray
This removes the need to enumarate QEMUCPUState twice and saves code.
Signed-off-by: Akihiko Odaki <akihiko.odaki@daynix.com> Reviewed-by: Peter Maydell <peter.maydel
contrib/elf2dmp: Use GPtrArray
This removes the need to enumarate QEMUCPUState twice and saves code.
Signed-off-by: Akihiko Odaki <akihiko.odaki@daynix.com> Reviewed-by: Peter Maydell <peter.maydell@linaro.org> Tested-by: Viktor Prutyanov <viktor.prutyanov@phystech.edu> Message-id: 20240307-elf2dmp-v4-17-4f324ad4d99d@daynix.com Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
show more ...
|
f024f503 | 07-Mar-2024 |
Akihiko Odaki <akihiko.odaki@daynix.com> |
contrib/elf2dmp: Use rol64() to decode
rol64() is roubust against too large shift values and fixes UBSan warnings.
Signed-off-by: Akihiko Odaki <akihiko.odaki@daynix.com> Reviewed-by: Peter Maydell
contrib/elf2dmp: Use rol64() to decode
rol64() is roubust against too large shift values and fixes UBSan warnings.
Signed-off-by: Akihiko Odaki <akihiko.odaki@daynix.com> Reviewed-by: Peter Maydell <peter.maydell@linaro.org> Tested-by: Viktor Prutyanov <viktor.prutyanov@phystech.edu> Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org> Message-id: 20240307-elf2dmp-v4-14-4f324ad4d99d@daynix.com Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
show more ...
|
2aa501af | 07-Mar-2024 |
Akihiko Odaki <akihiko.odaki@daynix.com> |
contrib/elf2dmp: Use lduw_le_p() to read PDB
The relevant value may be unaligned and is little-endian.
Signed-off-by: Akihiko Odaki <akihiko.odaki@daynix.com> Tested-by: Viktor Prutyanov <viktor.pr
contrib/elf2dmp: Use lduw_le_p() to read PDB
The relevant value may be unaligned and is little-endian.
Signed-off-by: Akihiko Odaki <akihiko.odaki@daynix.com> Tested-by: Viktor Prutyanov <viktor.prutyanov@phystech.edu> Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org> Message-id: 20240307-elf2dmp-v4-13-4f324ad4d99d@daynix.com Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
show more ...
|
66790947 | 07-Mar-2024 |
Akihiko Odaki <akihiko.odaki@daynix.com> |
contrib/elf2dmp: Ensure segment fits in file
This makes elf2dmp more robust against corrupted inputs.
Signed-off-by: Akihiko Odaki <akihiko.odaki@daynix.com> Reviewed-by: Peter Maydell <peter.mayde
contrib/elf2dmp: Ensure segment fits in file
This makes elf2dmp more robust against corrupted inputs.
Signed-off-by: Akihiko Odaki <akihiko.odaki@daynix.com> Reviewed-by: Peter Maydell <peter.maydell@linaro.org> Tested-by: Viktor Prutyanov <viktor.prutyanov@phystech.edu> Message-id: 20240307-elf2dmp-v4-12-4f324ad4d99d@daynix.com Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
show more ...
|
2aa205f7 | 07-Mar-2024 |
Akihiko Odaki <akihiko.odaki@daynix.com> |
contrib/elf2dmp: Always destroy PA space
Destroy PA space even if paging base couldn't be found, fixing memory leak.
Signed-off-by: Akihiko Odaki <akihiko.odaki@daynix.com> Reviewed-by: Peter Mayde
contrib/elf2dmp: Always destroy PA space
Destroy PA space even if paging base couldn't be found, fixing memory leak.
Signed-off-by: Akihiko Odaki <akihiko.odaki@daynix.com> Reviewed-by: Peter Maydell <peter.maydell@linaro.org> Tested-by: Viktor Prutyanov <viktor.prutyanov@phystech.edu> Message-id: 20240307-elf2dmp-v4-11-4f324ad4d99d@daynix.com Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
show more ...
|
a6a62ef5 | 07-Mar-2024 |
Akihiko Odaki <akihiko.odaki@daynix.com> |
contrib/elf2dmp: Always check for PA resolution failure
Not checking PA resolution failure can result in NULL deference.
Signed-off-by: Akihiko Odaki <akihiko.odaki@daynix.com> Reviewed-by: Peter M
contrib/elf2dmp: Always check for PA resolution failure
Not checking PA resolution failure can result in NULL deference.
Signed-off-by: Akihiko Odaki <akihiko.odaki@daynix.com> Reviewed-by: Peter Maydell <peter.maydell@linaro.org> Tested-by: Viktor Prutyanov <viktor.prutyanov@phystech.edu> Message-id: 20240307-elf2dmp-v4-10-4f324ad4d99d@daynix.com Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
show more ...
|
fbc3d7d2 | 07-Mar-2024 |
Akihiko Odaki <akihiko.odaki@daynix.com> |
contrib/elf2dmp: Fix error reporting style in main.c
include/qapi/error.h says: > We recommend > * bool-valued functions return true on success / false on failure, > ...
Signed-off-by: Akihiko Odak
contrib/elf2dmp: Fix error reporting style in main.c
include/qapi/error.h says: > We recommend > * bool-valued functions return true on success / false on failure, > ...
Signed-off-by: Akihiko Odaki <akihiko.odaki@daynix.com> Tested-by: Viktor Prutyanov <viktor.prutyanov@phystech.edu> Reviewed-by: Peter Maydell <peter.maydell@linaro.org> Message-id: 20240307-elf2dmp-v4-9-4f324ad4d99d@daynix.com Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
show more ...
|
49760ccf | 07-Mar-2024 |
Akihiko Odaki <akihiko.odaki@daynix.com> |
contrib/elf2dmp: Fix error reporting style in qemu_elf.c
include/qapi/error.h says: > We recommend > * bool-valued functions return true on success / false on failure, > ...
Signed-off-by: Akihiko
contrib/elf2dmp: Fix error reporting style in qemu_elf.c
include/qapi/error.h says: > We recommend > * bool-valued functions return true on success / false on failure, > ...
Signed-off-by: Akihiko Odaki <akihiko.odaki@daynix.com> Tested-by: Viktor Prutyanov <viktor.prutyanov@phystech.edu> Reviewed-by: Peter Maydell <peter.maydell@linaro.org> Message-id: 20240307-elf2dmp-v4-8-4f324ad4d99d@daynix.com Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
show more ...
|
b1250455 | 07-Mar-2024 |
Akihiko Odaki <akihiko.odaki@daynix.com> |
contrib/elf2dmp: Fix error reporting style in pdb.c
include/qapi/error.h says: > We recommend > * bool-valued functions return true on success / false on failure, > ...
Signed-off-by: Akihiko Odaki
contrib/elf2dmp: Fix error reporting style in pdb.c
include/qapi/error.h says: > We recommend > * bool-valued functions return true on success / false on failure, > ...
Signed-off-by: Akihiko Odaki <akihiko.odaki@daynix.com> Tested-by: Viktor Prutyanov <viktor.prutyanov@phystech.edu> Reviewed-by: Peter Maydell <peter.maydell@linaro.org> Message-id: 20240307-elf2dmp-v4-7-4f324ad4d99d@daynix.com Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
show more ...
|
1b806c36 | 07-Mar-2024 |
Akihiko Odaki <akihiko.odaki@daynix.com> |
contrib/elf2dmp: Fix error reporting style in download.c
include/qapi/error.h says: > We recommend > * bool-valued functions return true on success / false on failure, > ...
Signed-off-by: Akihiko
contrib/elf2dmp: Fix error reporting style in download.c
include/qapi/error.h says: > We recommend > * bool-valued functions return true on success / false on failure, > ...
Signed-off-by: Akihiko Odaki <akihiko.odaki@daynix.com> Tested-by: Viktor Prutyanov <viktor.prutyanov@phystech.edu> Reviewed-by: Peter Maydell <peter.maydell@linaro.org> Message-id: 20240307-elf2dmp-v4-6-4f324ad4d99d@daynix.com Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
show more ...
|
a15f9749 | 07-Mar-2024 |
Akihiko Odaki <akihiko.odaki@daynix.com> |
contrib/elf2dmp: Fix error reporting style in addrspace.c
include/qapi/error.h says: > We recommend > * bool-valued functions return true on success / false on failure, > ...
Signed-off-by: Akihiko
contrib/elf2dmp: Fix error reporting style in addrspace.c
include/qapi/error.h says: > We recommend > * bool-valued functions return true on success / false on failure, > ...
Signed-off-by: Akihiko Odaki <akihiko.odaki@daynix.com> Tested-by: Viktor Prutyanov <viktor.prutyanov@phystech.edu> Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org> Message-id: 20240307-elf2dmp-v4-5-4f324ad4d99d@daynix.com Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
show more ...
|
262a0ff8 | 07-Mar-2024 |
Akihiko Odaki <akihiko.odaki@daynix.com> |
contrib/elf2dmp: Change pa_space_create() signature
pa_space_create() used to return an integer to propagate error, but it never fails so let it return void.
Signed-off-by: Akihiko Odaki <akihiko.o
contrib/elf2dmp: Change pa_space_create() signature
pa_space_create() used to return an integer to propagate error, but it never fails so let it return void.
Signed-off-by: Akihiko Odaki <akihiko.odaki@daynix.com> Tested-by: Viktor Prutyanov <viktor.prutyanov@phystech.edu> Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org> Message-id: 20240307-elf2dmp-v4-4-4f324ad4d99d@daynix.com Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
show more ...
|
87157ef3 | 07-Mar-2024 |
Akihiko Odaki <akihiko.odaki@daynix.com> |
contrib/elf2dmp: Continue even contexts are lacking
Let fill_context() continue even if it fails to fill contexts of some CPUs. A dump may still contain valuable information even if it lacks context
contrib/elf2dmp: Continue even contexts are lacking
Let fill_context() continue even if it fails to fill contexts of some CPUs. A dump may still contain valuable information even if it lacks contexts of some CPUs due to dump corruption or a failure before starting CPUs.
Signed-off-by: Akihiko Odaki <akihiko.odaki@daynix.com> Reviewed-by: Peter Maydell <peter.maydell@linaro.org> Tested-by: Viktor Prutyanov <viktor.prutyanov@phystech.edu> Message-id: 20240307-elf2dmp-v4-3-4f324ad4d99d@daynix.com Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
show more ...
|
a4e58de1 | 07-Mar-2024 |
Akihiko Odaki <akihiko.odaki@daynix.com> |
contrib/elf2dmp: Assume error by default
A common construct in contrib/elf2dmp is to set "err" flag and goto in error paths. In such a construct, there is only one successful path while there are se
contrib/elf2dmp: Assume error by default
A common construct in contrib/elf2dmp is to set "err" flag and goto in error paths. In such a construct, there is only one successful path while there are several error paths, so it will be more simpler to initialize "err" flag set, and clear it in the successful path.
Signed-off-by: Akihiko Odaki <akihiko.odaki@daynix.com> Reviewed-by: Peter Maydell <peter.maydell@linaro.org> Tested-by: Viktor Prutyanov <viktor.prutyanov@phystech.edu> Message-id: 20240307-elf2dmp-v4-2-4f324ad4d99d@daynix.com Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
show more ...
|
9d9c06b1 | 30-Sep-2023 |
Viktor Prutyanov <viktor@daynix.com> |
elf2dmp: check array bounds in pdb_get_file_size
Index in file_size array must be checked against num_files, because the entries we are looking for may be absent in the PDB.
Fixes: Coverity CID 152
elf2dmp: check array bounds in pdb_get_file_size
Index in file_size array must be checked against num_files, because the entries we are looking for may be absent in the PDB.
Fixes: Coverity CID 1521597 Signed-off-by: Viktor Prutyanov <viktor@daynix.com> Reviewed-by: Akihiko Odaki <akihiko.odaki@daynix.com> Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org> Message-id: 20230930235317.11469-3-viktor@daynix.com Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
show more ...
|
231f6a7d | 15-Sep-2023 |
Viktor Prutyanov <viktor@daynix.com> |
elf2dmp: rework PDB_STREAM_INDEXES::segments obtaining
PDB for Windows 11 kernel has slightly different structure compared to previous versions. Since elf2dmp don't use the other fields, copy only '
elf2dmp: rework PDB_STREAM_INDEXES::segments obtaining
PDB for Windows 11 kernel has slightly different structure compared to previous versions. Since elf2dmp don't use the other fields, copy only 'segments' field from PDB_STREAM_INDEXES.
Signed-off-by: Viktor Prutyanov <viktor@daynix.com> Reviewed-by: Akihiko Odaki <akihiko.odaki@daynix.com> Message-id: 20230915170153.10959-6-viktor@daynix.com Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
show more ...
|
df7a7556 | 15-Sep-2023 |
Viktor Prutyanov <viktor@daynix.com> |
elf2dmp: use Linux mmap with MAP_NORESERVE when possible
Glib's g_mapped_file_new maps file with PROT_READ|PROT_WRITE and MAP_PRIVATE. This leads to premature physical memory allocation of dump file
elf2dmp: use Linux mmap with MAP_NORESERVE when possible
Glib's g_mapped_file_new maps file with PROT_READ|PROT_WRITE and MAP_PRIVATE. This leads to premature physical memory allocation of dump file size on Linux hosts and may fail. On Linux, mapping the file with MAP_NORESERVE limits the allocation by available memory.
Signed-off-by: Viktor Prutyanov <viktor@daynix.com> Reviewed-by: Akihiko Odaki <akihiko.odaki@daynix.com> Message-id: 20230915170153.10959-5-viktor@daynix.com Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
show more ...
|
9b7dcd8f | 15-Sep-2023 |
Viktor Prutyanov <viktor@daynix.com> |
elf2dmp: introduce merging of physical memory runs
DMP supports 42 physical memory runs at most. So, merge adjacent physical memory ranges from QEMU ELF when possible to minimize total number of run
elf2dmp: introduce merging of physical memory runs
DMP supports 42 physical memory runs at most. So, merge adjacent physical memory ranges from QEMU ELF when possible to minimize total number of runs.
Signed-off-by: Viktor Prutyanov <viktor@daynix.com> Reviewed-by: Akihiko Odaki <akihiko.odaki@daynix.com> Message-id: 20230915170153.10959-4-viktor@daynix.com [PMM: fixed format string for printing size_t values] Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
show more ...
|
d5c27a53 | 15-Sep-2023 |
Viktor Prutyanov <viktor@daynix.com> |
elf2dmp: introduce physical block alignment
Physical memory ranges may not be aligned to page size in QEMU ELF, but DMP can only contain page-aligned runs. So, align them.
Signed-off-by: Viktor Pru
elf2dmp: introduce physical block alignment
Physical memory ranges may not be aligned to page size in QEMU ELF, but DMP can only contain page-aligned runs. So, align them.
Signed-off-by: Viktor Prutyanov <viktor@daynix.com> Reviewed-by: Akihiko Odaki <akihiko.odaki@daynix.com> Message-id: 20230915170153.10959-3-viktor@daynix.com Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
show more ...
|