From: Ian Campbell Subject: Re: [PATCH v3 2/4] xen/arm: implement get/put_page_type Date: Thu, 2 Aug 2012 11:08:11 +0100 Message-ID: <1343902091.27221.112.camel@zakaz.uk.xensource.com> References: <1343328892-10195-2-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: In-Reply-To: <1343328892-10195-2-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" , "Tim.Deegan@xen.org" List-Id: xen-devel@lists.xenproject.org On Thu, 2012-07-26 at 19:54 +0100, Stefano Stabellini wrote: > Add a basic get_page_type and put_page_type implementation: we don't > care about typecounts so just return success. > > Also remove PGT_shared_page, that is unused. > > > Changes in v3: > > - replace get_page_type and put_page_type with an empty implementation. Tim suggested that we consider adding an assert that the reference count is non-zero in both of these, since it is incorrect to take a type count without a reference count (we think). In the future maybe we should consider refactoring the gnttab code (and anything else using type counts directly) to use a "pg_make_writable" arch abstraction so we an hide the type counts inside x86 code where they properly belong. > > > Signed-off-by: Stefano Stabellini > --- > xen/arch/arm/dummy.S | 4 ---- > xen/arch/arm/mm.c | 13 +++++++++++++ > xen/include/asm-arm/mm.h | 1 - > 3 files changed, 13 insertions(+), 5 deletions(-) > > diff --git a/xen/arch/arm/dummy.S b/xen/arch/arm/dummy.S > index baced25..2b96d22 100644 > --- a/xen/arch/arm/dummy.S > +++ b/xen/arch/arm/dummy.S > @@ -22,10 +22,6 @@ DUMMY(arch_get_info_guest); > DUMMY(arch_vcpu_reset); > NOP(update_vcpu_system_time); > > -/* Page Reference & Type Maintenance */ > -DUMMY(get_page_type); > -DUMMY(put_page_type); > - > /* Grant Tables */ > DUMMY(steal_page); > > diff --git a/xen/arch/arm/mm.c b/xen/arch/arm/mm.c > index e963af9..96a4ca2 100644 > --- a/xen/arch/arm/mm.c > +++ b/xen/arch/arm/mm.c > @@ -594,6 +594,19 @@ int get_page(struct page_info *page, struct domain *domain) > return 0; > } > > +/* Common code requires get_page_type and put_page_type. > + * We don't care about typecounts so we just do the minimum to make it > + * happy. */ > +int get_page_type(struct page_info *page, unsigned long type) > +{ > + return 1; > +} > + > +void put_page_type(struct page_info *page) > +{ > + return; > +} > + > void gnttab_clear_flag(unsigned long nr, uint16_t *addr) > { > /* > diff --git a/xen/include/asm-arm/mm.h b/xen/include/asm-arm/mm.h > index 53801b0..b37bd35 100644 > --- a/xen/include/asm-arm/mm.h > +++ b/xen/include/asm-arm/mm.h > @@ -71,7 +71,6 @@ struct page_info > > #define PGT_none PG_mask(0, 4) /* no special uses of this page */ > #define PGT_writable_page PG_mask(7, 4) /* has writable mappings? */ > -#define PGT_shared_page PG_mask(8, 4) /* CoW sharable page */ > #define PGT_type_mask PG_mask(15, 4) /* Bits 28-31 or 60-63. */ > > /* Owning guest has pinned this page to its current type? */