Re: [PULL 2/7] s390x: do a subsystem reset before the unprotect on reboot

2024-01-11 Thread Janosch Frank
On 1/11/24 10:43, Cédric Le Goater wrote: On 1/10/24 21:28, Matthew Rosato wrote: On 1/10/24 1:30 PM, Cédric Le Goater wrote: On 9/12/23 13:41, Thomas Huth wrote: From: Janosch Frank Bound APQNs have to be reset before tearing down the secure config via s390_machine_unprotect(). Otherwise

Re: [PATCH] target/s390x/kvm/pv: Provide some more useful information if decryption fails

2024-01-09 Thread Janosch Frank
On 1/9/24 15:52, Thomas Huth wrote: On 09/01/2024 15.42, Daniel P. Berrangé wrote: On Tue, Jan 09, 2024 at 03:30:38PM +0100, Thomas Huth wrote: It's a common scenario to copy guest images from one host to another to run the guest on the other machine. This (of course) does not work with

[PATCH v2 2/3] dump: Add arch cleanup function

2023-11-09 Thread Janosch Frank
Some architectures (s390x) need to cleanup after a failed dump to be able to continue to run the vm. Add a cleanup function pointer and call it if it's set. Signed-off-by: Janosch Frank --- dump/dump.c| 4 include/sysemu/dump-arch.h | 1 + 2 files changed, 5 insertions

[PATCH v2 0/3] dump: Arch info function pointer addition and cleanup

2023-11-09 Thread Janosch Frank
since KVM was still in dump mode which blocks vcpu entry. The new function pointer allows cleanup of such a situation. v2: - Usage of g_autofree - Dropped explicit NULLing of function pointers Janosch Frank (3): target/s390x/dump: Remove unneeded dump info function pointer init

[PATCH v2 3/3] target/s390x/arch_dump: Add arch cleanup function for PV dumps

2023-11-09 Thread Janosch Frank
completion data is discarded but there's no point in writing it to a file anyway if there's a possibility that other PV dump data is missing. Signed-off-by: Janosch Frank --- target/s390x/arch_dump.c | 17 + 1 file changed, 17 insertions(+) diff --git a/target/s390x/arch_dump.c b

[PATCH v2 1/3] target/s390x/dump: Remove unneeded dump info function pointer init

2023-11-09 Thread Janosch Frank
dump_state_prepare() now sets the function pointers to NULL so we only need to touch them if we're going to use them. Signed-off-by: Janosch Frank Reviewed-by: Marc-André Lureau --- target/s390x/arch_dump.c | 4 1 file changed, 4 deletions(-) diff --git a/target/s390x/arch_dump.c b

Re: [PATCH 1/4] dump: Set dump info function pointers to NULL

2023-11-08 Thread Janosch Frank
On 11/8/23 09:03, Marc-André Lureau wrote: Hi On Tue, Nov 7, 2023 at 6:22 PM Janosch Frank wrote: Better to not rely on the struct zeroing since NULL is not necessarily 0. Signed-off-by: Janosch Frank --- dump/dump.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/dump/dump.c b

[PATCH 2/4] target/s390x/dump: Remove unneeded dump info function pointer init

2023-11-07 Thread Janosch Frank
dump_state_prepare() now sets the fucntion pointers to NULL so we only need to touch them if we're going to use them. Signed-off-by: Janosch Frank --- target/s390x/arch_dump.c | 4 1 file changed, 4 deletions(-) diff --git a/target/s390x/arch_dump.c b/target/s390x/arch_dump.c index

[PATCH 3/4] dump: Add arch cleanup function

2023-11-07 Thread Janosch Frank
Some architectures (s390x) need to cleanup after a failed dump to be able to continue to run the vm. Add a cleanup function pointer and call it if it's set. Signed-off-by: Janosch Frank --- dump/dump.c| 5 + include/sysemu/dump-arch.h | 1 + 2 files changed, 6 insertions

[PATCH 0/4] dump: Arch info function pointer addition and cleanup

2023-11-07 Thread Janosch Frank
since KVM was still in dump mode which blocks vcpu entry. The new function pointer allows cleanup of such a situation. Janosch Frank (4): dump: Set dump info function pointers to NULL target/s390x/dump: Remove unneeded dump info function pointer init dump: Add arch cleanup function target

[PATCH 1/4] dump: Set dump info function pointers to NULL

2023-11-07 Thread Janosch Frank
Better to not rely on the struct zeroing since NULL is not necessarily 0. Signed-off-by: Janosch Frank --- dump/dump.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/dump/dump.c b/dump/dump.c index d355ada62e..1d38274925 100644 --- a/dump/dump.c +++ b/dump/dump.c @@ -1706,6 +1706,9

[PATCH 4/4] target/s390x/arch_dump: Add arch cleanup function for PV dumps

2023-11-07 Thread Janosch Frank
completion data is discarded but there's no point in writing it to a file anyway if there's a possibility that other PV dump data is missing. Signed-off-by: Janosch Frank --- target/s390x/arch_dump.c | 17 + 1 file changed, 17 insertions(+) diff --git a/target/s390x/arch_dump.c b

