From afd495b34255e99eb11848d2d88f6aab7063b0bd Mon Sep 17 00:00:00 2001 From: Jon Maloy Date: Thu, 13 Oct 2022 15:41:45 +0000 Subject: [PATCH] * Thu Oct 13 2022 Jon Maloy - 7.1.0-3 - kvm-target-i386-kvm-fix-kvmclock_current_nsec-Assertion-.patch [bz#2108531] - Resolves: bz#2108531 (Windows guest reboot after migration with wsl2 installed inside) --- ...fix-kvmclock_current_nsec-Assertion-.patch | 60 +++++++++++++++++++ qemu-kvm.spec | 9 ++- 2 files changed, 68 insertions(+), 1 deletion(-) create mode 100644 kvm-target-i386-kvm-fix-kvmclock_current_nsec-Assertion-.patch diff --git a/kvm-target-i386-kvm-fix-kvmclock_current_nsec-Assertion-.patch b/kvm-target-i386-kvm-fix-kvmclock_current_nsec-Assertion-.patch new file mode 100644 index 0000000..e849747 --- /dev/null +++ b/kvm-target-i386-kvm-fix-kvmclock_current_nsec-Assertion-.patch @@ -0,0 +1,60 @@ +From f141182484fca38685cb246f77e311643cd2f4c7 Mon Sep 17 00:00:00 2001 +From: Vitaly Kuznetsov +Date: Fri, 7 Oct 2022 13:56:02 +0200 +Subject: [PATCH] target/i386/kvm: fix kvmclock_current_nsec: Assertion + `time.tsc_timestamp <= migration_tsc' failed + +RH-Author: Vitaly Kuznetsov +RH-MergeRequest: 120: target/i386/kvm: fix kvmclock_current_nsec: Assertion `time.tsc_timestamp <= migration_tsc' failed +RH-Bugzilla: 2108531 +RH-Acked-by: Marcelo Tosatti +RH-Acked-by: Emanuele Giuseppe Esposito +RH-Acked-by: Paolo Bonzini +RH-Commit: [1/1] edc5bb2578f7f31ab4d87e343925f6f08e812c29 (vkuznets/qemu-kvm-c9s) + +Bugzilla: https://bugzilla.redhat.com/show_bug.cgi?id=2108531 + +commit c4ef867f2949bf2a2ae18a4e27cf1a34bbc8aecb +Author: Ray Zhang +Date: Thu Sep 22 18:05:23 2022 +0800 + + target/i386/kvm: fix kvmclock_current_nsec: Assertion `time.tsc_timestamp <= migration_tsc' failed + + New KVM_CLOCK flags were added in the kernel.(c68dc1b577eabd5605c6c7c08f3e07ae18d30d5d) + ``` + + #define KVM_CLOCK_VALID_FLAGS \ + + (KVM_CLOCK_TSC_STABLE | KVM_CLOCK_REALTIME | KVM_CLOCK_HOST_TSC) + + case KVM_CAP_ADJUST_CLOCK: + - r = KVM_CLOCK_TSC_STABLE; + + r = KVM_CLOCK_VALID_FLAGS; + ``` + + kvm_has_adjust_clock_stable needs to handle additional flags, + so that s->clock_is_reliable can be true and kvmclock_current_nsec doesn't need to be called. + + Signed-off-by: Ray Zhang + Message-Id: <20220922100523.2362205-1-zhanglei002@gmail.com> + Signed-off-by: Paolo Bonzini + +Signed-off-by: Vitaly Kuznetsov +--- + target/i386/kvm/kvm.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/target/i386/kvm/kvm.c b/target/i386/kvm/kvm.c +index a9eba247a5..ba98b99d8f 100644 +--- a/target/i386/kvm/kvm.c ++++ b/target/i386/kvm/kvm.c +@@ -157,7 +157,7 @@ bool kvm_has_adjust_clock_stable(void) + { + int ret = kvm_check_extension(kvm_state, KVM_CAP_ADJUST_CLOCK); + +- return (ret == KVM_CLOCK_TSC_STABLE); ++ return (ret & KVM_CLOCK_TSC_STABLE); + } + + bool kvm_has_adjust_clock(void) +-- +2.37.3 + diff --git a/qemu-kvm.spec b/qemu-kvm.spec index 138d06d..87c6f31 100644 --- a/qemu-kvm.spec +++ b/qemu-kvm.spec @@ -151,7 +151,7 @@ Obsoletes: %{name}-block-ssh <= %{epoch}:%{version} \ Summary: QEMU is a machine emulator and virtualizer Name: qemu-kvm Version: 7.1.0 -Release: 2%{?rcrel}%{?dist}%{?cc_suffix} +Release: 3%{?rcrel}%{?dist}%{?cc_suffix} # Epoch because we pushed a qemu-1.0 package. AIUI this can't ever be dropped # Epoch 15 used for RHEL 8 # Epoch 17 used for RHEL 9 (due to release versioning offset in RHEL 8.5) @@ -247,6 +247,8 @@ Patch44: kvm-i386-reset-KVM-nested-state-upon-CPU-reset.patch Patch45: kvm-i386-do-kvm_put_msr_feature_control-first-thing-when.patch # For bz#2127825 - Use capstone for qemu-kvm build Patch46: kvm-Revert-Re-enable-capstone-internal-build.patch +# For bz#2108531 - Windows guest reboot after migration with wsl2 installed inside +Patch47: kvm-target-i386-kvm-fix-kvmclock_current_nsec-Assertion-.patch %if %{have_clang} BuildRequires: clang @@ -1279,6 +1281,11 @@ useradd -r -u 107 -g qemu -G kvm -d / -s /sbin/nologin \ %endif %changelog +* Thu Oct 13 2022 Jon Maloy - 7.1.0-3 +- kvm-target-i386-kvm-fix-kvmclock_current_nsec-Assertion-.patch [bz#2108531] +- Resolves: bz#2108531 + (Windows guest reboot after migration with wsl2 installed inside) + * Thu Sep 29 2022 Miroslav Rezanina - 7.1.0-2 - kvm-vdpa-Skip-the-maps-not-in-the-iova-tree.patch [RHELX-57] - kvm-vdpa-do-not-save-failed-dma-maps-in-SVQ-iova-tree.patch [RHELX-57]