From: Tim Deegan Subject: Re: [PATCH 3/4] xen/arm: create_p2m_entries should not call free_domheap_page Date: Thu, 12 Jul 2012 13:09:01 +0100 Message-ID: <20120712120901.GG89265@ocelot.phlegethon.org> References: <1341399934-31494-3-git-send-email-stefano.stabellini@eu.citrix.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Content-Disposition: inline In-Reply-To: <1341399934-31494-3-git-send-email-stefano.stabellini@eu.citrix.com> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: Stefano Stabellini Cc: xen-devel@lists.xensource.com, Ian.Campbell@citrix.com List-Id: xen-devel@lists.xenproject.org At 12:05 +0100 on 04 Jul (1341403533), Stefano Stabellini wrote: > The guest is entitled to use valid memory pages as pfns for grant_table > usage. > > In these cases we shouldn't call free_domheap_page to free the existing > page from create_p2m_entries, because it resets the reference counting > but the page is still allocated to the guest (even if not in the p2m > anymore) and common grant_table code is also going to call put_page on > it. Does this break other users? I guess this answers my earlier question about needing refcounts, anyway -- we'll need to use them everywhere to keep the grant-table code consistent. Cheers, Tim. > Signed-off-by: Stefano Stabellini > --- > xen/arch/arm/p2m.c | 5 ----- > 1 files changed, 0 insertions(+), 5 deletions(-) > > diff --git a/xen/arch/arm/p2m.c b/xen/arch/arm/p2m.c > index 7c23b7d..7ae4515 100644 > --- a/xen/arch/arm/p2m.c > +++ b/xen/arch/arm/p2m.c > @@ -189,12 +189,7 @@ static int create_p2m_entries(struct domain *d, > /* else: third already valid */ > > if ( third[third_table_offset(addr)].p2m.valid ) > - { > - /* p2m entry already present */ > - free_domheap_page( > - mfn_to_page(third[third_table_offset(addr)].p2m.base)); > flush_tlb_all_local(); > - } > > /* Allocate a new RAM page and attach */ > switch (op) { > -- > 1.7.2.5 > > > _______________________________________________ > Xen-devel mailing list > Xen-devel@lists.xen.org > http://lists.xen.org/xen-devel