[PATCH] s390x: do a subsystem reset before the unprotect on reboot

2023-09-01 Thread Janosch Frank
devices twice. That's ok since we can't move the device_reset() before the unprotect as it includes a CPU clear reset which the Ultravisor does not expect at that point in time. Signed-off-by: Janosch Frank --- I'm not able to test this for the PV AP case right new, that has to wait to early next

Re: [PATCH v4 2/5] s390x: switch pv and subsystem reset ordering on reboot

2023-09-01 Thread Janosch Frank
On 8/31/23 18:21, Marc Hartmayer wrote: On Wed, Aug 23, 2023 at 04:22 PM +0200, Steffen Eiden wrote: From: Janosch Frank Bound APQNs have to be reset before tearing down the secure config via s390_machine_unprotect(). Otherwise the Ultravisor will return a error code. So let's switch

Re: [PATCH v2 3/3] target/s390x: AP-passthrough for PV guests

2023-08-17 Thread Janosch Frank
On 8/10/23 14:47, Steffen Eiden wrote: Enabling AP-passthrough(AP-pt) for PV-guest by using the new CPU features for PV-AP-pt of KVM. As usual QEMU first checks which CPU features are available and then sets them if available and selected by user. An additional check is done to verify that

Re: [PATCH 10/10] hw/s390x: Rename pv.c -> pv-kvm.c

2023-04-06 Thread Janosch Frank
On 4/6/23 09:50, Thomas Huth wrote: On 05/04/2023 18.04, Philippe Mathieu-Daudé wrote: Protected Virtualization is specific to KVM. Rename the file as 'pv-kvm.c' to make this clearer. Signed-off-by: Philippe Mathieu-Daudé --- hw/s390x/{pv.c => pv-kvm.c} | 0 hw/s390x/meson.build|

Re: [PATCH] target/s390x/arch_dump: Fix memory corruption in s390x_write_elf64_notes()

2023-02-14 Thread Janosch Frank
SE header that allows dumping. Additionally we need to report the size of the notes way before we start the PV dump process where we get told if the machine is allowed to dump. Thanks for helping with the debug effort and creating a patch Thomas! Reviewed-by: Janosch Frank Also: Reported-by: Seba

Re: [PATCH v3 2/3] s390x/pv: Introduce a s390_pv_check() helper for runtime

2023-01-17 Thread Janosch Frank
On 1/17/23 10:09, Thomas Huth wrote: On 17/01/2023 09.40, Janosch Frank wrote: On 1/16/23 18:46, Cédric Le Goater wrote: From: Cédric Le Goater If a secure kernel is started in a non-protected VM, the OS will hang during boot without giving a proper error message to the user. Didn't we

Re: [PATCH v3 2/3] s390x/pv: Introduce a s390_pv_check() helper for runtime

2023-01-17 Thread Janosch Frank
On 1/16/23 18:46, Cédric Le Goater wrote: From: Cédric Le Goater If a secure kernel is started in a non-protected VM, the OS will hang during boot without giving a proper error message to the user. Didn't we establish that you were missing the IOMMU flag so this statement isn't correct

Re: [PATCH v2 3/4] s390x/pv: Introduce a s390_pv_check() helper for runtime

2023-01-09 Thread Janosch Frank
On 1/9/23 15:31, Janosch Frank wrote: On 1/9/23 14:53, Cédric Le Goater wrote: On 1/9/23 14:45, Janosch Frank wrote: On 1/9/23 14:30, Cédric Le Goater wrote: On 1/9/23 10:49, Janosch Frank wrote: On 1/9/23 10:27, Cédric Le Goater wrote: On 1/9/23 10:04, Janosch Frank wrote: On 1/6/23 08:53

Re: [PATCH v2 3/4] s390x/pv: Introduce a s390_pv_check() helper for runtime

2023-01-09 Thread Janosch Frank
On 1/9/23 14:53, Cédric Le Goater wrote: On 1/9/23 14:45, Janosch Frank wrote: On 1/9/23 14:30, Cédric Le Goater wrote: On 1/9/23 10:49, Janosch Frank wrote: On 1/9/23 10:27, Cédric Le Goater wrote: On 1/9/23 10:04, Janosch Frank wrote: On 1/6/23 08:53, Cédric Le Goater wrote: From: Cédric

Re: [PATCH v2 3/4] s390x/pv: Introduce a s390_pv_check() helper for runtime

2023-01-09 Thread Janosch Frank
On 1/9/23 14:30, Cédric Le Goater wrote: On 1/9/23 10:49, Janosch Frank wrote: On 1/9/23 10:27, Cédric Le Goater wrote: On 1/9/23 10:04, Janosch Frank wrote: On 1/6/23 08:53, Cédric Le Goater wrote: From: Cédric Le Goater If a secure kernel is started in a non-protected VM, the OS

Re: [PATCH v2 2/4] s390x/pv: Check for support on the host

