]> xenbits.xensource.com Git - xen.git/commitdiff
arm/gnttab: Implement stub helpers as static inlines
authorAndrew Cooper <andrew.cooper3@citrix.com>
Wed, 21 Nov 2018 18:38:41 +0000 (18:38 +0000)
committerAndrew Cooper <andrew.cooper3@citrix.com>
Mon, 8 Jul 2019 21:18:42 +0000 (16:18 -0500)
It is inefficient to call into a different translation unit for a stub
function, when a static inline will work fine.  Replace an open-coded
printk_once() while moving it.

No functional change.

Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
Acked-by: Julien Grall <julien.grall@arm.com>
xen/arch/arm/mm.c
xen/include/asm-arm/grant_table.h

index 35dc1f7e7156b07614409d500a8504c428f2014b..44258ad89cecfc8fbf4801c55ecab44586db1dbd 100644 (file)
@@ -41,7 +41,6 @@
 #include <xen/sizes.h>
 #include <xen/libfdt/libfdt.h>
 
-#include <asm/guest_atomics.h>
 #include <asm/setup.h>
 
 /* Override macros from asm/page.h to make them work with mfn_t */
@@ -1532,21 +1531,6 @@ void put_page_type(struct page_info *page)
     return;
 }
 
-void gnttab_clear_flag(struct domain *d, unsigned long nr, uint16_t *addr)
-{
-    guest_clear_mask16(d, BIT(nr, UL), addr);
-}
-
-void gnttab_mark_dirty(struct domain *d, mfn_t mfn)
-{
-    /* XXX: mark dirty */
-    static int warning;
-    if (!warning) {
-        gdprintk(XENLOG_WARNING, "gnttab_mark_dirty not implemented yet\n");
-        warning = 1;
-    }
-}
-
 int create_grant_host_mapping(unsigned long addr, mfn_t frame,
                               unsigned int flags, unsigned int cache_flags)
 {
index 1ed0aef91d118a0328fb8e2aefb6db5a46c0d547..b0d673b0fe0467aa65c3579c812f69dd91c836d9 100644 (file)
@@ -6,6 +6,8 @@
 #include <xen/pfn.h>
 #include <xen/sched.h>
 
+#include <asm/guest_atomics.h>
+
 #define INITIAL_NR_GRANT_FRAMES 1U
 #define GNTTAB_MAX_VERSION 1
 
@@ -14,13 +16,24 @@ struct grant_table_arch {
     gfn_t *status_gfn;
 };
 
-void gnttab_clear_flag(struct domain *d, unsigned long nr, uint16_t *addr);
+static inline void gnttab_clear_flag(struct domain *d,
+                                     unsigned long nr, uint16_t *addr)
+{
+    guest_clear_mask16(d, BIT(nr, UL), addr);
+}
+
+static inline void gnttab_mark_dirty(struct domain *d, mfn_t mfn)
+{
+#ifndef NDEBUG
+    printk_once(XENLOG_G_WARNING "gnttab_mark_dirty not implemented yet\n");
+#endif
+}
+
 int create_grant_host_mapping(unsigned long gpaddr, mfn_t mfn,
                               unsigned int flags, unsigned int cache_flags);
 #define gnttab_host_mapping_get_page_type(ro, ld, rd) (0)
 int replace_grant_host_mapping(unsigned long gpaddr, mfn_t mfn,
                                unsigned long new_gpaddr, unsigned int flags);
-void gnttab_mark_dirty(struct domain *d, mfn_t mfn);
 #define gnttab_release_host_mappings(domain) 1
 
 /*