From mboxrd@z Thu Jan 1 00:00:00 1970 From: Radim =?utf-8?B?S3LEjW3DocWZ?= Subject: Re: x86: kvm: Revert "remove sched notifier for cross-cpu migrations" Date: Wed, 25 Mar 2015 14:06:07 +0100 Message-ID: <20150325130606.GD21710@potion.brq.redhat.com> References: <20150323232151.GA12772@amt.cnet> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: QUOTED-PRINTABLE Cc: kvm-devel , stable@vger.kernel.org, Paolo Bonzini , Andy Lutomirski To: Marcelo Tosatti Return-path: Content-Disposition: inline In-Reply-To: <20150323232151.GA12772@amt.cnet> Sender: stable-owner@vger.kernel.org List-Id: kvm.vger.kernel.org 2015-03-23 20:21-0300, Marcelo Tosatti: > The following point: >=20 > 2. per-CPU pvclock time info is updated if the > underlying CPU changes. >=20 > Is not true anymore since "KVM: x86: update pvclock area conditionall= y, > on cpu migration". >=20 > Add task migration notification back. >=20 > Problem noticed by Andy Lutomirski. >=20 > Signed-off-by: Marcelo Tosatti > CC: stable@kernel.org # 3.11+ Please improve the commit message. "KVM: x86: update pvclock area conditionally [...]" was merged half a year before the patch we are reverting and is completely unrelated to the bug we are fixing now, (reverted patch just was just wrong) Reviewed-by: Radim Kr=C4=8Dm=C3=A1=C5=99 > diff --git a/arch/x86/vdso/vclock_gettime.c b/arch/x86/vdso/vclock_ge= ttime.c > @@ -82,18 +82,15 @@ static notrace cycle_t vread_pvclock(int *mode) > /* > - * Note: hypervisor must guarantee that: > - * 1. cpu ID number maps 1:1 to per-CPU pvclock time info. > - * 2. that per-CPU pvclock time info is updated if the > - * underlying CPU changes. > - * 3. that version is increased whenever underlying CPU > - * changes. > - * > + * When looping to get a consistent (time-info, tsc) pair, we > + * also need to deal with the possibility we can switch vcpus, > + * so make sure we always re-fetch time-info for the current vcpu. (All points from the original comment need to hold -- it would be nicer to keep both.)