From mboxrd@z Thu Jan 1 00:00:00 1970 From: Tim Deegan Subject: Re: [PATCH] xen/arm: map_domain_page: reuse slots with avail == 0 Date: Fri, 27 Sep 2013 19:24:07 +0100 Message-ID: <20130927182407.GA72104@ocelot.phlegethon.org> References: <1380303917-30212-1-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: <1380303917-30212-1-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 18:45 +0100 on 27 Sep (1380307517), Stefano Stabellini wrote: > If a slot has avail == 0 but still points to the right mfn, reuse it. > > Signed-off-by: Stefano Stabellini > --- > xen/arch/arm/mm.c | 15 ++++++++------- > 1 files changed, 8 insertions(+), 7 deletions(-) > > diff --git a/xen/arch/arm/mm.c b/xen/arch/arm/mm.c > index 44ec0e3..cbcb769 100644 > --- a/xen/arch/arm/mm.c > +++ b/xen/arch/arm/mm.c > @@ -232,7 +232,13 @@ void *map_domain_page(unsigned long mfn) > i < DOMHEAP_ENTRIES; > slot = (slot + 1) % DOMHEAP_ENTRIES, i++ ) > { > - if ( map[slot].pt.avail == 0 ) > + if ( map[slot].pt.avail < 0xf && map[slot].pt.base == slot_mfn ) This needs to check pt.valid as well, in case this path is ever used to map frame 0. Tim.