[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PULL 13/14] target/i386/kvm: fix kvmclock_current_nsec: Assertion `time
From: |
Paolo Bonzini |
Subject: |
[PULL 13/14] target/i386/kvm: fix kvmclock_current_nsec: Assertion `time.tsc_timestamp <= migration_tsc' failed |
Date: |
Thu, 29 Sep 2022 18:30:13 +0200 |
From: Ray Zhang <zhanglei002@gmail.com>
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 <zhanglei002@gmail.com>
Message-Id: <20220922100523.2362205-1-zhanglei002@gmail.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
---
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 a1fd1f5379..9eeee91c2f 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
- [PULL 07/14] watchdog: remove -watchdog option, (continued)
- [PULL 07/14] watchdog: remove -watchdog option, Paolo Bonzini, 2022/09/29
- [PULL 05/14] qboot: rebuild based on latest commit, Paolo Bonzini, 2022/09/29
- [PULL 02/14] x86: use typedef for SetupData struct, Paolo Bonzini, 2022/09/29
- [PULL 03/14] x86: reinitialize RNG seed on system reboot, Paolo Bonzini, 2022/09/29
- [PULL 08/14] ui: fix path to dbus-display1.h, Paolo Bonzini, 2022/09/29
- [PULL 04/14] x86: re-enable rng seeding via SetupData, Paolo Bonzini, 2022/09/29
- [PULL 09/14] meson: require 0.61.3, Paolo Bonzini, 2022/09/29
- [PULL 10/14] meson: multiple names can be passed to dependency(), Paolo Bonzini, 2022/09/29
- [PULL 11/14] configure, meson: move C++ compiler detection to meson.build, Paolo Bonzini, 2022/09/29
- [PULL 12/14] configure, meson: move linker flag detection to meson, Paolo Bonzini, 2022/09/29
- [PULL 13/14] target/i386/kvm: fix kvmclock_current_nsec: Assertion `time.tsc_timestamp <= migration_tsc' failed,
Paolo Bonzini <=
- [PULL 14/14] x86: re-initialize RNG seed when selecting kernel, Paolo Bonzini, 2022/09/29
- Re: [PULL 00/14] x86 + misc changes for 2022-09-29, Stefan Hajnoczi, 2022/09/29