|
|
a83a9f |
From 0423b2a79991c6ae7aa65123e0d4f52294c006ee Mon Sep 17 00:00:00 2001
|
|
|
a83a9f |
From: Jon Maloy <jmaloy@redhat.com>
|
|
|
a83a9f |
Date: Wed, 18 Jan 2023 11:08:30 -0500
|
|
|
a83a9f |
Subject: [PATCH] target/i386/kvm: fix kvmclock_current_nsec: Assertion
|
|
|
a83a9f |
`time.tsc_timestamp <= migration_tsc' failed
|
|
|
a83a9f |
|
|
|
a83a9f |
RH-Author: Jon Maloy <jmaloy@redhat.com>
|
|
|
a83a9f |
RH-MergeRequest: 248: target/i386/kvm: fix kvmclock_current_nsec: Assertion `time.tsc_timestamp <= migration_tsc' failed
|
|
|
a83a9f |
RH-Bugzilla: 2134896
|
|
|
a83a9f |
RH-Acked-by: Miroslav Rezanina <mrezanin@redhat.com>
|
|
|
a83a9f |
RH-Acked-by: Vitaly Kuznetsov <vkuznets@redhat.com>
|
|
|
a83a9f |
RH-Acked-by: Paolo Bonzini <pbonzini@redhat.com>
|
|
|
a83a9f |
RH-Commit: [1/1] f7b46dad79581f7751a3f00a52d766207652e048 (redhat/rhel/src/qemu-kvm/jons-qemu-kvm-2)
|
|
|
a83a9f |
|
|
|
a83a9f |
Bugzilla: https://bugzilla.redhat.com/show_bug.cgi?id=2134896
|
|
|
a83a9f |
Upstream: Merged
|
|
|
a83a9f |
|
|
|
a83a9f |
commit c4ef867f2949bf2a2ae18a4e27cf1a34bbc8aecb
|
|
|
a83a9f |
Author: Ray Zhang <zhanglei002@gmail.com>
|
|
|
a83a9f |
Date: Thu Sep 22 18:05:23 2022 +0800
|
|
|
a83a9f |
|
|
|
a83a9f |
target/i386/kvm: fix kvmclock_current_nsec: Assertion `time.tsc_timestamp <= migration_tsc' failed
|
|
|
a83a9f |
|
|
|
a83a9f |
New KVM_CLOCK flags were added in the kernel.(c68dc1b577eabd5605c6c7c08f3e07ae18d30d5d)
|
|
|
a83a9f |
```
|
|
|
a83a9f |
+ #define KVM_CLOCK_VALID_FLAGS \
|
|
|
a83a9f |
+ (KVM_CLOCK_TSC_STABLE | KVM_CLOCK_REALTIME | KVM_CLOCK_HOST_TSC)
|
|
|
a83a9f |
|
|
|
a83a9f |
case KVM_CAP_ADJUST_CLOCK:
|
|
|
a83a9f |
- r = KVM_CLOCK_TSC_STABLE;
|
|
|
a83a9f |
+ r = KVM_CLOCK_VALID_FLAGS;
|
|
|
a83a9f |
```
|
|
|
a83a9f |
|
|
|
a83a9f |
kvm_has_adjust_clock_stable needs to handle additional flags,
|
|
|
a83a9f |
so that s->clock_is_reliable can be true and kvmclock_current_nsec doesn't need to be called.
|
|
|
a83a9f |
|
|
|
a83a9f |
Signed-off-by: Ray Zhang <zhanglei002@gmail.com>
|
|
|
a83a9f |
Message-Id: <20220922100523.2362205-1-zhanglei002@gmail.com>
|
|
|
a83a9f |
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
|
|
|
a83a9f |
|
|
|
a83a9f |
Signed-off-by: Jon Maloy <jmaloy@redhat.com>
|
|
|
a83a9f |
---
|
|
|
a83a9f |
target/i386/kvm/kvm.c | 2 +-
|
|
|
a83a9f |
1 file changed, 1 insertion(+), 1 deletion(-)
|
|
|
a83a9f |
|
|
|
a83a9f |
diff --git a/target/i386/kvm/kvm.c b/target/i386/kvm/kvm.c
|
|
|
a83a9f |
index ef70e2c85f..2c603df792 100644
|
|
|
a83a9f |
--- a/target/i386/kvm/kvm.c
|
|
|
a83a9f |
+++ b/target/i386/kvm/kvm.c
|
|
|
a83a9f |
@@ -153,7 +153,7 @@ bool kvm_has_adjust_clock_stable(void)
|
|
|
a83a9f |
{
|
|
|
a83a9f |
int ret = kvm_check_extension(kvm_state, KVM_CAP_ADJUST_CLOCK);
|
|
|
a83a9f |
|
|
|
a83a9f |
- return (ret == KVM_CLOCK_TSC_STABLE);
|
|
|
a83a9f |
+ return (ret & KVM_CLOCK_TSC_STABLE);
|
|
|
a83a9f |
}
|
|
|
a83a9f |
|
|
|
a83a9f |
bool kvm_has_adjust_clock(void)
|
|
|
a83a9f |
--
|
|
|
a83a9f |
2.31.1
|
|
|
a83a9f |
|