From mboxrd@z Thu Jan 1 00:00:00 1970 From: Jan Kiszka Subject: Re: [PATCH] x86: kvmclock: Do not setup kvmclock vsyscall in the absence of that clock Date: Sun, 07 Apr 2013 13:33:05 +0200 Message-ID: <51615971.9050604@web.de> References: <5128E8C9.1050000@web.de> <20130227111955.GC23616@redhat.com> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="----enig2FHWXMXHPVCKUGOGNQIAE" Cc: Marcelo Tosatti , kvm To: Gleb Natapov Return-path: Received: from mout.web.de ([212.227.15.3]:57441 "EHLO mout.web.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932975Ab3DGLdK (ORCPT ); Sun, 7 Apr 2013 07:33:10 -0400 In-Reply-To: <20130227111955.GC23616@redhat.com> Sender: kvm-owner@vger.kernel.org List-ID: This is an OpenPGP/MIME signed message (RFC 4880 and 3156) ------enig2FHWXMXHPVCKUGOGNQIAE Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable On 2013-02-27 12:19, Gleb Natapov wrote: > On Sat, Feb 23, 2013 at 05:05:29PM +0100, Jan Kiszka wrote: >> From: Jan Kiszka >> >> This fixes boot lockups with "no-kvmclock", when the host is not >> exposing this particular feature (QEMU: -cpu ...,-kvmclock) or when >> the kvmclock initialization failed for whatever reason. >> >> Signed-off-by: Jan Kiszka > Applied, thanks. Just noticed that this fix isn't in Linus tree yet, thus also not yet in 3.8.y. Which route does it take? Jan >=20 >> --- >> >> Should go to 3.8 as well, I presume. >> >> arch/x86/kernel/kvmclock.c | 9 ++++++++- >> 1 files changed, 8 insertions(+), 1 deletions(-) >> >> diff --git a/arch/x86/kernel/kvmclock.c b/arch/x86/kernel/kvmclock.c >> index 5bedbdd..b730efa 100644 >> --- a/arch/x86/kernel/kvmclock.c >> +++ b/arch/x86/kernel/kvmclock.c >> @@ -160,8 +160,12 @@ int kvm_register_clock(char *txt) >> { >> int cpu =3D smp_processor_id(); >> int low, high, ret; >> - struct pvclock_vcpu_time_info *src =3D &hv_clock[cpu].pvti; >> + struct pvclock_vcpu_time_info *src; >> + >> + if (!hv_clock) >> + return 0; >> =20 >> + src =3D &hv_clock[cpu].pvti; >> low =3D (int)__pa(src) | 1; >> high =3D ((u64)__pa(src) >> 32); >> ret =3D native_write_msr_safe(msr_kvm_system_time, low, high); >> @@ -276,6 +280,9 @@ int __init kvm_setup_vsyscall_timeinfo(void) >> struct pvclock_vcpu_time_info *vcpu_time; >> unsigned int size; >> =20 >> + if (!hv_clock) >> + return 0; >> + >> size =3D PAGE_ALIGN(sizeof(struct pvclock_vsyscall_time_info)*NR_CPU= S); >> =20 >> preempt_disable(); >> --=20 >> 1.7.3.4 >> ------enig2FHWXMXHPVCKUGOGNQIAE 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.16 (GNU/Linux) Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/ iEYEARECAAYFAlFhWXQACgkQitSsb3rl5xRDIgCfaGIrbu93ZC6LMo4I4F91G+E8 CF0AnjSbKlaBfiwOrLpNcDvGlOgj5r/n =P3HD -----END PGP SIGNATURE----- ------enig2FHWXMXHPVCKUGOGNQIAE--