summaryrefslogtreecommitdiff
path: root/xen/include
diff options
context:
space:
mode:
authorJan Beulich <jbeulich@suse.com>2020-08-24 15:38:03 +0200
committerJan Beulich <jbeulich@suse.com>2020-08-24 15:38:03 +0200
commitc297c9453375892284810f0dc46d408865f9998b (patch)
tree039220f503a44c064d079c45d47e9810601fd8ed /xen/include
parente8f9d219657d28d3403660f70156c2a20cbbb4bb (diff)
x86: convert set_gpfn_from_mfn() to a function
It is already a little too heavy for a macro, and more logic is about to get added to it. This also allows reducing the scope of compat_machine_to_phys_mapping. Requested-by: Andrew Cooper <andrew.cooper3@citrix.com> Signed-off-by: Jan Beulich <jbeulich@suse.com> Acked-by: Andrew Cooper <andrew.cooper3@citrix.com>
Diffstat (limited to 'xen/include')
-rw-r--r--xen/include/asm-x86/mm.h16
1 files changed, 2 insertions, 14 deletions
diff --git a/xen/include/asm-x86/mm.h b/xen/include/asm-x86/mm.h
index 7e74996053..89a55592c4 100644
--- a/xen/include/asm-x86/mm.h
+++ b/xen/include/asm-x86/mm.h
@@ -494,25 +494,13 @@ extern paddr_t mem_hotplug;
#define SHARED_M2P_ENTRY (~0UL - 1UL)
#define SHARED_M2P(_e) ((_e) == SHARED_M2P_ENTRY)
-#define compat_machine_to_phys_mapping ((unsigned int *)RDWR_COMPAT_MPT_VIRT_START)
-#define _set_gpfn_from_mfn(mfn, pfn) ({ \
- struct domain *d = page_get_owner(mfn_to_page(_mfn(mfn))); \
- unsigned long entry = (d && (d == dom_cow)) ? \
- SHARED_M2P_ENTRY : (pfn); \
- ((void)((mfn) >= (RDWR_COMPAT_MPT_VIRT_END - RDWR_COMPAT_MPT_VIRT_START) / 4 || \
- (compat_machine_to_phys_mapping[(mfn)] = (unsigned int)(entry))), \
- machine_to_phys_mapping[(mfn)] = (entry)); \
- })
-
/*
* Disable some users of set_gpfn_from_mfn() (e.g., free_heap_pages()) until
* the machine_to_phys_mapping is actually set up.
*/
extern bool machine_to_phys_mapping_valid;
-#define set_gpfn_from_mfn(mfn, pfn) do { \
- if ( machine_to_phys_mapping_valid ) \
- _set_gpfn_from_mfn(mfn, pfn); \
-} while (0)
+
+void set_gpfn_from_mfn(unsigned long mfn, unsigned long pfn);
extern struct rangeset *mmio_ro_ranges;