From mboxrd@z Thu Jan 1 00:00:00 1970 From: Marcelo Tosatti Subject: Re: [PATCH 1/6] kvm.git mmu notifier patch Date: Mon, 28 Jul 2008 18:15:21 -0300 Message-ID: <20080728211521.GB8342@dmt.cnet> References: <20080725142452.GA8217@duo.random> <20080728211104.GA8342@dmt.cnet> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: Avi Kivity , Marcelo Tosatti , kvm@vger.kernel.org To: Andrea Arcangeli Return-path: Received: from mx1.redhat.com ([66.187.233.31]:42799 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1760333AbYG1VSE (ORCPT ); Mon, 28 Jul 2008 17:18:04 -0400 Content-Disposition: inline In-Reply-To: <20080728211104.GA8342@dmt.cnet> Sender: kvm-owner@vger.kernel.org List-ID: On Mon, Jul 28, 2008 at 06:11:04PM -0300, Marcelo Tosatti wrote: > > +static int kvm_unmap_rmapp(struct kvm *kvm, unsigned long *rmapp) > > +{ > > + u64 *spte; > > + int need_tlb_flush = 0; > > + > > + while ((spte = rmap_next(kvm, rmapp, NULL))) { ^^^^^^^^ Yeah, I can't read. :-) > > + BUG_ON(!(*spte & PT_PRESENT_MASK)); > > + rmap_printk("kvm_rmap_unmap_hva: spte %p %llx\n", spte, *spte); > > + rmap_remove(kvm, spte); > > + set_shadow_pte(spte, shadow_trap_nonpresent_pte); > > + need_tlb_flush = 1; > > + } > > Is rmap_remove() safe during rmap_next() iteration? Don't you need to > restart the rmap walk from the beginning? > > Remember the discussion around commit > 6597ca09e6c0e5aec7ffd2b8ab48c671d3c28414.