Wrap around call stack functions of XENPF_mem_hotadd:
memory_add
mem_hotadd_check
valid_numa_range
extend_frame_table
setup_frametable_chunk
setup_m2p_table
m2p_mapped
setup_compat_m2p_table
alloc_hotadd_mfn
share_hotadd_m2p_table
transfer_pages_to_heap
destroy_m2p_mapping
destroy_compat_m2p_mapping
cleanup_frame_table
hotadd_mem_valid
Signed-off-by: Jiqian Chen <Jiqian.Chen@amd.com>
---
cc: Jan Beulich <jbeulich@suse.com>
cc: Andrew Cooper <andrew.cooper3@citrix.com>
cc: "Roger Pau Monné" <roger.pau@citrix.com>
cc: Anthony PERARD <anthony.perard@vates.tech>
cc: Michal Orzel <michal.orzel@amd.com>
cc: Julien Grall <julien@xen.org>
cc: Stefano Stabellini <sstabellini@kernel.org>
---
xen/arch/x86/x86_64/mm.c | 6 ++++++
xen/common/numa.c | 2 ++
2 files changed, 8 insertions(+)
diff --git a/xen/arch/x86/x86_64/mm.c b/xen/arch/x86/x86_64/mm.c
index d4e6a9c0a2e0..5952bca8cd84 100644
--- a/xen/arch/x86/x86_64/mm.c
+++ b/xen/arch/x86/x86_64/mm.c
@@ -111,6 +111,7 @@ void *do_page_walk(struct vcpu *v, unsigned long addr)
return map_domain_page(_mfn(mfn)) + (addr & ~PAGE_MASK);
}
+#ifdef CONFIG_PLATFORM_OP
/*
* Allocate page table pages for m2p table
*/
@@ -496,6 +497,7 @@ error:
unmap_domain_page(l3_ro_mpt);
return ret;
}
+#endif /* CONFIG_PLATFORM_OP */
void __init paging_init(void)
{
@@ -743,6 +745,7 @@ void free_compat_arg_xlat(struct vcpu *v)
PFN_UP(COMPAT_ARG_XLAT_SIZE));
}
+#ifdef CONFIG_PLATFORM_OP
static void cleanup_frame_table(struct mem_hotadd_info *info)
{
unsigned long sva, eva;
@@ -861,6 +864,7 @@ static int extend_frame_table(struct mem_hotadd_info *info)
(unsigned long)mfn_to_page(epfn) - (unsigned long)mfn_to_page(spfn));
return 0;
}
+#endif /* CONFIG_PLATFORM_OP */
void __init subarch_init_memory(void)
{
@@ -1139,6 +1143,7 @@ unsigned int domain_clamp_alloc_bitsize(struct domain *d, unsigned int bits)
return min(d->arch.physaddr_bitsize, bits);
}
+#ifdef CONFIG_PLATFORM_OP
static int transfer_pages_to_heap(struct mem_hotadd_info *info)
{
unsigned long i;
@@ -1360,6 +1365,7 @@ destroy_frametable:
return ret;
}
+#endif /* CONFIG_PLATFORM_OP */
void set_gpfn_from_mfn(unsigned long mfn, unsigned long pfn)
{
diff --git a/xen/common/numa.c b/xen/common/numa.c
index ad75955a1622..9a1b7e3a729c 100644
--- a/xen/common/numa.c
+++ b/xen/common/numa.c
@@ -59,6 +59,7 @@ void __init numa_set_processor_nodes_parsed(nodeid_t node)
node_set(node, processor_nodes_parsed);
}
+#ifdef CONFIG_PLATFORM_OP
bool valid_numa_range(paddr_t start, paddr_t end, nodeid_t node)
{
unsigned int i;
@@ -74,6 +75,7 @@ bool valid_numa_range(paddr_t start, paddr_t end, nodeid_t node)
return false;
}
+#endif /* CONFIG_PLATFORM_OP */
static enum conflicts __init conflicting_memblks(
nodeid_t nid, paddr_t start, paddr_t end, paddr_t nd_start,
--
2.34.1