qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Paolo Bonzini <pbonzini@redhat.com>
To: qemu-devel@nongnu.org
Cc: Jim Somerville <Jim.Somerville@windriver.com>, qemu-stable@nongnu.org
Subject: [Qemu-devel] [PULL 6/6] kvmclock: use the updated system_timer_msr
Date: Tue,  3 Oct 2017 12:28:41 +0200	[thread overview]
Message-ID: <1507026521-19230-7-git-send-email-pbonzini@redhat.com> (raw)
In-Reply-To: <1507026521-19230-1-git-send-email-pbonzini@redhat.com>

From: Jim Somerville <Jim.Somerville@windriver.com>

Fixes e2b6c17 (kvmclock: update system_time_msr address forcibly)
which makes a call to get the latest value of the address
stored in system_timer_msr, but then uses the old address anyway.

Signed-off-by: Jim Somerville <Jim.Somerville@windriver.com>
Message-Id: <59b67db0bd15a46ab47c3aa657c81a4c11f168ea.1506702472.git.Jim.Somerville@windriver.com>
Cc: qemu-stable@nongnu.org
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
---
 hw/i386/kvm/clock.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/hw/i386/kvm/clock.c b/hw/i386/kvm/clock.c
index 75ad1ba..1707434 100644
--- a/hw/i386/kvm/clock.c
+++ b/hw/i386/kvm/clock.c
@@ -62,7 +62,7 @@ static uint64_t kvmclock_current_nsec(KVMClockState *s)
 {
     CPUState *cpu = first_cpu;
     CPUX86State *env = cpu->env_ptr;
-    hwaddr kvmclock_struct_pa = env->system_time_msr & ~1ULL;
+    hwaddr kvmclock_struct_pa;
     uint64_t migration_tsc = env->tsc;
     struct pvclock_vcpu_time_info time;
     uint64_t delta;
@@ -77,6 +77,7 @@ static uint64_t kvmclock_current_nsec(KVMClockState *s)
         return 0;
     }
 
+    kvmclock_struct_pa = env->system_time_msr & ~1ULL;
     cpu_physical_memory_read(kvmclock_struct_pa, &time, sizeof(time));
 
     assert(time.tsc_timestamp <= migration_tsc);
-- 
1.8.3.1

  parent reply	other threads:[~2017-10-03 10:32 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-10-03 10:28 [Qemu-devel] [PULL 0/6] Misc patches for 2017-10-03 Paolo Bonzini
2017-10-03 10:28 ` [Qemu-devel] [PULL 1/6] scsi: Ignore executable for in-tree builds Paolo Bonzini
2017-10-03 10:28 ` [Qemu-devel] [PULL 2/6] iothread: Make iothread_stop() idempotent Paolo Bonzini
2017-10-03 10:28 ` [Qemu-devel] [PULL 3/6] linux-headers: sync against v4.14-rc1 Paolo Bonzini
2017-10-03 10:28 ` [Qemu-devel] [PULL 4/6] kvm: check KVM_CAP_SYNC_MMU with kvm_vm_check_extension() Paolo Bonzini
2017-10-03 10:28 ` [Qemu-devel] [PULL 5/6] kvm: check KVM_CAP_NR_VCPUS " Paolo Bonzini
2017-10-03 10:28 ` Paolo Bonzini [this message]
2017-10-03 16:42 ` [Qemu-devel] [PULL 0/6] Misc patches for 2017-10-03 Peter Maydell

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1507026521-19230-7-git-send-email-pbonzini@redhat.com \
    --to=pbonzini@redhat.com \
    --cc=Jim.Somerville@windriver.com \
    --cc=qemu-devel@nongnu.org \
    --cc=qemu-stable@nongnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).