From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1NkR8F-0004wS-60 for qemu-devel@nongnu.org; Wed, 24 Feb 2010 18:59:07 -0500 Received: from [199.232.76.173] (port=60934 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NkR8E-0004w3-Fr for qemu-devel@nongnu.org; Wed, 24 Feb 2010 18:59:06 -0500 Received: from Debian-exim by monty-python.gnu.org with spam-scanned (Exim 4.60) (envelope-from ) id 1NkR8C-000358-Nc for qemu-devel@nongnu.org; Wed, 24 Feb 2010 18:59:06 -0500 Received: from fmmailgate03.web.de ([217.72.192.234]:44876) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1NkR8C-000352-7t for qemu-devel@nongnu.org; Wed, 24 Feb 2010 18:59:04 -0500 Message-ID: <4B85BD22.6050209@web.de> Date: Thu, 25 Feb 2010 00:58:26 +0100 From: Jan Kiszka MIME-Version: 1.0 References: <20100224231708.GB16246@amt.cnet> <4B85BA33.5080008@web.de> <20100224234935.GA17862@amt.cnet> In-Reply-To: <20100224234935.GA17862@amt.cnet> Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="------------enig2641DC7DDCBFDDF88047EAB3" Sender: jan.kiszka@web.de Subject: [Qemu-devel] Re: [PATCH v3 07/10] qemu-kvm: Cleanup/fix TSC and PV clock writeback List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Marcelo Tosatti Cc: Gleb Natapov , Zachary Amsden , Avi Kivity , kvm@vger.kernel.org, qemu-devel@nongnu.org This is an OpenPGP/MIME signed message (RFC 2440 and 3156) --------------enig2641DC7DDCBFDDF88047EAB3 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Marcelo Tosatti wrote: > On Thu, Feb 25, 2010 at 12:45:55AM +0100, Jan Kiszka wrote: >> Marcelo Tosatti wrote: >>> On Wed, Feb 24, 2010 at 03:17:55PM +0100, Jan Kiszka wrote: >>>> Drop kvm_load_tsc in favor of level-dependent writeback in >>>> kvm_arch_load_regs. KVM's PV clock MSRs fall in the same category an= d >>>> should therefore only be written back on full sync. >>>> >>>> Signed-off-by: Jan Kiszka >>>> --- >>>> qemu-kvm-x86.c | 19 +++++-------------- >>>> qemu-kvm.h | 4 ---- >>>> target-i386/machine.c | 5 ----- >>>> 3 files changed, 5 insertions(+), 23 deletions(-) >>>> >>>> diff --git a/qemu-kvm-x86.c b/qemu-kvm-x86.c >>>> index 840c1c9..84fd7fa 100644 >>>> --- a/qemu-kvm-x86.c >>>> +++ b/qemu-kvm-x86.c >>>> @@ -965,8 +965,11 @@ void kvm_arch_load_regs(CPUState *env, int leve= l) >>>> set_msr_entry(&msrs[n++], MSR_LSTAR , env->lstar= ); >>>> } >>>> #endif >>>> - set_msr_entry(&msrs[n++], MSR_KVM_SYSTEM_TIME, env->system_tim= e_msr); >>>> - set_msr_entry(&msrs[n++], MSR_KVM_WALL_CLOCK, env->wall_clock_= msr); >>>> + if (level =3D=3D KVM_PUT_FULL_STATE) { >>>> + set_msr_entry(&msrs[n++], MSR_IA32_TSC, env->tsc); >>>> + set_msr_entry(&msrs[n++], MSR_KVM_SYSTEM_TIME, env->system_= time_msr); >>>> + set_msr_entry(&msrs[n++], MSR_KVM_WALL_CLOCK, env->wall_clo= ck_msr); >>>> + } >>> As things stand today, the TSC should only be written on migration. S= ee >>> 53f658b3c33616a4997ee254311b335e59063289 in the kernel. >> Migration and power-up - that's what this patch ensures (=3D> >> KVM_PUT_FULL_STATE). Or where do you see any problem? >> >> Jan >> >=20 > The problem is it should not write on power up (the kernel attempts > to synchronize the TSCs in that case, see the commit). >=20 OK, need to read this more carefully. I do not yet understand the difference from user space POV: it tries to transfer the identical TSC values to all currently stopped VCPU threads. That should not be different if we are booting a fresh VM or loading a complete state of a migrated image. If it does, it looks like a KVM kernel deficit on first glance. Jan --------------enig2641DC7DDCBFDDF88047EAB3 Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.9 (GNU/Linux) Comment: Using GnuPG with SUSE - http://enigmail.mozdev.org iEYEARECAAYFAkuFvSIACgkQitSsb3rl5xSmwgCg4aB+fJB8mfWliXSq8TEb364K bskAoIn4ojGfh+Q5z6O9nSDtTpx36Cxg =ZKO6 -----END PGP SIGNATURE----- --------------enig2641DC7DDCBFDDF88047EAB3--