From mboxrd@z Thu Jan 1 00:00:00 1970 From: Marcelo Tosatti Subject: Re: [PATCH] replace the slots lock from the mmap_sem to private kvm lock Date: Mon, 11 Feb 2008 15:08:12 -0200 Message-ID: <20080211170812.GA13173@dmt> References: <47B065EA.7010805@qumranet.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Cc: kvm-devel , Avi Kivity To: Izik Eidus Return-path: Content-Disposition: inline In-Reply-To: <47B065EA.7010805@qumranet.com> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: kvm-devel-bounces@lists.sourceforge.net Errors-To: kvm-devel-bounces@lists.sourceforge.net List-Id: kvm.vger.kernel.org On Mon, Feb 11, 2008 at 05:12:42PM +0200, Izik Eidus wrote: > right now kvm take the down_read(mmap_sem) lock to make sure that no > slots will be > removed while trying to get them / make the dirty log safe, > but in some cases when the down_read(mmap_sem) is called and after that > kvm_read_guest() is called > copy_from_user can result in a page fault that will lead to recursivly > taking the mmap_sem, > > this patch remove the mmap_sem, with new kvm private lock. Hi Izik, do_mmap/do_munmap requires the mmap_sem in write-mode. I couldnt find any sequence which grabs mmap_sem and then slots_lock, but it would be nice to verify again that can't happen. Other than that looks good. ------------------------------------------------------------------------- This SF.net email is sponsored by: Microsoft Defy all challenges. Microsoft(R) Visual Studio 2008. http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/