From nobody Wed May 1 22:22:43 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@gnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@gnu.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 1506948153597800.2996224067068; Mon, 2 Oct 2017 05:42:33 -0700 (PDT) Received: from localhost ([::1]:52108 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dz03M-00023h-Sc for importer@patchew.org; Mon, 02 Oct 2017 08:42:32 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:41456) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dz01V-00014h-H5 for qemu-devel@nongnu.org; Mon, 02 Oct 2017 08:40:39 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dz01R-0007RK-6M for qemu-devel@nongnu.org; Mon, 02 Oct 2017 08:40:37 -0400 Received: from mx1.redhat.com ([209.132.183.28]:47658) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1dz01Q-0007Qi-WE; Mon, 02 Oct 2017 08:40:33 -0400 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 015B5C058EA2; Mon, 2 Oct 2017 12:40:32 +0000 (UTC) Received: from donizetti.redhat.com (unknown [10.36.118.50]) by smtp.corp.redhat.com (Postfix) with ESMTP id 12EC59081A; Mon, 2 Oct 2017 12:40:29 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com 015B5C058EA2 Authentication-Results: ext-mx08.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com Authentication-Results: ext-mx08.extmail.prod.ext.phx2.redhat.com; spf=fail smtp.mailfrom=pbonzini@redhat.com From: Paolo Bonzini To: qemu-devel@nongnu.org Date: Mon, 2 Oct 2017 14:40:29 +0200 Message-Id: <20171002124029.17407-1-pbonzini@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.32]); Mon, 02 Oct 2017 12:40:32 +0000 (UTC) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 209.132.183.28 Subject: [Qemu-devel] [PATCH] kvmclock: use the updated system_timer_msr X-BeenThere: qemu-devel@gnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Jim Somerville , qemu-stable@nongnu.org Errors-To: qemu-devel-bounces+importer=patchew.org@gnu.org Sender: "Qemu-devel" X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" From: Jim Somerville 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 Message-Id: <59b67db0bd15a46ab47c3aa657c81a4c11f168ea.1506702472.git.Jim.So= merville@windriver.com> Cc: qemu-stable@nongnu.org Signed-off-by: Paolo Bonzini --- 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 75ad1ba6f0..1707434db3 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 =3D first_cpu; CPUX86State *env =3D cpu->env_ptr; - hwaddr kvmclock_struct_pa =3D env->system_time_msr & ~1ULL; + hwaddr kvmclock_struct_pa; uint64_t migration_tsc =3D 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; } =20 + kvmclock_struct_pa =3D env->system_time_msr & ~1ULL; cpu_physical_memory_read(kvmclock_struct_pa, &time, sizeof(time)); =20 assert(time.tsc_timestamp <=3D migration_tsc); --=20 2.13.6