From mboxrd@z Thu Jan 1 00:00:00 1970 From: Avi Kivity Subject: Re: [PATCH] KVM: PPC: Book3S HV: Drop locks around call to kvmppc_pin_guest_page Date: Tue, 19 Jun 2012 15:04:48 +0300 Message-ID: <4FE06AE0.2000106@redhat.com> References: <20120601102024.GB11714@pale.ozlabs.ibm.com> <4FCF4D0B.9040309@redhat.com> <4FCF7CCE.70308@suse.de> <5D3A1EC1-6772-4363-B439-BD1A70548829@suse.de> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Cc: Paul Mackerras , kvm-ppc@vger.kernel.org, kvm@vger.kernel.org To: Alexander Graf Return-path: In-Reply-To: <5D3A1EC1-6772-4363-B439-BD1A70548829@suse.de> Sender: kvm-ppc-owner@vger.kernel.org List-Id: kvm.vger.kernel.org On 06/19/2012 01:50 PM, Alexander Graf wrote: > > On 06.06.2012, at 17:52, Alexander Graf wrote: > >> On 06/06/2012 02:28 PM, Avi Kivity wrote: >>> On 06/01/2012 01:20 PM, Paul Mackerras wrote: >>>> At the moment we call kvmppc_pin_guest_page() in kvmppc_update_vpa() >>>> with two spinlocks held: the vcore lock and the vcpu->vpa_update_lock. >>>> This is not good, since kvmppc_pin_guest_page() calls down_read() and >>>> get_user_pages_fast(), both of which can sleep. This bug was introduced >>>> in 2e25aa5f ("KVM: PPC: Book3S HV: Make virtual processor area >>>> registration more robust"). >>>> >>>> This arranges to drop those spinlocks before calling >>>> kvmppc_pin_guest_page() and re-take them afterwards. Dropping the >>>> vcore lock in kvmppc_run_core() means we have to set the vcore_state >>>> field to VCORE_RUNNING before we drop the lock, so that other vcpus >>>> won't try to run this vcore. >>>> >>>> Signed-off-by: Paul Mackerras >>>> --- >>>> Since this bug is in Linus' tree, and it can cause a scheduling while >>>> atomic bug message, can we send this to Linus for inclusion in 3.5, >>>> after review of course? >>>> >>> Sure, Alex? >> >> Yup, reviewed and tested. Looks ready to go into the tree to me. Can you pull it in the short way please? > > Avi? Sorry! Applied to master, will push upstream shortly. -- error compiling committee.c: too many arguments to function