]> xenbits.xensource.com Git - people/julieng/xen-unstable.git/commitdiff
xen/arm: p2m: Introduce a helper to remove an entry in the page table
authorJulien Grall <julien.grall@citrix.com>
Tue, 1 Dec 2015 17:52:11 +0000 (17:52 +0000)
committerIan Campbell <ian.campbell@citrix.com>
Tue, 15 Dec 2015 11:58:54 +0000 (11:58 +0000)
Factorize the code to remove an entry in p2m_remove_pte so we can re-use
it later.

Signed-off-by: Julien Grall <julien.grall@citrix.com>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
xen/arch/arm/p2m.c

index f28ae3f2b9ad5a48aaa57c11f5625bdfa3e83bdd..ae0acf0bdeccc4e7d8cee88536131d75e83f72e6 100644 (file)
@@ -367,6 +367,14 @@ static inline void p2m_write_pte(lpae_t *p, lpae_t pte, bool_t flush_cache)
         clean_dcache(*p);
 }
 
+static inline void p2m_remove_pte(lpae_t *p, bool_t flush_cache)
+{
+    lpae_t pte;
+
+    memset(&pte, 0x00, sizeof(pte));
+    p2m_write_pte(p, pte, flush_cache);
+}
+
 /*
  * Allocate a new page table page and hook it in via the given entry.
  * apply_one_level relies on this returning 0 on success
@@ -839,8 +847,7 @@ static int apply_one_level(struct domain *d,
 
         *flush = true;
 
-        memset(&pte, 0x00, sizeof(pte));
-        p2m_write_pte(entry, pte, flush_cache);
+        p2m_remove_pte(entry, flush_cache);
         p2m_mem_access_radix_set(p2m, paddr_to_pfn(*addr), p2m_access_rwx);
 
         *addr += level_size;