WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-devel

[Xen-devel] [PATCH 01 of 13] x86/mm/p2m: Mark internal functions static

To: <xen-devel@xxxxxxxxxxxxxxxxxxx>
Subject: [Xen-devel] [PATCH 01 of 13] x86/mm/p2m: Mark internal functions static
From: Tim Deegan <Tim.Deegan@xxxxxxxxxx>
Date: Fri, 13 May 2011 17:28:43 +0100
Delivery-date: Fri, 13 May 2011 09:34:34 -0700
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
In-reply-to: <patchbomb.1305304122@xxxxxxxxxxxxxxxxxxxxxxx>
List-help: <mailto:xen-devel-request@lists.xensource.com?subject=help>
List-id: Xen developer discussion <xen-devel.lists.xensource.com>
List-post: <mailto:xen-devel@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=unsubscribe>
References: <patchbomb.1305304122@xxxxxxxxxxxxxxxxxxxxxxx>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
User-agent: Mercurial-patchbomb/1.6.4
# HG changeset patch
# User Tim Deegan <Tim.Deegan@xxxxxxxxxx>
# Date 1305302438 -3600
# Node ID c5aebdd80c6d8e10113342c023b9e42d20daf2f0
# Parent  f9bb0bbea7c27e256275cfe58c16c0077542984e
x86/mm/p2m: Mark internal functions static

Signed-off-by: Tim Deegan <Tim.Deegan@xxxxxxxxxx>

diff -r f9bb0bbea7c2 -r c5aebdd80c6d xen/arch/x86/mm/p2m-ept.c
--- a/xen/arch/x86/mm/p2m-ept.c Thu May 12 16:42:54 2011 +0100
+++ b/xen/arch/x86/mm/p2m-ept.c Fri May 13 17:00:38 2011 +0100
@@ -164,7 +164,7 @@ static int ept_set_middle_entry(struct p
 }
 
 /* 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 -r f9bb0bbea7c2 -r c5aebdd80c6d xen/arch/x86/mm/p2m-pt.c
--- a/xen/arch/x86/mm/p2m-pt.c  Thu May 12 16:42:54 2011 +0100
+++ b/xen/arch/x86/mm/p2m-pt.c  Fri May 13 17:00:38 2011 +0100
@@ -71,7 +71,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__
@@ -122,7 +122,7 @@ void audit_p2m(struct p2m_domain *p2m, i
 // 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)
 {
@@ -140,40 +140,8 @@ p2m_find_entry(void *table, unsigned lon
     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. */
@@ -886,7 +854,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 -r f9bb0bbea7c2 -r c5aebdd80c6d xen/arch/x86/mm/p2m.c
--- a/xen/arch/x86/mm/p2m.c     Thu May 12 16:42:54 2011 +0100
+++ b/xen/arch/x86/mm/p2m.c     Fri May 13 17:00:38 2011 +0100
@@ -169,6 +169,36 @@ int set_p2m_entry(struct p2m_domain *p2m
     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 -r f9bb0bbea7c2 -r c5aebdd80c6d xen/include/asm-x86/p2m.h
--- a/xen/include/asm-x86/p2m.h Thu May 12 16:42:54 2011 +0100
+++ b/xen/include/asm-x86/p2m.h Fri May 13 17:00:38 2011 +0100
@@ -499,21 +499,11 @@ static inline unsigned long mfn_to_gfn(s
 /* 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_
 }
 
 /* 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 */

_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-devel