yeahuh / rpms / qemu-kvm

Forked from rpms/qemu-kvm 2 years ago
Clone

Blame SOURCES/kvm-kvmclock-Ensure-proper-env-tsc-value-for-kvmclock.v2.patch

958e1b
From e055a194315471312ae2a1d8da4b69c3a5e545a5 Mon Sep 17 00:00:00 2001
958e1b
From: "Dr. David Alan Gilbert (git)" <dgilbert@redhat.com>
958e1b
Date: Wed, 22 Oct 2014 09:46:36 +0200
958e1b
Subject: [PATCH 5/6] kvmclock: Ensure proper env->tsc value for
958e1b
 kvmclock_current_nsec calculation
958e1b
MIME-Version: 1.0
958e1b
Content-Type: text/plain; charset=UTF-8
958e1b
Content-Transfer-Encoding: 8bit
958e1b
958e1b
Message-id: <1413971197-4624-5-git-send-email-dgilbert@redhat.com>
958e1b
Patchwork-id: 61790
958e1b
O-Subject: [RHEL-7.1 qemu-kvm PATCH 4/5] kvmclock: Ensure proper env->tsc value for kvmclock_current_nsec calculation
958e1b
Bugzilla: 1098602 1130428
958e1b
RH-Acked-by: Marcelo Tosatti <mtosatti@redhat.com>
958e1b
RH-Acked-by: Eduardo Habkost <ehabkost@redhat.com>
958e1b
RH-Acked-by: Paolo Bonzini <pbonzini@redhat.com>
958e1b
958e1b
From: Marcelo Tosatti <mtosatti@redhat.com>
958e1b
958e1b
Ensure proper env->tsc value for kvmclock_current_nsec calculation.
958e1b
958e1b
Reported-by: Marcin Gibuła <m.gibula@beyond.pl>
958e1b
Analyzed-by: Marcin Gibuła <m.gibula@beyond.pl>
958e1b
Cc: qemu-stable@nongnu.org
958e1b
Signed-off-by: Marcelo Tosatti <mtosatti@redhat.com>
958e1b
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
958e1b
(cherry picked from commit 317b0a6d8ba44e9bf8f9c3dbd776c4536843d82c)
958e1b
Signed-off-by: Miroslav Rezanina <mrezanin@redhat.com>
958e1b
---
958e1b
 hw/i386/kvm/clock.c | 4 ++++
958e1b
 1 file changed, 4 insertions(+)
958e1b
958e1b
diff --git a/hw/i386/kvm/clock.c b/hw/i386/kvm/clock.c
958e1b
index 6d6f3a7..53056d4 100644
958e1b
--- a/hw/i386/kvm/clock.c
958e1b
+++ b/hw/i386/kvm/clock.c
958e1b
@@ -16,6 +16,7 @@
958e1b
 #include "qemu-common.h"
958e1b
 #include "sysemu/sysemu.h"
958e1b
 #include "sysemu/kvm.h"
958e1b
+#include "sysemu/cpus.h"
958e1b
 #include "hw/sysbus.h"
958e1b
 #include "hw/kvm/clock.h"
958e1b
 
958e1b
@@ -69,6 +70,9 @@ static void kvmclock_vm_state_change(void *opaque, int running,
958e1b
         if (s->clock_valid) {
958e1b
             return;
958e1b
         }
958e1b
+
958e1b
+        cpu_synchronize_all_states();
958e1b
+        cpu_clean_all_dirty();
958e1b
         ret = kvm_vm_ioctl(kvm_state, KVM_GET_CLOCK, &data);
958e1b
         if (ret < 0) {
958e1b
             fprintf(stderr, "KVM_GET_CLOCK failed: %s\n", strerror(ret));
958e1b
-- 
958e1b
1.8.3.1
958e1b