From mboxrd@z Thu Jan 1 00:00:00 1970 From: Julien Grall Subject: Re: [PATCH 3/4] xen: arm: rename p2m next_gfn_to_relinquish to lowest_mapped_gfn Date: Wed, 29 Jan 2014 13:19:47 +0000 Message-ID: <52E8FFF3.7020805@linaro.org> References: <1390997452.31814.90.camel@kazak.uk.xensource.com> <1390997486-3986-3-git-send-email-ian.campbell@citrix.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii"; Format="flowed" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <1390997486-3986-3-git-send-email-ian.campbell@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: Ian Campbell , xen-devel@lists.xen.org Cc: tim@xen.org, george.dunlap@citrix.com, stefano.stabellini@eu.citrix.com List-Id: xen-devel@lists.xenproject.org On 29/01/14 12:11, Ian Campbell wrote: > This has other uses other than during relinquish, so rename it for clarity. > > This is a pure rename. > > Signed-off-by: Ian Campbell Acked-by: Julien Grall > --- > xen/arch/arm/p2m.c | 9 ++++----- > xen/include/asm-arm/p2m.h | 8 +++++--- > 2 files changed, 9 insertions(+), 8 deletions(-) > > diff --git a/xen/arch/arm/p2m.c b/xen/arch/arm/p2m.c > index ace3c54..a61edeb 100644 > --- a/xen/arch/arm/p2m.c > +++ b/xen/arch/arm/p2m.c > @@ -388,7 +388,7 @@ static int apply_p2m_changes(struct domain *d, > { > if ( hypercall_preempt_check() ) > { > - p2m->next_gfn_to_relinquish = addr >> PAGE_SHIFT; > + p2m->lowest_mapped_gfn = addr >> PAGE_SHIFT; > rc = -EAGAIN; > goto out; > } > @@ -415,8 +415,7 @@ static int apply_p2m_changes(struct domain *d, > unsigned long egfn = paddr_to_pfn(end_gpaddr); > > p2m->max_mapped_gfn = MAX(p2m->max_mapped_gfn, egfn); > - /* Use next_gfn_to_relinquish to store the lowest gfn mapped */ > - p2m->next_gfn_to_relinquish = MIN(p2m->next_gfn_to_relinquish, sgfn); > + p2m->lowest_mapped_gfn = MIN(p2m->lowest_mapped_gfn, sgfn); > } > > rc = 0; > @@ -606,7 +605,7 @@ int p2m_init(struct domain *d) > p2m->first_level = NULL; > > p2m->max_mapped_gfn = 0; > - p2m->next_gfn_to_relinquish = ULONG_MAX; > + p2m->lowest_mapped_gfn = ULONG_MAX; > > err: > spin_unlock(&p2m->lock); > @@ -619,7 +618,7 @@ int relinquish_p2m_mapping(struct domain *d) > struct p2m_domain *p2m = &d->arch.p2m; > > return apply_p2m_changes(d, RELINQUISH, > - pfn_to_paddr(p2m->next_gfn_to_relinquish), > + pfn_to_paddr(p2m->lowest_mapped_gfn), > pfn_to_paddr(p2m->max_mapped_gfn), > pfn_to_paddr(INVALID_MFN), > MATTR_MEM, p2m_invalid); > diff --git a/xen/include/asm-arm/p2m.h b/xen/include/asm-arm/p2m.h > index 53b3266..e9c884a 100644 > --- a/xen/include/asm-arm/p2m.h > +++ b/xen/include/asm-arm/p2m.h > @@ -24,9 +24,11 @@ struct p2m_domain { > */ > unsigned long max_mapped_gfn; > > - /* When releasing mapped gfn's in a preemptible manner, recall where > - * to resume the search */ > - unsigned long next_gfn_to_relinquish; > + /* Lowest mapped gfn in the p2m. When releasing mapped gfn's in a > + * preemptible manner this is update to track recall where to > + * resume the search. Apart from during teardown this can only > + * decrease. */ > + unsigned long lowest_mapped_gfn; > }; > > /* List of possible type for each page in the p2m entry. > -- Julien Grall