2023-01-09 Thread Janosch Frank
On 1/9/23 10:44, Cédric Le Goater wrote: On 1/9/23 09:45, Janosch Frank wrote: On 1/6/23 08:53, Cédric Le Goater wrote: From: Cédric Le Goater Support for protected VMs should have been enabled on the host with the kernel parameter 'prot_virt=1'. If the hardware supports the feature

Re: [PATCH v2 3/4] s390x/pv: Introduce a s390_pv_check() helper for runtime

2023-01-09 Thread Janosch Frank
On 1/9/23 10:27, Cédric Le Goater wrote: On 1/9/23 10:04, Janosch Frank wrote: On 1/6/23 08:53, Cédric Le Goater wrote: From: Cédric Le Goater If a secure kernel is started in a non-protected VM, the OS will hang during boot without giving a proper error message to the user. Most

Re: [PATCH v2 3/4] s390x/pv: Introduce a s390_pv_check() helper for runtime

2023-01-09 Thread Janosch Frank
On 1/6/23 08:53, Cédric Le Goater wrote: From: Cédric Le Goater If a secure kernel is started in a non-protected VM, the OS will hang during boot without giving a proper error message to the user. Most of the time you see nothing in the console because libvirt is too slow. If you start the

Re: [PATCH v2 2/4] s390x/pv: Check for support on the host

2023-01-09 Thread Janosch Frank
On 1/6/23 08:53, Cédric Le Goater wrote: From: Cédric Le Goater Support for protected VMs should have been enabled on the host with the kernel parameter 'prot_virt=1'. If the hardware supports the feature, it is reflected under sysfs. Reviewed-by: Thomas Huth Signed-off-by: Cédric Le Goater

Re: [PATCH] docs/system/s390x: Document the "loadparm" machine property

2022-11-15 Thread Janosch Frank
On 11/14/22 14:25, Thomas Huth wrote: The "loadparm" machine property is useful for selecting alternative kernels on the disk of the guest, but so far we do not tell the users yet how to use it. Add some documentation to fill this gap. Buglink:

Re: [PULL v2 00/11] Dump patches

