From mboxrd@z Thu Jan 1 00:00:00 1970 From: Andrea Arcangeli Subject: Re: KVM: MMU: add KVM_ZAP_GFN ioctl Date: Fri, 21 Mar 2008 12:42:14 +0100 Message-ID: <20080321114214.GF7822@v2.random> References: <20080312222941.GA30457@dmt> <47E253EB.3060708@qumranet.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Cc: Marcelo Tosatti , kvm-devel To: Avi Kivity Return-path: Content-Disposition: inline In-Reply-To: <47E253EB.3060708@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 Thu, Mar 20, 2008 at 02:09:15PM +0200, Avi Kivity wrote: > Marcelo Tosatti wrote: > > Add an ioctl to zap all mappings to a given gfn. This allows userspace > > remove the QEMU process mappings and the page without causing > > inconsistency. > > > > > > I'm thinking of comitting rmap_nuke() to kvm.git, and the rest to the > external module, since this is only needed on kernels without mmu notifiers. > > Andrea, is rmap_nuke() suitable for the mmu notifiers pte clear callback? There's the usual smp race condition. The tlb must be flushed before the final put_page in rmap_remove. And it can't be safe to call this ioctl before sys_munmap(), so this would be the final put_page. My kvm_unmap_hva takes care of that. ------------------------------------------------------------------------- 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/