From mboxrd@z Thu Jan 1 00:00:00 1970 From: Paolo Bonzini Subject: Re: [PATCHv1] kvm guest: fix uninitialized kvmclock read by KVM guest Date: Thu, 20 Jun 2013 10:35:36 +0200 Message-ID: <51C2BED8.2060902@redhat.com> References: <20130610201933.GA31409@amt.cnet> <1371319305-590-1-git-send-email-ebatalov@parallels.com> <20130618222114.GC13856@amt.cnet> <51C1AC93.6010001@redhat.com> <51C1B23B.7080703@redhat.com> <20130620103004.4aa39c47@nial.usersys.redhat.com> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Cc: Batalov Eugene , Marcelo Tosatti , Eugene Batalov , kvm@vger.kernel.org, linux-kernel@vger.kernel.org To: Igor Mammedov Return-path: In-Reply-To: <20130620103004.4aa39c47@nial.usersys.redhat.com> Sender: linux-kernel-owner@vger.kernel.org List-Id: kvm.vger.kernel.org Il 20/06/2013 10:30, Igor Mammedov ha scritto: > On Wed, 19 Jun 2013 15:29:31 +0200 > Paolo Bonzini wrote: > >> Il 19/06/2013 15:20, Batalov Eugene ha scritto: >>> >>> I've missed this detail. It looks like Igor's patch doesn't bring >>> secondary cpus kvm_clocksource behavior back to one before the regression, >>> Before the regression per_cpu variables are used to allocate >>> kvm_pv_clock areas. >>> To to usage of percpu variables bootstrap cpu kvm_clock area contents >>> were copied to smp secondary cpus kvm_clock areas when they were started. >>> Bootstrap cpu kvm_clock area was not zeroed at this time. >>> So kvm_pv_clock for secondary cpus never returned "zero" clock before >>> the regression. >>> >>> During the analysis of the bug I introduced idea to return zero before >>> kvm clocksource is initialized for secondary cpus >>> just like bootstrap cpu does on kernel boot. You can read that in BZ. >> >> Yes, this is why I prefer to invert the two function calls. But Igor's >> patch fixes the hang (trivially because version is even) and is more >> appropriate for -rc6. > > I'll post this swap shortly, but zeroing out hv_clock at init time, > would be still needed to provide sane values there if ftrace enabled > at that time. Fine! Please mention it (with --verbose flag) in the commit message. Paolo