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

2025-04-25 Thread Steffen Eiden
iag response code in bit position 47-63). > Reviewed-by: Steffen Eiden > Reviewed-by: Janosch Frank > Signed-off-by: Gautam Gala > --- > hw/s390x/ipl.c | 11 > hw/s390x/ipl.h | 6 +++-- > hw/s390x/s390-virtio-ccw.c | 14 ++- &

Re: [PATCH v1 2/3] target/s390x: introduce function when exiting PV

2025-04-15 Thread Steffen Eiden
On Fri, Apr 11, 2025 at 11:22:32AM +0200, Gautam Gala wrote: > introduce a static function when exiting PV. The function replaces an > existing macro (s390_pv_cmd_exit). > > Signed-off-by: Gautam Gala > --- > target/s390x/kvm/pv.c | 17 + > 1 file changed, 9 insertions(+), 8 dele

Re: [PATCH v2 2/3] target/s390x: introduce function when exiting PV

2025-04-15 Thread Steffen Eiden
On Mon, Apr 14, 2025 at 05:48:37PM +0200, Gautam Gala wrote: > introduce a static function when exiting PV. The function replaces an > existing macro (s390_pv_cmd_exit). > Reviewed-by: Steffen Eiden > Signed-off-by: Gautam Gala Nit: start with capital letters at beginning of s

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

2025-04-14 Thread Steffen Eiden
On Fri, Apr 11, 2025 at 11:22:33AM +0200, 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 c

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

2025-04-14 Thread Steffen Eiden
. > > Signed-off-by: Gautam Gala Reviewed-by: Steffen Eiden

[PATCH v4 1/5] s390x/ap: fix missing subsystem reset registration

