From aef98bd489c479c924716cfc1b4a511635800391 Mon Sep 17 00:00:00 2001 From: Andrew Cooper Date: Wed, 21 Nov 2018 18:38:41 +0000 Subject: [PATCH] arm/gnttab: Implement stub helpers as static inlines 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 Acked-by: Julien Grall --- xen/arch/arm/mm.c | 16 ---------------- xen/include/asm-arm/grant_table.h | 17 +++++++++++++++-- 2 files changed, 15 insertions(+), 18 deletions(-) diff --git a/xen/arch/arm/mm.c b/xen/arch/arm/mm.c index 35dc1f7e71..44258ad89c 100644 --- a/xen/arch/arm/mm.c +++ b/xen/arch/arm/mm.c @@ -41,7 +41,6 @@ #include #include -#include #include /* 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) { diff --git a/xen/include/asm-arm/grant_table.h b/xen/include/asm-arm/grant_table.h index 1ed0aef91d..b0d673b0fe 100644 --- a/xen/include/asm-arm/grant_table.h +++ b/xen/include/asm-arm/grant_table.h @@ -6,6 +6,8 @@ #include #include +#include + #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 /* -- 2.30.2