From mboxrd@z Thu Jan 1 00:00:00 1970 From: Andrea Arcangeli Subject: Re: KVM swapping with mmu notifiers Date: Mon, 14 Jan 2008 15:06:52 +0100 Message-ID: <20080114140652.GD7062@v2.random> References: <20080113133244.GC8736@v2.random> <20080114134539.GB15200@dmt> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Cc: kvm-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org To: Marcelo Tosatti Return-path: Content-Disposition: inline In-Reply-To: <20080114134539.GB15200@dmt> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: kvm-devel-bounces-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org Errors-To: kvm-devel-bounces-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org List-Id: kvm.vger.kernel.org On Mon, Jan 14, 2008 at 11:45:39AM -0200, Marcelo Tosatti wrote: > The alias and memslot maps are protected only by mmap_sem, so you yes, they are already protected and furthermore in write mode. > should make kvm_set_memory_region/set_memory_alias grab the mmu spinlock > in addition to mmap_sem in write mode. The mmu notifiers already hold the mmap_sem in read mode so I don't see why I should add the mmu_lock around memslots. The mmu_lock AFAICS is only needed to serialize with other vcpu fautls when updating the sptes and I already take it there. > And then you also need to cover "hva_to_gfn()" to happen under the lock. hva_to_gfn only requires the mmap_sem in read mode and that's already taken implicitly before the mmu notifiers are called. ------------------------------------------------------------------------- Check out the new SourceForge.net Marketplace. It's the best place to buy or sell services for just about anything Open Source. http://ad.doubleclick.net/clk;164216239;13503038;w?http://sf.net/marketplace