f1a4697c | 07-Feb-2023 |
Markus Armbruster <armbru@redhat.com> |
dump: Assert cpu_get_note_size() can't fail
The only way cpu_get_note_size() can return a negative value is integer overflow in the non-stub versions, which is a programming error. The stub version
dump: Assert cpu_get_note_size() can't fail
The only way cpu_get_note_size() can return a negative value is integer overflow in the non-stub versions, which is a programming error. The stub version is not actually reachable, because the cpu_get_dump_info() stub will fail first. Use assert(). This gets rid of another use of QERR_UNSUPPORTED.
Signed-off-by: Markus Armbruster <armbru@redhat.com> Message-Id: <20230207075115.1525-4-armbru@redhat.com> Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org> Reviewed-by: Juan Quintela <quintela@redhat.com>
show more ...
|
e38c24cb | 19-Oct-2022 |
Viktor Prutyanov <viktor.prutyanov@redhat.com> |
dump/win_dump: limit number of processed PRCBs
When number of CPUs utilized by guest Windows is less than defined in QEMU (i.e., desktop versions of Windows severely limits number of CPU sockets), p
dump/win_dump: limit number of processed PRCBs
When number of CPUs utilized by guest Windows is less than defined in QEMU (i.e., desktop versions of Windows severely limits number of CPU sockets), patch_and_save_context routine accesses non-existent PRCB and fails. So, limit number of processed PRCBs by NumberProcessors taken from guest Windows driver.
Signed-off-by: Viktor Prutyanov <viktor.prutyanov@redhat.com> Reviewed-by: Marc-André Lureau <marcandre.lureau@redhat.com> Message-Id: <20221019235948.656411-1-viktor.prutyanov@redhat.com>
show more ...
|
113d8f4e | 17-Oct-2022 |
Janosch Frank <frankja@linux.ibm.com> |
s390x: pv: Add dump support
Sometimes dumping a guest from the outside is the only way to get the data that is needed. This can be the case if a dumping mechanism like KDUMP hasn't been configured o
s390x: pv: Add dump support
Sometimes dumping a guest from the outside is the only way to get the data that is needed. This can be the case if a dumping mechanism like KDUMP hasn't been configured or data needs to be fetched at a specific point. Dumping a protected guest from the outside without help from fw/hw doesn't yield sufficient data to be useful. Hence we now introduce PV dump support.
The PV dump support works by integrating the firmware into the dump process. New Ultravisor calls are used to initiate the dump process, dump cpu data, dump memory state and lastly complete the dump process. The UV calls are exposed by KVM via the new KVM_PV_DUMP command and its subcommands. The guest's data is fully encrypted and can only be decrypted by the entity that owns the customer communication key for the dumped guest. Also dumping needs to be allowed via a flag in the SE header.
On the QEMU side of things we store the PV dump data in the newly introduced architecture ELF sections (storage state and completion data) and the cpu notes (for cpu dump data).
Users can use the zgetdump tool to convert the encrypted QEMU dump to an unencrypted one.
Signed-off-by: Janosch Frank <frankja@linux.ibm.com> Reviewed-by: Steffen Eiden <seiden@linux.ibm.com> Message-Id: <20221017083822.43118-11-frankja@linux.ibm.com>
show more ...
|
9b72224f | 17-Oct-2022 |
Janosch Frank <frankja@linux.ibm.com> |
dump: Add architecture section and section string table support
Add hooks which architectures can use to add arbitrary data to custom sections.
Also add a section name string table in order to iden
dump: Add architecture section and section string table support
Add hooks which architectures can use to add arbitrary data to custom sections.
Also add a section name string table in order to identify section contents
Signed-off-by: Janosch Frank <frankja@linux.ibm.com> Reviewed-by: Marc-André Lureau <marcandre.lureau@redhat.com> Message-Id: <20221017113210.41674-1-frankja@linux.ibm.com>
show more ...
|
13fd417d | 17-Oct-2022 |
Janosch Frank <frankja@linux.ibm.com> |
dump: Reintroduce memory_offset and section_offset
section_offset will later be used to store the offset to the section data which will be stored last. For now memory_offset is only needed to make s
dump: Reintroduce memory_offset and section_offset
section_offset will later be used to store the offset to the section data which will be stored last. For now memory_offset is only needed to make section_offset look nicer.
Signed-off-by: Janosch Frank <frankja@linux.ibm.com> Reviewed-by: Marc-André Lureau <marcandre.lureau@redhat.com> Message-Id: <20221017083822.43118-5-frankja@linux.ibm.com>
show more ...
|
cb415fd6 | 17-Oct-2022 |
Janosch Frank <frankja@linux.ibm.com> |
dump: Write ELF section headers right after ELF header
Let's start bundling the writes of the headers and of the data so we have a clear ordering between them. Since the ELF header uses offsets to t
dump: Write ELF section headers right after ELF header
Let's start bundling the writes of the headers and of the data so we have a clear ordering between them. Since the ELF header uses offsets to the headers we can freely order them.
Signed-off-by: Janosch Frank <frankja@linux.ibm.com> Reviewed-by: Marc-André Lureau <marcandre.lureau@redhat.com> Message-Id: <20221017083822.43118-3-frankja@linux.ibm.com>
show more ...
|
94d78840 | 05-Sep-2022 |
Marc-André Lureau <marcandre.lureau@redhat.com> |
dump: fix kdump to work over non-aligned blocks
Rewrite get_next_page() to work over non-aligned blocks. When it encounters non aligned addresses, it will try to fill a page provided by the caller.
dump: fix kdump to work over non-aligned blocks
Rewrite get_next_page() to work over non-aligned blocks. When it encounters non aligned addresses, it will try to fill a page provided by the caller.
This solves a kdump crash with "tpm-crb-cmd" RAM memory region, qemu-kvm: ../dump/dump.c:1162: _Bool get_next_page(GuestPhysBlock **, uint64_t *, uint8_t **, DumpState *): Assertion `(block->target_start & ~target_page_mask) == 0' failed.
because: guest_phys_block_add_section: target_start=00000000fed40080 target_end=00000000fed41000: added (count: 4)
Fixes: https://bugzilla.redhat.com/show_bug.cgi?id=2120480
Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com> Acked-by: David Hildenbrand <david@redhat.com>
show more ...
|
08df3438 | 25-Aug-2022 |
Marc-André Lureau <marcandre.lureau@redhat.com> |
dump: simplify a bit kdump get_next_page()
This should be functionally equivalent, but slightly easier to read, with simplified paths and checks at the end of the function.
The following patch is a
dump: simplify a bit kdump get_next_page()
This should be functionally equivalent, but slightly easier to read, with simplified paths and checks at the end of the function.
The following patch is a major rewrite to get rid of the assert().
Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com> Reviewed-by: David Hildenbrand <david@redhat.com>
show more ...
|
2341a94d | 11-Aug-2022 |
Janosch Frank <frankja@linux.ibm.com> |
dump: Rename write_elf*_phdr_note to prepare_elf*_phdr_note
The functions in question do not actually write to the file descriptor they set up a buffer which is later written to the fd.
Signed-off-
dump: Rename write_elf*_phdr_note to prepare_elf*_phdr_note
The functions in question do not actually write to the file descriptor they set up a buffer which is later written to the fd.
Signed-off-by: Janosch Frank <frankja@linux.ibm.com> Reviewed-by: Janis Schoetterl-Glausch <scgl@linux.ibm.com> Reviewed-by: Marc-André Lureau <marcandre.lureau@redhat.com> Message-Id: <20220811121111.9878-9-frankja@linux.ibm.com>
show more ...
|
670e7699 | 11-Aug-2022 |
Janosch Frank <frankja@linux.ibm.com> |
dump: Split elf header functions into prepare and write
Let's split the write from the modification of the elf header so we can consolidate the write of the data in one function.
Signed-off-by: Jan
dump: Split elf header functions into prepare and write
Let's split the write from the modification of the elf header so we can consolidate the write of the data in one function.
Signed-off-by: Janosch Frank <frankja@linux.ibm.com> Reviewed-by: Janis Schoetterl-Glausch <scgl@linux.ibm.com> Reviewed-by: Marc-André Lureau <marcandre.lureau@redhat.com> Message-Id: <20220811121111.9878-8-frankja@linux.ibm.com>
show more ...
|
c370d530 | 11-Aug-2022 |
Janosch Frank <frankja@linux.ibm.com> |
dump: Rework dump_calculate_size function
dump_calculate_size() sums up all the sizes of the guest memory blocks. Since we already have a function that calculates the size of a single memory block (
dump: Rework dump_calculate_size function
dump_calculate_size() sums up all the sizes of the guest memory blocks. Since we already have a function that calculates the size of a single memory block (dump_get_memblock_size()) we can simply iterate over the blocks and use the function instead of calculating the size ourselves.
Signed-off-by: Janosch Frank <frankja@linux.ibm.com> Reviewed-by: Marc-André Lureau <marcandre.lureau@redhat.com> Reviewed-by: Janis Schoetterl-Glausch <scgl@linux.ibm.com> Message-Id: <20220811121111.9878-7-frankja@linux.ibm.com>
show more ...
|
dddf725f | 11-Aug-2022 |
Janosch Frank <frankja@linux.ibm.com> |
dump: Rework filter area variables
While the DumpState begin and length variables directly mirror the API variable names they are not very descriptive. So let's add a "filter_area_" prefix and make
dump: Rework filter area variables
While the DumpState begin and length variables directly mirror the API variable names they are not very descriptive. So let's add a "filter_area_" prefix and make has_filter a function checking length > 0.
Signed-off-by: Janosch Frank <frankja@linux.ibm.com> Reviewed-by: Marc-André Lureau <marcandre.lureau@redhat.com> Message-Id: <20220811121111.9878-6-frankja@linux.ibm.com>
show more ...
|
0c2994ac | 11-Aug-2022 |
Janosch Frank <frankja@linux.ibm.com> |
dump: Rework get_start_block
get_start_block() returns the start address of the first memory block or -1.
With the GuestPhysBlock iterator conversion we don't need to set the start address and can
dump: Rework get_start_block
get_start_block() returns the start address of the first memory block or -1.
With the GuestPhysBlock iterator conversion we don't need to set the start address and can therefore remove that code and the "start" DumpState struct member. The only functionality left is the validation of the start block so it only makes sense to re-name the function to validate_start_block()
Signed-off-by: Janosch Frank <frankja@linux.ibm.com> Reviewed-by: Marc-André Lureau <marcandre.lureau@redhat.com> Reviewed-by: Janis Schoetterl-Glausch <scgl@linux.ibm.com> Message-Id: <20220811121111.9878-5-frankja@linux.ibm.com>
show more ...
|
1e811303 | 11-Aug-2022 |
Janosch Frank <frankja@linux.ibm.com> |
dump: Refactor dump_iterate and introduce dump_filter_memblock_*()
The iteration over the memblocks in dump_iterate() is hard to understand so it's about time to clean it up. Instead of manually gra
dump: Refactor dump_iterate and introduce dump_filter_memblock_*()
The iteration over the memblocks in dump_iterate() is hard to understand so it's about time to clean it up. Instead of manually grabbing the next memblock we can use QTAILQ_FOREACH to iterate over all memblocks.
Additionally we move the calculation of the offset and length out by introducing and using the dump_filter_memblock_*() functions. These functions will later be used to cleanup other parts of dump.c.
Signed-off-by: Janosch Frank <frankja@linux.ibm.com> Reviewed-by: Janis Schoetterl-Glausch <scgl@linux.ibm.com> Reviewed-by: Marc-André Lureau <marcandre.lureau@redhat.com> Message-Id: <20220811121111.9878-4-frankja@linux.ibm.com>
show more ...
|
f5daa829 | 06-Apr-2022 |
Viktor Prutyanov <viktor.prutyanov@redhat.com> |
dump/win_dump: add 32-bit guest Windows support
Before this patch, 'dump-guest-memory -w' was accepting only 64-bit dump header provided by guest through vmcoreinfo and thus was unable to produce 32
dump/win_dump: add 32-bit guest Windows support
Before this patch, 'dump-guest-memory -w' was accepting only 64-bit dump header provided by guest through vmcoreinfo and thus was unable to produce 32-bit guest Windows dump. So, add 32-bit guest Windows dumping support.
Signed-off-by: Viktor Prutyanov <viktor.prutyanov@redhat.com> Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org> [ misc error handling fixes to avoid compiler warning ] Reviewed-by: Marc-André Lureau <marcandre.lureau@redhat.com> Message-Id: <20220406171558.199263-5-viktor.prutyanov@redhat.com>
show more ...
|
fb21efe9 | 06-Apr-2022 |
Viktor Prutyanov <viktor.prutyanov@redhat.com> |
dump/win_dump: add helper macros for Windows dump header access
Perform read access to Windows dump header fields via helper macros. This is preparation for the next 32-bit guest Windows dump suppor
dump/win_dump: add helper macros for Windows dump header access
Perform read access to Windows dump header fields via helper macros. This is preparation for the next 32-bit guest Windows dump support.
Signed-off-by: Viktor Prutyanov <viktor.prutyanov@redhat.com> Reviewed-by: Marc-André Lureau <marcandre.lureau@redhat.com> Message-Id: <20220406171558.199263-3-viktor.prutyanov@redhat.com>
show more ...
|
a64b4e17 | 06-Apr-2022 |
Viktor Prutyanov <viktor.prutyanov@redhat.com> |
include/qemu: rename Windows context definitions to expose bitness
Context structure in 64-bit Windows differs from 32-bit one and it should be reflected in its name.
Signed-off-by: Viktor Prutyano
include/qemu: rename Windows context definitions to expose bitness
Context structure in 64-bit Windows differs from 32-bit one and it should be reflected in its name.
Signed-off-by: Viktor Prutyanov <viktor.prutyanov@redhat.com> Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org> Reviewed-by: Marc-André Lureau <marcandre.lureau@redhat.com> Message-Id: <20220406171558.199263-2-viktor.prutyanov@redhat.com>
show more ...
|
c6812473 | 30-Mar-2022 |
Janosch Frank <frankja@linux.ibm.com> |
dump: Consolidate elf note function
Just like with the other write functions let's move the 32/64 bit elf handling to a function to improve readability.
Signed-off-by: Janosch Frank <frankja@linux.
dump: Consolidate elf note function
Just like with the other write functions let's move the 32/64 bit elf handling to a function to improve readability.
Signed-off-by: Janosch Frank <frankja@linux.ibm.com> Reviewed-by: Marc-André Lureau <marcandre.lureau@redhat.com> Message-Id: <20220330123603.107120-10-frankja@linux.ibm.com>
show more ...
|
5ff2e5a3 | 30-Mar-2022 |
Janosch Frank <frankja@linux.ibm.com> |
dump: Cleanup dump_begin write functions
There's no need to have a gigantic if in there let's move the elf 32/64 bit logic into the section, segment or note code.
Signed-off-by: Janosch Frank <fran
dump: Cleanup dump_begin write functions
There's no need to have a gigantic if in there let's move the elf 32/64 bit logic into the section, segment or note code.
Signed-off-by: Janosch Frank <frankja@linux.ibm.com> Reviewed-by: Richard Henderson <richard.henderson@linaro.org> Reviewed-by: Marc-André Lureau <marcandre.lureau@redhat.com> Message-Id: <20220330123603.107120-9-frankja@linux.ibm.com>
show more ...
|