[xen master] xen/arm: mm: Remove unused M2P code

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

[xen master] xen/arm: mm: Remove unused M2P code

patchbot
commit 51581fc533f17204dd0c3e74b227fc4b134742ff
Author:     Julien Grall <[hidden email]>
AuthorDate: Wed Feb 21 13:46:24 2018 +0000
Commit:     Julien Grall <[hidden email]>
CommitDate: Fri Apr 6 09:43:29 2018 +0100

    xen/arm: mm: Remove unused M2P code
   
    Arm does not have an M2P and very unlikely to get one in the future,
    therefore don't keep defines that are not necessary in the common code.
   
    At the same time move the remaining M2P define just above
    set_gpfn_from_mfn to keep all the dummy helpers for M2P together.
   
    Signed-off-by: Julien Grall <[hidden email]>
    Reviewed-by: George Dunlap <[hidden email]>
    Acked-by: Stefano Stabellini <[hidden email]>
---
 xen/include/asm-arm/mm.h | 29 ++++++++---------------------
 1 file changed, 8 insertions(+), 21 deletions(-)

diff --git a/xen/include/asm-arm/mm.h b/xen/include/asm-arm/mm.h
index f4a8e7953c..066ca5facb 100644
--- a/xen/include/asm-arm/mm.h
+++ b/xen/include/asm-arm/mm.h
@@ -313,33 +313,20 @@ static inline void *page_to_virt(const struct page_info *pg)
 struct page_info *get_page_from_gva(struct vcpu *v, vaddr_t va,
                                     unsigned long flags);
 
-/*
- * The MPT (machine->physical mapping table) is an array of word-sized
- * values, indexed on machine frame number. It is expected that guest OSes
- * will use it to store a "physical" frame number to give the appearance of
- * contiguous (or near contiguous) physical memory.
- */
-#undef  machine_to_phys_mapping
-#define machine_to_phys_mapping  ((unsigned long *)RDWR_MPT_VIRT_START)
-#define INVALID_M2P_ENTRY        (~0UL)
-#define VALID_M2P(_e)            (!((_e) & (1UL<<(BITS_PER_LONG-1))))
-#define SHARED_M2P_ENTRY         (~0UL - 1UL)
-#define SHARED_M2P(_e)           ((_e) == SHARED_M2P_ENTRY)
-
-#define _set_gpfn_from_mfn(mfn, pfn) ({                        \
-    struct domain *d = page_get_owner(__mfn_to_page(mfn));     \
-    if(d && (d == dom_cow))                                    \
-        machine_to_phys_mapping[(mfn)] = SHARED_M2P_ENTRY;     \
-    else                                                       \
-        machine_to_phys_mapping[(mfn)] = (pfn);                \
-    })
-
 static inline void put_gfn(struct domain *d, unsigned long gfn) {}
 static inline int relinquish_shared_pages(struct domain *d)
 {
     return 0;
 }
 
+/*
+ * Arm does not have an M2P, but common code expects a handful of
+ * M2P-related defines and functions. Provide dummy versions of these.
+ */
+#define INVALID_M2P_ENTRY        (~0UL)
+#define SHARED_M2P_ENTRY         (~0UL - 1UL)
+#define SHARED_M2P(_e)           ((_e) == SHARED_M2P_ENTRY)
+
 /* Xen always owns P2M on ARM */
 #define set_gpfn_from_mfn(mfn, pfn) do { (void) (mfn), (void)(pfn); } while (0)
 #define mfn_to_gmfn(_d, mfn)  (mfn)
--
generated by git-patchbot for /home/xen/git/xen.git#master

_______________________________________________
Xen-changelog mailing list
[hidden email]
https://lists.xenproject.org/xen-changelog