From: Tim Deegan Date: Thu, 2 Jun 2011 12:16:51 +0000 (+0100) Subject: x86/mm/p2m: Mark internal functions static X-Git-Tag: archive/raspbian/4.8.0-1+rpi1~1^2~10241 X-Git-Url: https://dgit.raspbian.org/?a=commitdiff_plain;h=d5ce4dacf003caa6326c3dcd69481543afdd7432;p=xen.git x86/mm/p2m: Mark internal functions static Signed-off-by: Tim Deegan --- diff --git a/xen/arch/x86/mm/p2m-ept.c b/xen/arch/x86/mm/p2m-ept.c index e05d14b072..fde2cc9111 100644 --- a/xen/arch/x86/mm/p2m-ept.c +++ b/xen/arch/x86/mm/p2m-ept.c @@ -164,7 +164,7 @@ static int ept_set_middle_entry(struct p2m_domain *p2m, ept_entry_t *ept_entry) } /* free ept sub tree behind an entry */ -void ept_free_entry(struct p2m_domain *p2m, ept_entry_t *ept_entry, int level) +static void ept_free_entry(struct p2m_domain *p2m, ept_entry_t *ept_entry, int level) { /* End if the entry is a leaf entry. */ if ( level == 0 || !is_epte_present(ept_entry) || diff --git a/xen/arch/x86/mm/p2m-pt.c b/xen/arch/x86/mm/p2m-pt.c index 3b87045f26..c664bf3c6f 100644 --- a/xen/arch/x86/mm/p2m-pt.c +++ b/xen/arch/x86/mm/p2m-pt.c @@ -54,7 +54,7 @@ #define SUPERPAGE_PAGES (1UL << 9) #define superpage_aligned(_x) (((_x)&(SUPERPAGE_PAGES-1))==0) -unsigned long p2m_type_to_flags(p2m_type_t t, mfn_t mfn) +static unsigned long p2m_type_to_flags(p2m_type_t t, mfn_t mfn) { unsigned long flags; #ifdef __x86_64__ @@ -100,7 +100,7 @@ unsigned long p2m_type_to_flags(p2m_type_t t, mfn_t mfn) // Find the next level's P2M entry, checking for out-of-range gfn's... // Returns NULL on error. // -l1_pgentry_t * +static l1_pgentry_t * p2m_find_entry(void *table, unsigned long *gfn_remainder, unsigned long gfn, uint32_t shift, uint32_t max) { @@ -118,40 +118,8 @@ p2m_find_entry(void *table, unsigned long *gfn_remainder, return (l1_pgentry_t *)table + index; } -struct page_info * -p2m_alloc_ptp(struct p2m_domain *p2m, unsigned long type) -{ - struct page_info *pg; - - ASSERT(p2m); - ASSERT(p2m->domain); - ASSERT(p2m->domain->arch.paging.alloc_page); - pg = p2m->domain->arch.paging.alloc_page(p2m->domain); - if (pg == NULL) - return NULL; - - page_list_add_tail(pg, &p2m->pages); - pg->u.inuse.type_info = type | 1 | PGT_validated; - - return pg; -} - -void -p2m_free_ptp(struct p2m_domain *p2m, struct page_info *pg) -{ - ASSERT(pg); - ASSERT(p2m); - ASSERT(p2m->domain); - ASSERT(p2m->domain->arch.paging.free_page); - - page_list_del(pg, &p2m->pages); - p2m->domain->arch.paging.free_page(p2m->domain, pg); - - return; -} - /* Free intermediate tables from a p2m sub-tree */ -void +static void p2m_free_entry(struct p2m_domain *p2m, l1_pgentry_t *p2m_entry, int page_order) { /* End if the entry is a leaf entry. */ @@ -864,7 +832,8 @@ out: /* Walk the whole p2m table, changing any entries of the old type * to the new type. This is used in hardware-assisted paging to * quickly enable or diable log-dirty tracking */ -void p2m_change_type_global(struct p2m_domain *p2m, p2m_type_t ot, p2m_type_t nt) +static void p2m_change_type_global(struct p2m_domain *p2m, + p2m_type_t ot, p2m_type_t nt) { unsigned long mfn, gfn, flags; l1_pgentry_t l1e_content; diff --git a/xen/arch/x86/mm/p2m.c b/xen/arch/x86/mm/p2m.c index aba199e776..618aa132af 100644 --- a/xen/arch/x86/mm/p2m.c +++ b/xen/arch/x86/mm/p2m.c @@ -161,6 +161,36 @@ int set_p2m_entry(struct p2m_domain *p2m, unsigned long gfn, mfn_t mfn, return rc; } +struct page_info *p2m_alloc_ptp(struct p2m_domain *p2m, unsigned long type) +{ + struct page_info *pg; + + ASSERT(p2m); + ASSERT(p2m->domain); + ASSERT(p2m->domain->arch.paging.alloc_page); + pg = p2m->domain->arch.paging.alloc_page(p2m->domain); + if (pg == NULL) + return NULL; + + page_list_add_tail(pg, &p2m->pages); + pg->u.inuse.type_info = type | 1 | PGT_validated; + + return pg; +} + +void p2m_free_ptp(struct p2m_domain *p2m, struct page_info *pg) +{ + ASSERT(pg); + ASSERT(p2m); + ASSERT(p2m->domain); + ASSERT(p2m->domain->arch.paging.free_page); + + page_list_del(pg, &p2m->pages); + p2m->domain->arch.paging.free_page(p2m->domain, pg); + + return; +} + // Allocate a new p2m table for a domain. // // The structure of the p2m table is that of a pagetable for xen (i.e. it is diff --git a/xen/include/asm-x86/p2m.h b/xen/include/asm-x86/p2m.h index 0bf9545ac7..cbf1da2835 100644 --- a/xen/include/asm-x86/p2m.h +++ b/xen/include/asm-x86/p2m.h @@ -499,21 +499,11 @@ static inline unsigned long mfn_to_gfn(struct domain *d, mfn_t mfn) /* Init the datastructures for later use by the p2m code */ int p2m_init(struct domain *d); -/* PTE flags for various types of p2m entry */ -unsigned long p2m_type_to_flags(p2m_type_t t, mfn_t mfn); - /* Allocate a new p2m table for a domain. * * Returns 0 for success or -errno. */ int p2m_alloc_table(struct p2m_domain *p2m); -/* Find the next level's P2M entry, checking for out-of-range gfn's... - * Returns NULL on error. - */ -l1_pgentry_t * -p2m_find_entry(void *table, unsigned long *gfn_remainder, - unsigned long gfn, uint32_t shift, uint32_t max); - /* Return all the p2m resources to Xen. */ void p2m_teardown(struct p2m_domain *p2m); void p2m_final_teardown(struct domain *d); @@ -584,7 +574,6 @@ static inline void guest_physmap_remove_page(struct domain *d, } /* Change types across all p2m entries in a domain */ -void p2m_change_type_global(struct p2m_domain *p2m, p2m_type_t ot, p2m_type_t nt); void p2m_change_entry_type_global(struct p2m_domain *p2m, p2m_type_t ot, p2m_type_t nt); /* Compare-exchange the type of a single p2m entry */