2022-10-26 Thread Janosch Frank
On 10/26/22 09:42, Marc-André Lureau wrote: Hi Janosch On Wed, Oct 26, 2022 at 1:37 AM Stefan Hajnoczi wrote: Please solve this CI failure: c++ -o qemu-system-s390x ... /usr/bin/ld: libqemu-s390x-softmmu.fa.p/target_s390x_arch_dump.c.o: in function `arch_sections_add':

Re: [PATCH v6 09/10] s390x: Add KVM PV dump interface

2022-10-25 Thread Janosch Frank
On 10/24/22 20:36, Marc-André Lureau wrote: Hi Janosch On Mon, Oct 17, 2022 at 12:53 PM Janosch Frank wrote: [...] diff --git a/include/hw/s390x/pv.h b/include/hw/s390x/pv.h index e5ea0eca16..3164006674 100644 --- a/include/hw/s390x/pv.h +++ b/include/hw/s390x/pv.h @@ -51,6 +51,10

Re: [PATCH v6 02/10] dump: Write ELF section headers right after ELF header

2022-10-17 Thread Janosch Frank
On 10/17/22 14:49, Marc Hartmayer wrote: Janosch Frank writes: 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 --- dump/dump.c

[PATCH v7] dump: Add architecture section and section string table support

2022-10-17 Thread Janosch Frank
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 Reviewed-by: Marc-André Lureau --- @Marc-André: Is this ok for picking or do you want a full v7 with all

[PATCH v6 09/10] s390x: Add KVM PV dump interface

2022-10-17 Thread Janosch Frank
Let's add a few bits of code which hide the new KVM PV dump API from us via new functions. Signed-off-by: Janosch Frank Reviewed-by: Janis Schoetterl-Glausch --- hw/s390x/pv.c | 51 +++ include/hw/s390x/pv.h | 9 2 files changed, 60

[PATCH v6 05/10] dump: Add architecture section and section string table support

2022-10-17 Thread Janosch Frank
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 --- dump/dump.c| 190 +++-- include/sysemu/dump-arch.h | 3

[PATCH v6 10/10] s390x: pv: Add dump support

2022-10-17 Thread Janosch Frank
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 --- dump/dump.c

[PATCH v6 00/10] dump: Add arch section and s390x PV dump

2022-10-17 Thread Janosch Frank
t's not needed anymore * Changed naming of dump_get_memblock_*() to dump_filter_memblock_*() * Removed various inline functions * Added a re-work of the filter variables Janosch Frank (10): dump: Use a buffer for ELF section data and headers dump: Write ELF section head

[PATCH v6 04/10] dump: Reintroduce memory_offset and section_offset

2022-10-17 Thread Janosch Frank
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 --- dump/dump.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/dump/dump.c b/dump

[PATCH v6 02/10] dump: Write ELF section headers right after ELF header

2022-10-17 Thread Janosch Frank
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 --- dump/dump.c | 31 ++- 1 file changed, 14 insertions

[PATCH v6 01/10] dump: Use a buffer for ELF section data and headers

2022-10-17 Thread Janosch Frank
into a prepare and a write step. Signed-off-by: Janosch Frank --- dump/dump.c | 79 +-- include/sysemu/dump.h | 2 ++ 2 files changed, 55 insertions(+), 26 deletions(-) diff --git a/dump/dump.c b/dump/dump.c index 236559b03a..e7a3b54ebe 100644

[PATCH v6 07/10] s390x: Introduce PV query interface

2022-10-17 Thread Janosch Frank
Introduce an interface over which we can get information about UV data. Signed-off-by: Janosch Frank Reviewed-by: Steffen Eiden Reviewed-by: Janis Schoetterl-Glausch Acked-by: Thomas Huth --- hw/s390x/pv.c | 61 ++ hw/s390x/s390-virtio-ccw.c

[PATCH v6 08/10] RFC: elf.h changes

2022-10-17 Thread Janosch Frank
Adding two s390x note types Signed-off-by: Janosch Frank --- include/elf.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/include/elf.h b/include/elf.h index 3d6b9062c0..8bf1e72720 100644 --- a/include/elf.h +++ b/include/elf.h @@ -1650,6 +1650,8 @@ typedef struct elf64_shdr { #define

[PATCH v6 06/10] s390x: Add protected dump cap

2022-10-17 Thread Janosch Frank
Add a protected dump capability for later feature checking. Signed-off-by: Janosch Frank Reviewed-by: Steffen Eiden Reviewed-by: Thomas Huth Reviewed-by: Janis Schoetterl-Glausch --- target/s390x/kvm/kvm.c | 7 +++ target/s390x/kvm/kvm_s390x.h | 1 + 2 files changed, 8 insertions

[PATCH v6 03/10] dump: Reorder struct DumpState

2022-10-17 Thread Janosch Frank
Let's move ELF related members into one block and guest memory related ones into another to improve readability. Signed-off-by: Janosch Frank Reviewed-by: Richard Henderson Reviewed-by: Marc-André Lureau --- include/sysemu/dump.h | 16 +--- 1 file changed, 9 insertions(+), 7

Re: [PATCH v5 04/18] dump: Rework get_start_block

2022-09-26 Thread Janosch Frank
On 8/29/22 22:17, Janis Schoetterl-Glausch wrote: On Thu, 2022-08-11 at 12:10 +, Janosch Frank wrote: 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

Re: [PATCH v5 12/18] dump/dump: Add section string table support

2022-08-30 Thread Janosch Frank
On 8/30/22 13:35, Steffen Eiden wrote: Hi Janosch, On 8/11/22 14:11, Janosch Frank wrote: As sections don't have a type like the notes do we need another way to determine their contents. The string table allows us to assign each section an identification string which architectures can then use

Re: [PATCH v5 18/18] s390x: pv: Add dump support

2022-08-11 Thread Janosch Frank
On 8/11/22 14:11, Janosch Frank wrote: 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

[PATCH v5 08/18] dump: Rename write_elf*_phdr_note to prepare_elf*_phdr_note

2022-08-11 Thread Janosch Frank
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 --- dump/dump.c | 8 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/dump/dump.c b/dump/dump.c index 8a2a97a85e

[PATCH v5 06/18] dump: Rework dump_calculate_size function

2022-08-11 Thread Janosch Frank
-by: Janosch Frank Reviewed-by: Marc-André Lureau --- dump/dump.c | 22 -- 1 file changed, 8 insertions(+), 14 deletions(-) diff --git a/dump/dump.c b/dump/dump.c index b043337bc7..d82cc46d7d 100644 --- a/dump/dump.c +++ b/dump/dump.c @@ -1548,25 +1548,19 @@ bool

[PATCH v5 12/18] dump/dump: Add section string table support

2022-08-11 Thread Janosch Frank
custom sections which are introduced in a following patch. Signed-off-by: Janosch Frank --- dump/dump.c | 71 +++ include/sysemu/dump.h | 4 +++ 2 files changed, 75 insertions(+) diff --git a/dump/dump.c b/dump/dump.c index 31eb20108c..0d6dbf453a

[PATCH v5 07/18] dump: Split elf header functions into prepare and write

2022-08-11 Thread Janosch Frank
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 --- dump/dump.c | 100 1 file changed, 53 insertions(+), 47 deletions(-) diff --git

[PATCH v5 13/18] dump/dump: Add arch section support

2022-08-11 Thread Janosch Frank
Add hooks which architectures can use to add arbitrary data to custom sections. Signed-off-by: Janosch Frank --- dump/dump.c| 120 ++--- include/sysemu/dump-arch.h | 3 + 2 files changed, 100 insertions(+), 23 deletions(-) diff --git a/dump

[PATCH v5 01/18] dump: Replace opaque DumpState pointer with a typed one

2022-08-11 Thread Janosch Frank
It's always better to convey the type of a pointer if at all possible. So let's add the DumpState typedef to typedefs.h and move the dump note functions from the opaque pointers to DumpState pointers. Signed-off-by: Janosch Frank CC: Peter Maydell CC: Cédric Le Goater CC: Daniel Henrique

[PATCH v5 16/18] s390x: Introduce PV query interface

2022-08-11 Thread Janosch Frank
Introduce an interface over which we can get information about UV data. Signed-off-by: Janosch Frank Reviewed-by: Steffen Eiden --- hw/s390x/pv.c | 61 ++ hw/s390x/s390-virtio-ccw.c | 6 include/hw/s390x/pv.h | 10 +++ 3 files

[PATCH v5 04/18] dump: Rework get_start_block

2022-08-11 Thread Janosch Frank
the start block so it only makes sense to re-name the function to validate_start_block() Signed-off-by: Janosch Frank Reviewed-by: Marc-André Lureau Reviewed-by: Janis Schoetterl-Glausch --- dump/dump.c | 20 ++-- include/sysemu/dump.h | 2 -- 2 files changed, 6 inserti

[PATCH v5 00/18] dump: Add arch section and s390x PV dump

2022-08-11 Thread Janosch Frank
prepare_elf_section_hdr_zero() * Renamed some of the pv functions Janosch Frank (18): dump: Replace opaque DumpState pointer with a typed one dump: Rename write_elf_loads to write_elf_phdr_loads dump: Refactor dump_iterate and introduce dump_filter_memblock_*() dump: Rework

[PATCH v5 11/18] dump: Swap segment and section header locations

2022-08-11 Thread Janosch Frank
been dumped which is important for the s390 PV dump support. Signed-off-by: Janosch Frank Reviewed-by: Marc-André Lureau --- dump/dump.c | 20 +++- 1 file changed, 11 insertions(+), 9 deletions(-) diff --git a/dump/dump.c b/dump/dump.c index 0051c71d08..31eb20108c 100644

[PATCH v5 10/18] dump: Reorder struct DumpState

2022-08-11 Thread Janosch Frank
Let's move ELF related members into one block and guest memory related ones into another to improve readability. Signed-off-by: Janosch Frank Reviewed-by: Richard Henderson Reviewed-by: Marc-André Lureau --- include/sysemu/dump.h | 16 +--- 1 file changed, 9 insertions(+), 7

[PATCH v5 18/18] s390x: pv: Add dump support

2022-08-11 Thread Janosch Frank
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 --- dump/dump.c

[PATCH v5 02/18] dump: Rename write_elf_loads to write_elf_phdr_loads

2022-08-11 Thread Janosch Frank
Let's make it a bit clearer that we write the program headers of the PT_LOAD type. Signed-off-by: Janosch Frank Reviewed-by: Marc-André Lureau Reviewed-by: Janis Schoetterl-Glausch Reviewed-by: Steffen Eiden --- dump/dump.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff

[PATCH v5 14/18] DRAFT: linux header sync

2022-08-11 Thread Janosch Frank
Add the uapi data for KVM_CAP_S390_PROTECTED_DUMP which I expect to be added with 5.20. Also add the missing NT_S390_RI_CB and the new NT_S390_PV_CPU_DATA elf note types. Signed-off-by: Janosch Frank --- include/elf.h | 2 ++ linux-headers/linux/kvm.h | 54

[PATCH v5 09/18] dump: Use a buffer for ELF section data and headers

2022-08-11 Thread Janosch Frank
into a prepare and a write step. Signed-off-by: Janosch Frank --- dump/dump.c | 83 +-- include/sysemu/dump.h | 2 ++ 2 files changed, 58 insertions(+), 27 deletions(-) diff --git a/dump/dump.c b/dump/dump.c index a905316fe5..0051c71d08 100644

[PATCH v5 17/18] s390x: Add KVM PV dump interface

2022-08-11 Thread Janosch Frank
Let's add a few bits of code which hide the new KVM PV dump API from us via new functions. Signed-off-by: Janosch Frank --- hw/s390x/pv.c | 51 +++ include/hw/s390x/pv.h | 8 +++ 2 files changed, 59 insertions(+) diff --git a/hw/s390x/pv.c b

[PATCH v5 05/18] dump: Rework filter area variables

2022-08-11 Thread Janosch Frank
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 --- dump/dump.c

[PATCH v5 15/18] s390x: Add protected dump cap

2022-08-11 Thread Janosch Frank
Add a protected dump capability for later feature checking. Signed-off-by: Janosch Frank Reviewed-by: Steffen Eiden --- target/s390x/kvm/kvm.c | 7 +++ target/s390x/kvm/kvm_s390x.h | 1 + 2 files changed, 8 insertions(+) diff --git a/target/s390x/kvm/kvm.c b/target/s390x/kvm/kvm.c

[PATCH v5 03/18] dump: Refactor dump_iterate and introduce dump_filter_memblock_*()

2022-08-11 Thread Janosch Frank
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 Reviewed-by: Janis Schoetterl-Glausch --- dump/dump.c | 80 ++--- 1 file changed, 45 insertions(+), 35

Re: [PATCH v4 11/17] dump/dump: Add section string table support

2022-08-01 Thread Janosch Frank
On 7/29/22 21:35, Janis Schoetterl-Glausch wrote: On 7/26/22 11:22, Janosch Frank wrote: As sections don't have a type like the notes do we need another way to Having a string table seems like a good idea to me, as we don't know the requirements any architecture might have, but sections do

Re: [PATCH v4 11/17] dump/dump: Add section string table support

2022-08-01 Thread Janosch Frank
On 7/28/22 15:41, Marc-André Lureau wrote: Hi On Tue, Jul 26, 2022 at 6:26 PM Janosch Frank wrote: On 7/26/22 15:12, Marc-André Lureau wrote: On Tue, Jul 26, 2022 at 4:55 PM Janosch Frank wrote: On 7/26/22 13:25, Marc-André Lureau wrote: Hi On Tue, Jul 26, 2022 at 1:23 PM Janosch

Re: [PATCH v4 09/17] dump: Reorder struct DumpState

2022-08-01 Thread Janosch Frank
On 7/29/22 19:21, Janis Schoetterl-Glausch wrote: On 7/26/22 11:22, Janosch Frank wrote: Let's move ELF related members into one block and guest memory related ones into another to improve readability. Signed-off-by: Janosch Frank Reviewed-by: Richard Henderson Reviewed-by: Marc-André Lureau

Re: [PATCH v4 08/17] dump: Split write of section headers and data and add a prepare step

2022-08-01 Thread Janosch Frank
On 7/29/22 19:16, Janis Schoetterl-Glausch wrote: On 7/26/22 11:22, Janosch Frank wrote: By splitting the writing of the section headers and (future) section data we prepare for the addition of a string table section and architecture sections. At the same time we move the writing

Re: [PATCH v4 12/17] dump/dump: Add arch section support

2022-07-28 Thread Janosch Frank
On 7/26/22 13:30, Marc-André Lureau wrote: Hi On Tue, Jul 26, 2022 at 1:23 PM Janosch Frank wrote: Add hooks which architectures can use to add arbitrary data to custom sections. Signed-off-by: Janosch Frank --- dump/dump.c| 5 + include/sysemu/dump-arch.h | 27

Re: [PATCH v4 11/17] dump/dump: Add section string table support

2022-07-26 Thread Janosch Frank
On 7/26/22 15:12, Marc-André Lureau wrote: On Tue, Jul 26, 2022 at 4:55 PM Janosch Frank wrote: On 7/26/22 13:25, Marc-André Lureau wrote: Hi On Tue, Jul 26, 2022 at 1:23 PM Janosch Frank wrote: As sections don't have a type like the notes do we need another way to determine

Re: [PATCH v4 02/17] dump: Introduce GuestPhysBlock offset and length filter functions

2022-07-26 Thread Janosch Frank
On 7/26/22 13:35, Marc-André Lureau wrote: On Tue, Jul 26, 2022 at 1:23 PM Janosch Frank wrote: The iteration over the memblocks 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

Re: [PATCH v4 11/17] dump/dump: Add section string table support

2022-07-26 Thread Janosch Frank
On 7/26/22 13:25, Marc-André Lureau wrote: Hi On Tue, Jul 26, 2022 at 1:23 PM Janosch Frank wrote: As sections don't have a type like the notes do we need another way to determine their contents. The string table allows us to assign each section an identification string which architectures

[PATCH v4 14/17] s390x: Add protected dump cap

2022-07-26 Thread Janosch Frank
Add a protected dump capability for later feature checking. Signed-off-by: Janosch Frank Reviewed-by: Steffen Eiden --- target/s390x/kvm/kvm.c | 7 +++ target/s390x/kvm/kvm_s390x.h | 1 + 2 files changed, 8 insertions(+) diff --git a/target/s390x/kvm/kvm.c b/target/s390x/kvm/kvm.c

[PATCH v4 15/17] s390x: Introduce PV query interface

2022-07-26 Thread Janosch Frank
Introduce an interface over which we can get information about UV data. Signed-off-by: Janosch Frank Reviewed-by: Steffen Eiden --- hw/s390x/pv.c | 61 ++ hw/s390x/s390-virtio-ccw.c | 5 include/hw/s390x/pv.h | 10 +++ 3 files

[PATCH v4 13/17] linux header sync

2022-07-26 Thread Janosch Frank
Add the uapi data for KVM_CAP_S390_PROTECTED_DUMP which I expect to be added with 5.20. Also add the missing NT_S390_RI_CB and the new NT_S390_PV_CPU_DATA elf note types. Signed-off-by: Janosch Frank --- include/elf.h | 2 ++ linux-headers/linux/kvm.h | 54

[PATCH v4 16/17] s390x: Add KVM PV dump interface

2022-07-26 Thread Janosch Frank
Let's add a few bits of code which hide the new KVM PV dump API from us via new functions. Signed-off-by: Janosch Frank --- hw/s390x/pv.c | 51 +++ include/hw/s390x/pv.h | 8 +++ 2 files changed, 59 insertions(+) diff --git a/hw/s390x/pv.c b

[PATCH v4 17/17] s390x: pv: Add dump support

2022-07-26 Thread Janosch Frank
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 --- target/s390x/arch_dump.c

[PATCH v4 11/17] dump/dump: Add section string table support

2022-07-26 Thread Janosch Frank
custom sections which are introduced in a following patch. Signed-off-by: Janosch Frank --- dump/dump.c | 81 ++- include/sysemu/dump.h | 1 + 2 files changed, 81 insertions(+), 1 deletion(-) diff --git a/dump/dump.c b/dump/dump.c index 3cf846d0a0

[PATCH v4 10/17] dump: Swap segment and section header locations

2022-07-26 Thread Janosch Frank
been dumped which is important for the s390 PV dump support. Signed-off-by: Janosch Frank --- dump/dump.c | 21 - include/sysemu/dump.h | 1 + 2 files changed, 13 insertions(+), 9 deletions(-) diff --git a/dump/dump.c b/dump/dump.c index a6bb7bfa21..3cf846d0a0

[PATCH v4 09/17] dump: Reorder struct DumpState

2022-07-26 Thread Janosch Frank
Let's move ELF related members into one block and guest memory related ones into another to improve readability. Signed-off-by: Janosch Frank Reviewed-by: Richard Henderson Reviewed-by: Marc-André Lureau --- include/sysemu/dump.h | 16 +--- 1 file changed, 9 insertions(+), 7

[PATCH v4 08/17] dump: Split write of section headers and data and add a prepare step

2022-07-26 Thread Janosch Frank
data after all of the common dump data has been written. Signed-off-by: Janosch Frank --- dump/dump.c | 112 -- include/sysemu/dump.h | 4 ++ 2 files changed, 90 insertions(+), 26 deletions(-) diff --git a/dump/dump.c b/dump/dump.c index

[PATCH v4 07/17] dump: Allocate header

2022-07-26 Thread Janosch Frank
Allocating the header lets us write it at a later time and hence also allows us to change section and segment table offsets until we finally write it. Signed-off-by: Janosch Frank Reviewed-by: Marc-André Lureau --- dump/dump.c | 127 +- include

[PATCH v4 12/17] dump/dump: Add arch section support

2022-07-26 Thread Janosch Frank
Add hooks which architectures can use to add arbitrary data to custom sections. Signed-off-by: Janosch Frank --- dump/dump.c| 5 + include/sysemu/dump-arch.h | 27 +++ 2 files changed, 32 insertions(+) diff --git a/dump/dump.c b/dump/dump.c index

[PATCH v4 05/17] dump: Cleanup and annotate guest memory related DumpState struct members

2022-07-26 Thread Janosch Frank
We can safely remove next_block and start as both of them aren't used anymore due to the block iteration re-work. Also we add comments to the remaining guest memory related struct members and a comment on top to group them. Signed-off-by: Janosch Frank --- include/sysemu/dump.h | 9

[PATCH v4 06/17] dump: Rework dump_calculate_size function

2022-07-26 Thread Janosch Frank
-by: Janosch Frank --- dump/dump.c | 20 ++-- 1 file changed, 6 insertions(+), 14 deletions(-) diff --git a/dump/dump.c b/dump/dump.c index b59faf9941..57558a4d4b 100644 --- a/dump/dump.c +++ b/dump/dump.c @@ -1540,25 +1540,17 @@ bool qemu_system_dump_in_progress(void) return

[PATCH v4 03/17] dump: Convert GuestPhysBlock iterators and use the filter functions

2022-07-26 Thread Janosch Frank
*() functions. Signed-off-by: Janosch Frank --- dump/dump.c | 51 +++ 1 file changed, 11 insertions(+), 40 deletions(-) diff --git a/dump/dump.c b/dump/dump.c index 0fd7c76c1e..35b9833a00 100644 --- a/dump/dump.c +++ b/dump/dump.c @@ -628,56 +628,27

[PATCH v4 01/17] dump: Rename write_elf_loads to write_elf_phdr_loads

2022-07-26 Thread Janosch Frank
Let's make it a bit clearer that we write the program headers of the PT_LOAD type. Signed-off-by: Janosch Frank Reviewed-by: Marc-André Lureau --- dump/dump.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/dump/dump.c b/dump/dump.c index 4d9658ffa2..0ed7cf9c7b 100644

[PATCH v4 04/17] dump: Rework get_start_block

2022-07-26 Thread Janosch Frank
the function to validate_start_block() Signed-off-by: Janosch Frank --- dump/dump.c | 20 ++-- 1 file changed, 6 insertions(+), 14 deletions(-) diff --git a/dump/dump.c b/dump/dump.c index 35b9833a00..b59faf9941 100644 --- a/dump/dump.c +++ b/dump/dump.c @@ -1498,30 +1498,22

[PATCH v4 02/17] dump: Introduce GuestPhysBlock offset and length filter functions

2022-07-26 Thread Janosch Frank
*() functions. Signed-off-by: Janosch Frank --- dump/dump.c | 37 + include/sysemu/dump.h | 5 + 2 files changed, 42 insertions(+) diff --git a/dump/dump.c b/dump/dump.c index 0ed7cf9c7b..0fd7c76c1e 100644 --- a/dump/dump.c +++ b/dump/dump.c @@ -591,6

[PATCH v4 00/17] dump: Add arch section and s390x PV dump

2022-07-26 Thread Janosch Frank
ot; * Fixed whitespace problems and review comments * Added missing *errp check in dump_end Janosch Frank (17): dump: Rename write_elf_loads to write_elf_phdr_loads dump: Introduce GuestPhysBlock offset and length filter functions dump: Convert GuestPhysBlock iterators and u

Re: [PATCH v3 03/14] dump: Convert GuestPhysBlock iterators and use the filter functions

2022-07-21 Thread Janosch Frank
On 7/21/22 16:36, Marc-André Lureau wrote: [..] diff --git a/include/sysemu/dump.h b/include/sysemu/dump.h index 2b39abeeae..7025e50682 100644 --- a/include/sysemu/dump.h +++ b/include/sysemu/dump.h @@ -166,11 +166,10 @@ typedef struct DumpState { hwaddr memory_offset; int fd; -

Re: [PATCH v3 08/14] dump/dump: Add section string table support

2022-07-21 Thread Janosch Frank
On 7/21/22 15:22, Janosch Frank wrote: As sections don't have a type like the notes do we need another way to determine their contents. The string table allows us to assign each section an identification string which architectures can then use to tag their sections with. There will be no string

Re: [PATCH v3 07/14] dump: Swap segment and section header locations

2022-07-21 Thread Janosch Frank
On 7/21/22 17:07, Marc-André Lureau wrote: Hi On Thu, Jul 21, 2022 at 5:23 PM Janosch Frank wrote: For the upcoming string table and arch section support we need to modify the elf layout a bit. Instead of the segments, i.e. the guest's memory contents, beeing the last area the section data

Re: [PATCH v3 10/14] linux header sync

2022-07-21 Thread Janosch Frank
On 7/21/22 17:05, Marc-André Lureau wrote: On Thu, Jul 21, 2022 at 5:23 PM Janosch Frank wrote: Add the uapi data for KVM_CAP_S390_PROTECTED_DUMP which I expect to be added with 5.20. It's going to be overwritten by the next update-linux-headers.sh. I'd mark this patch as WIP or Draft

Re: [PATCH v3 05/14] dump: Split write of section headers and data and add a prepare step

2022-07-21 Thread Janosch Frank
On 7/21/22 16:41, Marc-André Lureau wrote: On Thu, Jul 21, 2022 at 5:23 PM Janosch Frank wrote: By splitting the writing of the section headers and (future) section data we prepare for the addition of a string table section and architecture sections. At the same time we move the writing

[PATCH v3 13/14] s390x: Add KVM PV dump interface

2022-07-21 Thread Janosch Frank
Let's add a few bits of code which hide the new KVM PV dump API from us via new functions. Signed-off-by: Janosch Frank --- hw/s390x/pv.c | 51 +++ include/hw/s390x/pv.h | 8 +++ 2 files changed, 59 insertions(+) diff --git a/hw/s390x/pv.c b

[PATCH v3 14/14] s390x: pv: Add dump support

2022-07-21 Thread Janosch Frank
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 --- include/elf.h

[PATCH v3 11/14] s390x: Add protected dump cap

2022-07-21 Thread Janosch Frank
Add a protected dump capability for later feature checking. Signed-off-by: Janosch Frank --- target/s390x/kvm/kvm.c | 7 +++ target/s390x/kvm/kvm_s390x.h | 1 + 2 files changed, 8 insertions(+) diff --git a/target/s390x/kvm/kvm.c b/target/s390x/kvm/kvm.c index 7bd8db0e7b..cbd8c91424

[PATCH v3 10/14] linux header sync

2022-07-21 Thread Janosch Frank
Add the uapi data for KVM_CAP_S390_PROTECTED_DUMP which I expect to be added with 5.20. Signed-off-by: Janosch Frank --- linux-headers/linux/kvm.h | 54 +++ 1 file changed, 54 insertions(+) diff --git a/linux-headers/linux/kvm.h b/linux-headers/linux/kvm.h

[PATCH v3 09/14] dump/dump: Add arch section support

2022-07-21 Thread Janosch Frank
Add hooks which architectures can use to add arbitrary data to custom sections. Signed-off-by: Janosch Frank --- dump/dump.c| 6 ++ include/sysemu/dump-arch.h | 27 +++ 2 files changed, 33 insertions(+) diff --git a/dump/dump.c b/dump/dump.c index

  1   2   3   4   5   6   7   8   9   >