summaryrefslogtreecommitdiffstats
path: root/target
diff options
context:
space:
mode:
authorRay Zhang2022-09-22 12:05:23 +0200
committerPaolo Bonzini2022-10-01 21:16:36 +0200
commitc4ef867f2949bf2a2ae18a4e27cf1a34bbc8aecb (patch)
tree5600ff37507bb73f734e5a550ce2a0989e213bba /target
parentconfigure, meson: move linker flag detection to meson (diff)
downloadqemu-c4ef867f2949bf2a2ae18a4e27cf1a34bbc8aecb.tar.gz
qemu-c4ef867f2949bf2a2ae18a4e27cf1a34bbc8aecb.tar.xz
qemu-c4ef867f2949bf2a2ae18a4e27cf1a34bbc8aecb.zip
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 <zhanglei002@gmail.com> Message-Id: <20220922100523.2362205-1-zhanglei002@gmail.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Diffstat (limited to 'target')
-rw-r--r--target/i386/kvm/kvm.c2
1 files changed, 1 insertions, 1 deletions
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)