Re: [PATCH v4 3/3] target/s390x: Return UVC cmd code, RC and RRC value when DIAG 308 Subcode 10 fails to enter secure mode

2025-04-22 Thread Janosch Frank
+ .diag_rc = DIAG_308_RC_INVAL_FOR_PV}; + @Thomas: Is the formatting of the assignments correct or should there be no assignment on lines containing "{}"? Checkpatch is happy, though personally I find it hard to read. Once that's clear or fixed: Reviewed-by: Janosch Frank

Re: [PATCH v4 2/3] target/s390x: Introduce function when exiting PV

2025-04-22 Thread Janosch Frank
On 4/17/25 2:37 PM, Gautam Gala wrote: Replace an existing macro (s390_pv_cmd_exit) that looks like a function with an actual function. The function will be used when exiting PV instead of the macro. Reviewed-by: Steffen Eiden Signed-off-by: Gautam Gala Reviewed-by: Janosch Frank

Re: [PATCH v4 1/3] target/s390x: Introduce constant when checking if PV header couldn't be decrypted

2025-04-22 Thread Janosch Frank
async(S390CcwMachineState *ms) return true; } +#define DIAG_308_UV_RC_INVAL_HOSTKEY0x0108 s/DIAG_308_UV_RC_INVAL_HOSTKEY/UV_RC_SSC_INVAL_HOSTKEY/ The naming of the constant should reflect to which UV command this rc belongs to. Once changed: Reviewed-by: Janosch Frank

Re: [PATCH v3 3/3] target/s390x: Return UVC cmd code, RC and RRC value when DIAG 308 Subcode 10 fails to enter secure mode

2025-04-17 Thread Janosch Frank
On 4/17/25 9:40 AM, Gautam Gala wrote: Extend DIAG308 subcode 10 to return the UVC RC, RRC and command code in bit positions 32-47, 16-31, and 0-15 of register R1 + 1 if the function does not complete successfully (in addition to the previously returned diag response code in bit position 47-63).

Re: [RFC PATCH v2 05/15] s390x/cpumodel: Add ptff Query Time-Stamp Event (QTSE) support

2024-12-10 Thread Janosch Frank
On 12/6/24 1:27 PM, Hendrik Brueckner wrote: Introduce a new PTFF subfunction to query-stamp events. Signed-off-by: Hendrik Brueckner Reviewed-by: Janosch Frank

Re: [RFC PATCH v2 02/15] s390x/cpumodel: add msa11 subfunctions

2024-12-10 Thread Janosch Frank
On 12/9/24 4:29 PM, Hendrik Brueckner wrote: On Mon, Dec 09, 2024 at 04:04:19PM +0100, Janosch Frank wrote: On 12/6/24 1:27 PM, Hendrik Brueckner wrote: MSA11 introduces new HMAC subfunctions. Consider this to be an ACK of the MSA patches.

Re: [RFC PATCH v2 12/15] s390x/cpumodel: Add Sequential-Instruction-Fetching facility

2024-12-10 Thread Janosch Frank
On 12/6/24 1:27 PM, Hendrik Brueckner wrote: The sequential instruction fetching facility provides few guarantees, for example, to avoid stop machine calls on enabling/disabling kprobes. Signed-off-by: Hendrik Brueckner Reviewed-by: Janosch Frank

Re: [RFC PATCH v2 11/15] s390x/cpumodel: add Ineffective-nonconstrained-transaction facility

2024-12-10 Thread Janosch Frank
On 12/6/24 1:27 PM, Hendrik Brueckner wrote: This facility indicates reduced support for noncontrained transactional-execution. Signed-off-by: Hendrik Brueckner Reviewed-by: Janosch Frank

Re: [RFC PATCH v2 07/15] s390x/cpumodel: add Concurrent-functions facility support

2024-12-10 Thread Janosch Frank
On 12/6/24 1:27 PM, Hendrik Brueckner wrote: The Concurrent-functions facility introduces the new instruction Perform Functions with Concurrent Results (PFCR) with few subfunctions. Signed-off-by: Hendrik Brueckner Reviewed-by: Janosch Frank

Re: [RFC PATCH v2 09/15] s390x/cpumodel: add Miscellaneous-Instruction-Extensions Facility 4

2024-12-10 Thread Janosch Frank
On 12/6/24 1:27 PM, Hendrik Brueckner wrote: This facility introduces few new instructions. Signed-off-by: Hendrik Brueckner --- Reviewed-by: Janosch Frank

Re: [RFC PATCH v2 08/15] s390x/cpumodel: add Vector Enhancements facility 3

2024-12-10 Thread Janosch Frank
On 12/6/24 1:27 PM, Hendrik Brueckner wrote: The Vector Enhancements facility 3 introduces new instructions and extends support for doubleword/quadword elements. Signed-off-by: Hendrik Brueckner Reviewed-by: Janosch Frank

Re: [RFC PATCH v2 10/15] s390x/cpumodel: add Vector-Packed-Decimal-Enhancement facility 3

2024-12-10 Thread Janosch Frank
-by: Janosch Frank

Re: [RFC PATCH v2 03/15] s390x/cpumodel: add msa12 changes

2024-12-09 Thread Janosch Frank
On 12/9/24 4:54 PM, Hendrik Brueckner wrote: On Mon, Dec 09, 2024 at 04:45:25PM +0100, Janosch Frank wrote: On 12/9/24 4:24 PM, Hendrik Brueckner wrote: On Mon, Dec 09, 2024 at 03:48:11PM +0100, Janosch Frank wrote: On 12/6/24 1:27 PM, Hendrik Brueckner wrote: MSA12 changes the KIMD/KLMD

Re: [RFC PATCH v2 03/15] s390x/cpumodel: add msa12 changes

