From a32e67a8e73a9803991a0c84159f2473669d50bf Mon Sep 17 00:00:00 2001 From: Miroslav Rezanina Date: Thu, 23 Nov 2023 03:46:38 -0500 Subject: [PATCH] * Thu Nov 23 2023 Miroslav Rezanina - 6.2.0-42 - kvm-target-s390x-dump-Remove-unneeded-dump-info-function.patch [RHEL-16696] - kvm-dump-Add-arch-cleanup-function.patch [RHEL-16696] - kvm-target-s390x-arch_dump-Add-arch-cleanup-function-for.patch [RHEL-16696] - Resolves: RHEL-16696 (RHEL8 - KVM : Secure execution guest remains in "paused" state, post "virsh dump" failure (qemu-kvm)) --- kvm-dump-Add-arch-cleanup-function.patch | 69 +++++++++++++++ ...h_dump-Add-arch-cleanup-function-for.patch | 84 +++++++++++++++++++ ...p-Remove-unneeded-dump-info-function.patch | 56 +++++++++++++ qemu-kvm.spec | 15 +++- 4 files changed, 223 insertions(+), 1 deletion(-) create mode 100644 kvm-dump-Add-arch-cleanup-function.patch create mode 100644 kvm-target-s390x-arch_dump-Add-arch-cleanup-function-for.patch create mode 100644 kvm-target-s390x-dump-Remove-unneeded-dump-info-function.patch diff --git a/kvm-dump-Add-arch-cleanup-function.patch b/kvm-dump-Add-arch-cleanup-function.patch new file mode 100644 index 0000000..ace908b --- /dev/null +++ b/kvm-dump-Add-arch-cleanup-function.patch @@ -0,0 +1,69 @@ +From 837e09b1a8a38b53488f59aad090fbe6bb94e257 Mon Sep 17 00:00:00 2001 +From: Thomas Huth +Date: Fri, 17 Nov 2023 11:32:37 +0100 +Subject: [PATCH 2/3] dump: Add arch cleanup function +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +RH-Author: Thomas Huth +RH-MergeRequest: 323: Fix problem that secure execution guest might remain in "paused" state after failed dump +RH-Jira: RHEL-16696 +RH-Acked-by: Marc-André Lureau +RH-Acked-by: Cédric Le Goater +RH-Commit: [2/3] b70f406dec88ffd4877f3d5d580fc8f821bdb252 + +JIRA: https://issues.redhat.com/browse/RHEL-16696 + +commit e72629e5149aba6f44122ea6d2a803ef136a0c6b +Author: Janosch Frank +Date: Thu Nov 9 12:04:42 2023 +0000 + + dump: Add arch cleanup function + + 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 + Reviewed-by: Thomas Huth + Reviewed-by: Marc-André Lureau + Message-ID: <20231109120443.185979-3-frankja@linux.ibm.com> + Signed-off-by: Thomas Huth + +Signed-off-by: Thomas Huth +--- + dump/dump.c | 4 ++++ + include/sysemu/dump-arch.h | 1 + + 2 files changed, 5 insertions(+) + +diff --git a/dump/dump.c b/dump/dump.c +index 5dee060b73..93edb89547 100644 +--- a/dump/dump.c ++++ b/dump/dump.c +@@ -100,6 +100,10 @@ uint64_t cpu_to_dump64(DumpState *s, uint64_t val) + + static int dump_cleanup(DumpState *s) + { ++ if (s->dump_info.arch_cleanup_fn) { ++ s->dump_info.arch_cleanup_fn(s); ++ } ++ + guest_phys_blocks_free(&s->guest_phys_blocks); + memory_mapping_list_free(&s->list); + close(s->fd); +diff --git a/include/sysemu/dump-arch.h b/include/sysemu/dump-arch.h +index 59bbc9be38..743916e46c 100644 +--- a/include/sysemu/dump-arch.h ++++ b/include/sysemu/dump-arch.h +@@ -24,6 +24,7 @@ typedef struct ArchDumpInfo { + void (*arch_sections_add_fn)(DumpState *s); + uint64_t (*arch_sections_write_hdr_fn)(DumpState *s, uint8_t *buff); + int (*arch_sections_write_fn)(DumpState *s, uint8_t *buff); ++ void (*arch_cleanup_fn)(DumpState *s); + } ArchDumpInfo; + + struct GuestPhysBlockList; /* memory_mapping.h */ +-- +2.39.3 + diff --git a/kvm-target-s390x-arch_dump-Add-arch-cleanup-function-for.patch b/kvm-target-s390x-arch_dump-Add-arch-cleanup-function-for.patch new file mode 100644 index 0000000..0bbfe01 --- /dev/null +++ b/kvm-target-s390x-arch_dump-Add-arch-cleanup-function-for.patch @@ -0,0 +1,84 @@ +From 4aa08999f8502e9d6869352db89081319c2d7119 Mon Sep 17 00:00:00 2001 +From: Thomas Huth +Date: Fri, 17 Nov 2023 11:32:37 +0100 +Subject: [PATCH 3/3] target/s390x/arch_dump: Add arch cleanup function for PV + dumps +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +RH-Author: Thomas Huth +RH-MergeRequest: 323: Fix problem that secure execution guest might remain in "paused" state after failed dump +RH-Jira: RHEL-16696 +RH-Acked-by: Marc-André Lureau +RH-Acked-by: Cédric Le Goater +RH-Commit: [3/3] 0bb389c9339b95f7ff6dc284526b0c8d5ef736b4 + +JIRA: https://issues.redhat.com/browse/RHEL-16696 + +commit d12a91e0baafce7b1cbacff7cf9339eeb0011732 +Author: Janosch Frank +Date: Thu Nov 9 12:04:43 2023 +0000 + + target/s390x/arch_dump: Add arch cleanup function for PV dumps + + PV dumps block vcpu runs until dump end is reached. If there's an + error between PV dump init and PV dump end the vm will never be able + to run again. One example of such an error is insufficient disk space + for the dump file. + + Let's add a cleanup function that tries to do a dump end. 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 + Reviewed-by: Thomas Huth + Reviewed-by: Claudio Imbrenda + Reviewed-by: Marc-André Lureau + Message-ID: <20231109120443.185979-4-frankja@linux.ibm.com> + Signed-off-by: Thomas Huth + +Signed-off-by: Thomas Huth +--- + target/s390x/arch_dump.c | 17 +++++++++++++++++ + 1 file changed, 17 insertions(+) + +diff --git a/target/s390x/arch_dump.c b/target/s390x/arch_dump.c +index 7cdd4b7167..3b1f178dc3 100644 +--- a/target/s390x/arch_dump.c ++++ b/target/s390x/arch_dump.c +@@ -439,6 +439,22 @@ static int arch_sections_write(DumpState *s, uint8_t *buff) + return 0; + } + ++static void arch_cleanup(DumpState *s) ++{ ++ g_autofree uint8_t *buff = NULL; ++ int rc; ++ ++ if (!pv_dump_initialized) { ++ return; ++ } ++ ++ buff = g_malloc(kvm_s390_pv_dmp_get_size_completion_data()); ++ rc = kvm_s390_dump_completion_data(buff); ++ if (!rc) { ++ pv_dump_initialized = false; ++ } ++} ++ + int cpu_get_dump_info(ArchDumpInfo *info, + const struct GuestPhysBlockList *guest_phys_blocks) + { +@@ -454,6 +470,7 @@ int cpu_get_dump_info(ArchDumpInfo *info, + info->arch_sections_add_fn = *arch_sections_add; + info->arch_sections_write_hdr_fn = *arch_sections_write_hdr; + info->arch_sections_write_fn = *arch_sections_write; ++ info->arch_cleanup_fn = *arch_cleanup; + } + return 0; + } +-- +2.39.3 + diff --git a/kvm-target-s390x-dump-Remove-unneeded-dump-info-function.patch b/kvm-target-s390x-dump-Remove-unneeded-dump-info-function.patch new file mode 100644 index 0000000..dee0bfc --- /dev/null +++ b/kvm-target-s390x-dump-Remove-unneeded-dump-info-function.patch @@ -0,0 +1,56 @@ +From f647258696cbdce78316b2d9ae513f9ae6f4a0b5 Mon Sep 17 00:00:00 2001 +From: Thomas Huth +Date: Fri, 17 Nov 2023 11:32:37 +0100 +Subject: [PATCH 1/3] target/s390x/dump: Remove unneeded dump info function + pointer init +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +RH-Author: Thomas Huth +RH-MergeRequest: 323: Fix problem that secure execution guest might remain in "paused" state after failed dump +RH-Jira: RHEL-16696 +RH-Acked-by: Marc-André Lureau +RH-Acked-by: Cédric Le Goater +RH-Commit: [1/3] e3b0697ec76274f778fc523efb72f0cbca25cd77 + +JIRA: https://issues.redhat.com/browse/RHEL-16696 + +commit 816644b1219900875f47d7adf9bfb283f1b29aa0 +Author: Janosch Frank +Date: Thu Nov 9 12:04:41 2023 +0000 + + target/s390x/dump: Remove unneeded dump info function pointer init + + 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 + Reviewed-by: Thomas Huth + Message-ID: <20231109120443.185979-2-frankja@linux.ibm.com> + Signed-off-by: Thomas Huth + +Signed-off-by: Thomas Huth +--- + 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 a7c44ba49d..7cdd4b7167 100644 +--- a/target/s390x/arch_dump.c ++++ b/target/s390x/arch_dump.c +@@ -454,10 +454,6 @@ int cpu_get_dump_info(ArchDumpInfo *info, + info->arch_sections_add_fn = *arch_sections_add; + info->arch_sections_write_hdr_fn = *arch_sections_write_hdr; + info->arch_sections_write_fn = *arch_sections_write; +- } else { +- info->arch_sections_add_fn = NULL; +- info->arch_sections_write_hdr_fn = NULL; +- info->arch_sections_write_fn = NULL; + } + return 0; + } +-- +2.39.3 + diff --git a/qemu-kvm.spec b/qemu-kvm.spec index 03a9a82..0abc120 100644 --- a/qemu-kvm.spec +++ b/qemu-kvm.spec @@ -83,7 +83,7 @@ Obsoletes: %1-rhev <= %{epoch}:%{version}-%{release} Summary: QEMU is a machine emulator and virtualizer Name: qemu-kvm Version: 6.2.0 -Release: 41%{?rcrel}%{?dist} +Release: 42%{?rcrel}%{?dist} # Epoch because we pushed a qemu-1.0 package. AIUI this can't ever be dropped Epoch: 15 License: GPLv2 and GPLv2+ and CC-BY @@ -793,6 +793,12 @@ Patch315: kvm-redhat-Update-linux-headers-for-kvm_s390_vm_cpu_uv_f.patch Patch316: kvm-target-s390x-kvm-Refactor-AP-functionalities.patch # For bz#2111390 - [IBM 8.10 FEAT] KVM: Enable Secure Execution Crypto Passthrough - qemu part Patch317: kvm-target-s390x-AP-passthrough-for-PV-guests.patch +# For RHEL-16696 - RHEL8 - KVM : Secure execution guest remains in "paused" state, post "virsh dump" failure (qemu-kvm) +Patch318: kvm-target-s390x-dump-Remove-unneeded-dump-info-function.patch +# For RHEL-16696 - RHEL8 - KVM : Secure execution guest remains in "paused" state, post "virsh dump" failure (qemu-kvm) +Patch319: kvm-dump-Add-arch-cleanup-function.patch +# For RHEL-16696 - RHEL8 - KVM : Secure execution guest remains in "paused" state, post "virsh dump" failure (qemu-kvm) +Patch320: kvm-target-s390x-arch_dump-Add-arch-cleanup-function-for.patch BuildRequires: wget BuildRequires: rpm-build @@ -1962,6 +1968,13 @@ sh %{_sysconfdir}/sysconfig/modules/kvm.modules &> /dev/null || : %changelog +* Thu Nov 23 2023 Miroslav Rezanina - 6.2.0-42 +- kvm-target-s390x-dump-Remove-unneeded-dump-info-function.patch [RHEL-16696] +- kvm-dump-Add-arch-cleanup-function.patch [RHEL-16696] +- kvm-target-s390x-arch_dump-Add-arch-cleanup-function-for.patch [RHEL-16696] +- Resolves: RHEL-16696 + (RHEL8 - KVM : Secure execution guest remains in "paused" state, post "virsh dump" failure (qemu-kvm)) + * Fri Sep 29 2023 Jon Maloy - 6.2.0-41 - kvm-s390x-ap-fix-missing-subsystem-reset-registration.patch [bz#2111390] - kvm-s390x-do-a-subsystem-reset-before-the-unprotect-on-r.patch [bz#2111390]