From mboxrd@z Thu Jan 1 00:00:00 1970 From: Avi Kivity Subject: Re: [PATCH] KVM: MMU: Don't read pdptrs with mmu spinlock held in mmu_alloc_roots Date: Mon, 10 May 2010 10:39:01 +0300 Message-ID: <4BE7B815.2050401@redhat.com> References: <1272967430-6191-1-git-send-email-avi@redhat.com> <20100506191055.GB3432@amt.cnet> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: kvm@vger.kernel.org, Joerg Roedel To: Marcelo Tosatti Return-path: Received: from mx1.redhat.com ([209.132.183.28]:17623 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755362Ab0EJHjE (ORCPT ); Mon, 10 May 2010 03:39:04 -0400 In-Reply-To: <20100506191055.GB3432@amt.cnet> Sender: kvm-owner@vger.kernel.org List-ID: On 05/06/2010 10:10 PM, Marcelo Tosatti wrote: > On Tue, May 04, 2010 at 01:03:50PM +0300, Avi Kivity wrote: > >> On svm, kvm_read_pdptr() may require reading guest memory, which can sleep. >> >> Push the spinlock into mmu_alloc_roots(), and only take it after we've read >> the pdptr. >> >> Marcelo, dropping and re-acquiring the lock before mmu_sync_roots(), is fine, >> yes? >> > Yes, but you should call kvm_mmu_free_some_pages after reacquiring the > spin_lock, to guarantee kvm_mmu_alloc_page won't fail. > > We never fail due to lack of free pages (but I agree it's cleaner). The patch is already in, I'll send an incremental. -- error compiling committee.c: too many arguments to function