2023-08-23 Thread Steffen Eiden
From: Janosch Frank A subsystem reset contains a reset of AP resources which has been missing. Adding the AP bridge to the list of device types that need reset fixes this issue. Reviewed-by: Jason J. Herne Reviewed-by: Tony Krowiak Signed-off-by: Janosch Frank Fixes: a51b3153 ("s390x/ap: bas

[PATCH v4 4/5] target/s390x/kvm: Refactor AP functionalities

2023-08-23 Thread Steffen Eiden
Signed-off-by: Steffen Eiden --- target/s390x/kvm/kvm.c | 24 +--- 1 file changed, 17 insertions(+), 7 deletions(-) diff --git a/target/s390x/kvm/kvm.c b/target/s390x/kvm/kvm.c index a9e5880349..a7e2cdf668 100644 --- a/target/s390x/kvm/kvm.c +++ b/target/s390x/kvm/kvm.c @@ -250,7

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

2023-08-23 Thread Steffen Eiden
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 the ordering around to make that happen. Reviewed-by: Christian Borntraeger Signed-off-by: Janosch Frank ---

[PATCH v4 5/5] target/s390x: AP-passthrough for PV guests

2023-08-23 Thread Steffen Eiden
uot; AP-pt is enabled as well. Note that KVM itself does not enforce this restriction. Reviewed-by: Michael Mueller Reviewed-by: Thomas Huth Signed-off-by: Steffen Eiden --- target/s390x/cpu_features.h | 1 + target/s390x/cpu_features_def.h.inc | 4 ++ target/s390x/cpu_models.c

[PATCH v4 0/5] s390: Enable AP instructions for pv-guests

2023-08-23 Thread Steffen Eiden
stem reset registration s390x: switch pv and subsystem reset ordering on reboot Steffen Eiden (3): NOTFORMERGE update linux-headers/asm-s390/kvm.h target/s390x/kvm: Refactor AP functionalities target/s390x: AP-passthrough for PV guests hw/s390x/s390-virtio-ccw.c | 7 ++- l

[PATCH v4 3/5] NOTFORMERGE update linux-headers/asm-s390/kvm.h

2023-08-23 Thread Steffen Eiden
Likely to be included in Linux 6.{6,7} Signed-off-by: Steffen Eiden --- linux-headers/asm-s390/kvm.h | 16 1 file changed, 16 insertions(+) diff --git a/linux-headers/asm-s390/kvm.h b/linux-headers/asm-s390/kvm.h index e2afd95420..023a2763a9 100644 --- a/linux-headers/asm-s390

[PATCH v3 5/5] target/s390x: AP-passthrough for PV guests

2023-08-18 Thread Steffen Eiden
uot; AP-pt is enabled as well. Note that KVM itself does not enforce this restriction. Signed-off-by: Steffen Eiden --- target/s390x/cpu_features.h | 1 + target/s390x/cpu_features_def.h.inc | 4 ++ target/s390x/cpu_models.c | 2 + target/s390x/gen-features.c | 2

[PATCH v3 1/5] s390x/ap: fix missing subsystem reset registration

2023-08-18 Thread Steffen Eiden
From: Janosch Frank A subsystem reset contains a reset of AP resources which has been missing. Adding the AP bridge to the list of device types that need reset fixes this issue. Reviewed-by: Jason J. Herne Reviewed-by: Tony Krowiak Signed-off-by: Janosch Frank Fixes: a51b3153 ("s390x/ap: bas

[PATCH v3 4/5] target/s390x/kvm: Refactor AP functionalities

2023-08-18 Thread Steffen Eiden
kvm_s390_set_attr() is a misleading name as it only sets attributes for the KVM_S390_VM_CRYPTO group. Therefore, rename it to kvm_s390_set_crypto_attr(). Add new functions ap_available() and ap_enabled() to avoid code duplication later. Reviewed-by: Michael Mueller Signed-off-by: Steffen Eiden

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

2023-08-18 Thread Steffen Eiden
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 the ordering around to make that happen. Reviewed-by: Christian Borntraeger Signed-off-by: Janosch Frank ---

[PATCH v3 3/5] NOTFORMERGE update linux-headers/asm-s390/kvm.h

2023-08-18 Thread Steffen Eiden
Likely to be included in Linux 6.{6,7} Signed-off-by: Steffen Eiden --- linux-headers/asm-s390/kvm.h | 16 1 file changed, 16 insertions(+) diff --git a/linux-headers/asm-s390/kvm.h b/linux-headers/asm-s390/kvm.h index e2afd95420..023a2763a9 100644 --- a/linux-headers/asm-s390

[PATCH v3 0/5] s390: Enable AP instructions for pv-guests

2023-08-18 Thread Steffen Eiden
reboot Steffen Eiden (3): NOTFORMERGE update linux-headers/asm-s390/kvm.h target/s390x/kvm: Refactor AP functionalities target/s390x: AP-passthrough for PV guests hw/s390x/s390-virtio-ccw.c | 7 ++- linux-headers/asm-s390/kvm.h| 16 + target/s390x/cpu_features.h

[PATCH v2 0/3] KVM: s390: Enable AP instructions for pv-guests

2023-08-10 Thread Steffen Eiden
default gen16 model - updated KVM-headers to match KVM series v3 [1] - applied review comments from Thomas [1] https://lore.kernel.org/linux-s390/20230810113255.2163043-1-sei...@linux.ibm.com/#t Steffen Steffen Eiden (3): linux-headers: update asm-s390/kvm.h target/s390x/kvm: Refactor AP

[PATCH v2 2/3] target/s390x/kvm: Refactor AP functionalities

2023-08-10 Thread Steffen Eiden
kvm_s390_set_attr() is a misleading name as it only sets attributes for the KVM_S390_VM_CRYPTO group. Therefore, rename it to kvm_s390_set_crypto_attr(). Add new functions ap_available() and ap_enabled() to avoid code duplication later. Signed-off-by: Steffen Eiden --- target/s390x/kvm/kvm.c

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

2023-08-10 Thread Steffen Eiden
uot; AP-pt is enabled as well. Note that KVM itself does not enforce this restriction. Signed-off-by: Steffen Eiden --- target/s390x/cpu_features.h | 1 + target/s390x/cpu_features_def.h.inc | 4 ++ target/s390x/cpu_models.c | 2 + target/s390x/gen-features.c | 2

[PATCH v2 1/3] linux-headers: update asm-s390/kvm.h

2023-08-10 Thread Steffen Eiden
Signed-off-by: Steffen Eiden --- linux-headers/asm-s390/kvm.h | 16 1 file changed, 16 insertions(+) diff --git a/linux-headers/asm-s390/kvm.h b/linux-headers/asm-s390/kvm.h index e2afd95420..023a2763a9 100644 --- a/linux-headers/asm-s390/kvm.h +++ b/linux-headers/asm-s390

Re: [PATCH 0/3] KVM: s390: Enable AP instructions for pv-guests

2023-07-28 Thread Steffen Eiden
On 7/27/23 14:25, Steffen Eiden wrote: This series enables general QEMU support for AP pass-through for Secure Execution guests (pv-guests). To enable AP-PT on pv-guests QEMU has to turn on the corresponding bits in the KVM CPU-model[1] if the CPU firmware supports it. However, it only makes

[PATCH 0/3] KVM: s390: Enable AP instructions for pv-guests

2023-07-27 Thread Steffen Eiden
model this behavior (ap=on -> appv=on -> appvi=on). So I hope someone on the list can help me and give some pointers on how to implement that. Steffen Steffen Eiden (3): linux-headers: update asm-s390/kvm.h target/s390x: refractor AP functionalities target/s390x: AP-passthrough for

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

2023-07-27 Thread Steffen Eiden
uot; AP-pt is enabled as well. Note that KVM itself does not enforce this restriction. If regular AP-pt is enabled and kvm/firmware supports PV-AP-pt it is also turned on by default. Signed-off-by: Steffen Eiden --- target/s390x/cpu_features.h | 1 + target/s390x/cpu_features_def.

[PATCH 1/3] linux-headers: update asm-s390/kvm.h

2023-07-27 Thread Steffen Eiden
Signed-off-by: Steffen Eiden --- linux-headers/asm-s390/kvm.h | 21 + 1 file changed, 21 insertions(+) diff --git a/linux-headers/asm-s390/kvm.h b/linux-headers/asm-s390/kvm.h index e2afd95420..178edb959e 100644 --- a/linux-headers/asm-s390/kvm.h +++ b/linux-headers/asm-s390

[PATCH 2/3] target/s390x: refractor AP functionalities

2023-07-27 Thread Steffen Eiden
Signed-off-by: Steffen Eiden --- target/s390x/kvm/kvm.c | 18 +++--- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/target/s390x/kvm/kvm.c b/target/s390x/kvm/kvm.c index 3ac7ec9acf..bd62a7f606 100644 --- a/target/s390x/kvm/kvm.c +++ b/target/s390x/kvm/kvm.c @@ -250,7

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

2022-10-20 Thread Steffen Eiden
On 10/17/22 10:38, Janosch Frank wrote: 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 Reviewed-by: Steffen Eiden --- hw/s390x/pv.c

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

2022-10-20 Thread Steffen Eiden
Signed-off-by: Janosch Frank Reviewed-by: Steffen Eiden --- dump/dump.c | 12 +- include/sysemu/dump.h| 5 + target/s390x/arch_dump.c | 262 +++ 3 files changed, 246 insertions(+), 33 deletions(-) [ snip ]

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

2022-08-30 Thread Steffen Eiden
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 to tag their sections with. There will

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

2022-08-23 Thread Steffen Eiden
; elf_note_size = elf_note_size + note_head_size + name_size + -nf->contents_size; +content_size; } return (elf_note_size) * nr_cpus; LGTM, and I can confirm this produces a valid pv-dump that can be decrypted. Please have a look on my comments. With the nits fixed: Reviewed-by: Steffen Eiden

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

2022-08-23 Thread Steffen Eiden
st) { return 0; } +static inline int kvm_s390_dump_complete(void *buff) { return 0; } #endif /* CONFIG_KVM */ int s390_pv_kvm_init(ConfidentialGuestSupport *cgs, Error **errp); Beside that nit, LGTM. Reviewed-by: Steffen Eiden

