xen: Convert is_xen_fixed_mfn to use typesafe MFN
authorJulien Grall <julien.grall@arm.com>
Sat, 26 Jan 2019 16:38:47 +0000 (16:38 +0000)
committerJulien Grall <julien.grall@arm.com>
Mon, 19 Aug 2019 14:09:19 +0000 (15:09 +0100)
No functional changes.

Signed-off-by: Julien Grall <julien.grall@arm.com>
Reviewed-by: Jan Beulich <jbeulich@suse.com>
Acked-by: Stefano Stabellini <sstabellini@kernel.org>
Reviewed-by: George Dunlap <george.dunlap@citrix.com>
xen/arch/x86/tboot.c
xen/common/page_alloc.c
xen/include/asm-arm/mm.h
xen/include/asm-x86/mm.h

index f3fdee4d395ad56d55d78020f54dabe03c420f51..30d159cc62d734f9a923645b7b598e882783f58a 100644 (file)
@@ -280,7 +280,7 @@ static void tboot_gen_xenheap_integrity(const uint8_t key[TB_KEY_SIZE],
 
         if ( !mfn_valid(_mfn(mfn)) )
             continue;
-        if ( is_xen_fixed_mfn(mfn) )
+        if ( is_xen_fixed_mfn(_mfn(mfn)) )
             continue; /* skip Xen */
         if ( (mfn >= PFN_DOWN(g_tboot_shared->tboot_base - 3 * PAGE_SIZE))
              && (mfn < PFN_UP(g_tboot_shared->tboot_base
index 2cee2453ccc7ebbe71d40a7be87b0990062403a6..7cb1bd368b6c2d96d3f8fcf4de15e54dda2ede16 100644 (file)
@@ -1585,7 +1585,7 @@ int offline_page(mfn_t mfn, int broken, uint32_t *status)
     *status = 0;
     pg = mfn_to_page(mfn);
 
-    if ( is_xen_fixed_mfn(mfn_x(mfn)) )
+    if ( is_xen_fixed_mfn(mfn) )
     {
         *status = PG_OFFLINE_XENPAGE | PG_OFFLINE_FAILED |
           (DOMID_XEN << PG_OFFLINE_OWNER_SHIFT);
index e4d1c8e069cec5d00e666a7552391cfa024a9713..126e6be9b52e2e41c74eb3e532ad7fd2c125f2cf 100644 (file)
@@ -152,8 +152,8 @@ extern unsigned long xenheap_base_pdx;
 #endif
 
 #define is_xen_fixed_mfn(mfn)                                   \
-    ((pfn_to_paddr(mfn) >= virt_to_maddr(&_start)) &&       \
-     (pfn_to_paddr(mfn) <= virt_to_maddr(&_end)))
+    ((mfn_to_maddr(mfn) >= virt_to_maddr(&_start)) &&           \
+     (mfn_to_maddr(mfn) <= virt_to_maddr(&_end)))
 
 #define page_get_owner(_p)    (_p)->v.inuse.domain
 #define page_set_owner(_p,_d) ((_p)->v.inuse.domain = (_d))
index 181aa776fe40501229d8ac71c388924458fbe6c0..790a2622ced466dfd441db3e07c88c83041e0184 100644 (file)
@@ -283,8 +283,8 @@ struct page_info
 #define is_xen_heap_mfn(mfn) \
     (mfn_valid(mfn) && is_xen_heap_page(mfn_to_page(mfn)))
 #define is_xen_fixed_mfn(mfn)                     \
-    ((((mfn) << PAGE_SHIFT) >= __pa(&_stext)) &&  \
-     (((mfn) << PAGE_SHIFT) <= __pa(&__2M_rwdata_end)))
+    (((mfn_to_maddr(mfn)) >= __pa(&_stext)) &&    \
+     ((mfn_to_maddr(mfn)) <= __pa(&__2M_rwdata_end)))
 
 #define PRtype_info "016lx"/* should only be used for printk's */