]> xenbits.xensource.com Git - people/liuw/xen.git/commitdiff
XXX x86/mm: store pointer to domain directly in page_info
authorWei Liu <wei.liu2@citrix.com>
Mon, 25 Feb 2019 12:16:53 +0000 (12:16 +0000)
committerWei Liu <wei.liu2@citrix.com>
Mon, 25 Feb 2019 15:58:35 +0000 (15:58 +0000)
Now that (we will?) switch xmalloc to use vmap, it is wrong to derive
pdx from such pointers.

Signed-off-by: Wei Liu <wei.liu2@citrix.com>
xen/include/asm-x86/mm.h
xen/include/asm-x86/x86_64/page.h

index 661e803e45cd4ba34617c75e7694ffee4d6c08da..e37612f0e887d6f1154d14c826b2a7620cdb2a57 100644 (file)
@@ -187,7 +187,7 @@ struct page_info
         /* Page is in use, but not as a shadow. */
         struct {
             /* Owner of this page (zero if page is anonymous). */
-            __pdx_t _domain;
+            struct domain *_domain;
         } inuse;
 
         /* Page is in use as a shadow. */
@@ -304,11 +304,8 @@ static inline void *get_page_address(const struct page_info *page)
 /* OOS fixup entries */
 #define SHADOW_OOS_FIXUPS 2
 
-#define page_get_owner(_p)                                              \
-    ((struct domain *)((_p)->v.inuse._domain ?                          \
-                       pdx_to_virt((_p)->v.inuse._domain) : NULL))
-#define page_set_owner(_p,_d)                                           \
-    ((_p)->v.inuse._domain = (_d) ? virt_to_pdx(_d) : 0)
+#define page_get_owner(_p)    ((_p)->v.inuse._domain)
+#define page_set_owner(_p,_d) (_p)->v.inuse._domain = (_d)
 
 #define maddr_get_owner(ma)   (page_get_owner(maddr_to_page((ma))))
 
index d4a1d48e66bd55f3b2d961d7eec93c27c8a92f62..5776eeca564b6e4dd12aec296c8d957eda3951ce 100644 (file)
@@ -48,6 +48,7 @@ static inline unsigned long canonicalise_addr(unsigned long addr)
 
 extern unsigned long xen_virt_end;
 
+#if 0
 /*
  * Note: These are solely for the use by page_{get,set}_owner(), and
  *       therefore don't need to handle the XEN_VIRT_{START,END} range.
@@ -60,6 +61,7 @@ extern unsigned long xen_virt_end;
                           PAGE_SHIFT)
 #define pdx_to_virt(pdx) ((void *)(DIRECTMAP_VIRT_START + \
                                    ((unsigned long)(pdx) << PAGE_SHIFT)))
+#endif
 
 unsigned long __virt_to_maddr(unsigned long va);
 void *__maddr_to_virt(unsigned long ma);