Re: [PATCH v4 04/17] dump: Rework get_start_block

2022-07-28 Thread Steffen Eiden
f the start block so it only makes sense to re-name the function to validate_start_block() Signed-off-by: Janosch Frank Reviewed-by: Steffen Eiden --- dump/dump.c | 20 ++-- 1 file changed, 6 insertions(+), 14 deletions(-) diff --git a/dump/dump.c b/dump/dump.c index 35b98

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

2022-07-28 Thread Steffen Eiden
On 7/26/22 11:22, Janosch Frank wrote: 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: Steffen Eiden --- dump/dump.c | 6 +++--- 1 file changed, 3 insertions(+), 3 dele

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

2022-07-22 Thread Steffen Eiden
Hi Janosch, looks good to me. Have a look on my comments. On 7/21/22 15:22, 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 a

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

2022-07-22 Thread Steffen Eiden
On 7/21/22 15:22, Janosch Frank wrote: 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

Re: [PATCH v3 12/14] s390x: Introduce PV query interface

2022-07-22 Thread Steffen Eiden
On 7/21/22 15:22, Janosch Frank wrote: 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

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

2022-07-22 Thread Steffen Eiden
Hi Janosch, looks good to me. Have a look on my comments. On 7/21/22 15:22, Janosch Frank wrote: 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 +++