2024-12-09 Thread Janosch Frank
On 12/6/24 1:27 PM, Hendrik Brueckner wrote: MSA12 changes the KIMD/KLMD instruction format for SHA3/SHAKE. Signed-off-by: Hendrik Brueckner Reviewed-by: Christian Borntraeger MSA6 is a prereq, no?

Re: [RFC PATCH v2 03/15] s390x/cpumodel: add msa12 changes

2024-12-09 Thread Janosch Frank
On 12/9/24 4:24 PM, Hendrik Brueckner wrote: On Mon, Dec 09, 2024 at 03:48:11PM +0100, Janosch Frank wrote: On 12/6/24 1:27 PM, Hendrik Brueckner wrote: MSA12 changes the KIMD/KLMD instruction format for SHA3/SHAKE. Signed-off-by: Hendrik Brueckner Reviewed-by: Christian Borntraeger MSA6

Re: [RFC PATCH v2 02/15] s390x/cpumodel: add msa11 subfunctions

2024-12-09 Thread Janosch Frank
On 12/6/24 1:27 PM, Hendrik Brueckner wrote: MSA11 introduces new HMAC subfunctions. Signed-off-by: Hendrik Brueckner Reviewed-by: Christian Borntraeger --- target/s390x/cpu_features.c | 2 ++ target/s390x/cpu_features_def.h.inc | 10 ++ target/s390x/cpu_models.c

Re: [RFC PATCH v2 04/15] s390x/cpumodel: add msa13 subfunctions

2024-12-09 Thread Janosch Frank
On 12/6/24 1:27 PM, Hendrik Brueckner wrote: MSA13 introduces query authentication information (QAI) subfunctions. Signed-off-by: Hendrik Brueckner Reviewed-by: Janosch Frank

Re: [RFC PATCH v2 00/15] KVM: s390: CPU model for gen17

2024-12-09 Thread Janosch Frank
On 12/6/24 3:14 PM, Richard Henderson wrote: On 12/6/24 06:27, Hendrik Brueckner wrote: Introducing the gen17 CPU model with feature indications comprising of: * Concurrent-function facility with subcodes * More vector extensions * Ineffective-nonconstrained-transaction facility * Even more msa

Re: [PATCH v1 00/14] s390x: virtio-mem support

2024-10-02 Thread Janosch Frank
On 10/1/24 10:54 AM, David Hildenbrand wrote: On 30.09.24 23:49, Halil Pasic wrote: On Fri, 27 Sep 2024 20:29:19 +0200 David Hildenbrand wrote: On 27.09.24 20:20, Halil Pasic wrote: On Wed, 11 Sep 2024 21:09:27 +0200 David Hildenbrand wrote: [...] That is a valid point. But IMHO the ben

Re: [PATCH v1 07/14] s390x/s390-hypercall: introduce DIAG500 STORAGE_LIMIT

2024-09-12 Thread Janosch Frank
On 9/12/24 10:19 AM, Thomas Huth wrote: On 10/09/2024 19.58, David Hildenbrand wrote: [...] diff --git a/hw/s390x/s390-hypercall.h b/hw/s390x/s390-hypercall.h index b7ac29f444..f0ca62bcbb 100644 --- a/hw/s390x/s390-hypercall.h +++ b/hw/s390x/s390-hypercall.h @@ -18,6 +18,7 @@ #define DIAG5

Re: [PATCH v1 00/14] s390x: virtio-mem support

2024-09-11 Thread Janosch Frank
On 9/10/24 7:57 PM, David Hildenbrand wrote: This series introduces a new diag(500) "STORAGE LIMIT" subcode that will be documented at [2] once this+kernel part go upstream. Why not in Documentation/virt/kvm/s390/? s390-diag.rst is very similar already. I'd rather have it in a shared and bigge

Re: [PATCH v1 01/14] s390x/s390-virtio-ccw: don't crash on weird RAM sizes

2024-09-11 Thread Janosch Frank
argument kvm_set_phys_mem: error registering slot: Invalid argument Aborted (core dumped) Let's handle that in a better way by rejecting such weird RAM sizes right from the start: Huh, I always assumed that ram is handled in multiples of 1MB in QEMU. Acked-by: Janosch Frank

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 "secure

[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 inser

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

2023-11-09 Thread Janosch Frank
nning 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

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

2023-11-09 Thread Janosch Frank
. The dump 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

[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_dum

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

[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 inser

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

2023-11-07 Thread Janosch Frank
nning 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 t

[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
. The dump 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

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

2023-09-01 Thread Janosch Frank
reset some 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

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 switc

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 PV-AP

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
machine AND a bit in the 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

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'

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 anymo

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 will

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 feat

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 of the

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 V

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: https://bugzilla.redhat.com/show_bug.cgi?id=2128235

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': /home/gitlab-runner/b

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/d

[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 change

[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
de 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 -

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

2022-10-17 Thread Janosch Frank
in a way that it'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: Wr

[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 inser

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

2022-10-17 Thread Janosch Frank
ode 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 10

[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(

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 r

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 the

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 fro

[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
: 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
#x27;t add 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..

[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 --

[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: Danie

[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
on of 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 in

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

2022-08-11 Thread Janosch Frank
emoved buff argument from 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_me

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

2022-08-11 Thread Janosch Frank
y has 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(

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

2022-08-11 Thread Janosch Frank
de 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 -

[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(-)

[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
ode 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 10

[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/p

[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/dum

[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
g 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(+

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 s

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é L

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 of the

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 memb

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 architec

[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/p

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

2022-07-26 Thread Janosch Frank
de 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 --- target/s3

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

2022-07-26 Thread Janosch Frank
#x27;t add 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

  1   2   3   4   5   6   7   8   9   >