]> xenbits.xensource.com Git - xen.git/commitdiff
xen/arm: livepatch: Redefine virt_to_mfn to support typesafe
authorJulien Grall <julien.grall@arm.com>
Fri, 30 Jun 2017 15:54:22 +0000 (16:54 +0100)
committerStefano Stabellini <sstabellini@kernel.org>
Fri, 30 Jun 2017 20:12:58 +0000 (13:12 -0700)
The file xen/arch/arm/livepatch.c is using typesafe MFN in most of
the place. The only caller to virt_to_mfn is using with _mfn(...).

To avoid extra _mfn(...), re-define virt_to_mfn within
xen/arch/arm/livepatch.c to handle typesafe MFN.

Signed-off-by: Julien Grall <julien.grall@arm.com>
Reviewed-by: Stefano Stabellini <sstabellini@kernel..org>
Acked-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
xen/arch/arm/livepatch.c

index de95e54744e8bba44b369309000f847750ae9331..3e5352436525eaf919d20fd8797a3d232abdf2eb 100644 (file)
 #include <asm/livepatch.h>
 #include <asm/mm.h>
 
+/* Override macros from asm/page.h to make them work with mfn_t */
+#undef virt_to_mfn
+#define virt_to_mfn(va) _mfn(__virt_to_mfn(va))
+
 void *vmap_of_xen_text;
 
 int arch_livepatch_quiesce(void)
@@ -22,7 +26,7 @@ int arch_livepatch_quiesce(void)
     if ( vmap_of_xen_text )
         return -EINVAL;
 
-    text_mfn = _mfn(virt_to_mfn(_start));
+    text_mfn = virt_to_mfn(_start);
     text_order = get_order_from_bytes(_end - _start);
 
     /*