[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[PATCH 09/11] xen/platform_op: Wrap around XENPF_mem_hotadd


  • To: <xen-devel@xxxxxxxxxxxxxxxxxxxx>
  • From: Jiqian Chen <Jiqian.Chen@xxxxxxx>
  • Date: Fri, 25 Jul 2025 14:15:28 +0800
  • Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 165.204.84.17) smtp.rcpttodomain=lists.xenproject.org smtp.mailfrom=amd.com; dmarc=pass (p=quarantine sp=quarantine pct=100) action=none header.from=amd.com; dkim=none (message not signed); arc=none (0)
  • Arc-message-signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=Gw6NL7VqBaYKCW3hW2Z0XyyrZeJtYrsozW8O4Tm7LFc=; b=hvgtiv1u1CC6theR0TDuiGGWckhBvTBh7Zoz6e/FB3ze5uXRdRFy5dMXC2BQ7Ege7Aieh3pHxUtpUrjQHSiKU+gIaxYi+JaPkOUsfpeQu8d5wmmuq90Uk5Xw6oKI/NWeTaD27Bv3hGsqIZyCC3G6JI6e5/jhsbEEI3ruUPASqNk0wUOefOqt9lf2Ep6CplBDUIo1t8u09cA1OIAzAOLQEmozr1Cc2XnPb5p4GrO/KUn28tBqnpoiGjVj8fHe/MlmdoKW/lY6yOurvVgqwgkCHXDHcvvJDB0d+5oRaTXRWYe8quNK9s3HlosQSdW778V4U0w7SgQidDqNNq3wkHpDcg==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=QtJGlUrD3gL+DRr5qx3k2fzFkXcg50Q5ssUdQgsJbZ1MxK2qbaHQVd7l0aiKi5jE1ygOu5ZtvKTfB5V0vJukGPqFDMYf1tgpJNr6hlZHt4hvQceVHcSmtBiXKR1mYdiW5cj+hodSdivjWYAOq37PZp+p31/D725zhaVLcUFbJ5/B2HCpTvH0m0+A+zCmIQ41J+AIxUklvz1drGGhAcFqW62grpYkN+gbgKYdskKbrh0yW7kyiOrt3Z+gD3rPuyZaP3fGngP+mYS/EBulyMGxHi05jQFVqtjSrDO+qTra2ycoviDN1Ty7mt9Mv6lpd7s2NwnCgP62WvI522zlHNzOuA==
  • Cc: Huang Rui <ray.huang@xxxxxxx>, Jiqian Chen <Jiqian.Chen@xxxxxxx>, "Jan Beulich" <jbeulich@xxxxxxxx>, Andrew Cooper <andrew.cooper3@xxxxxxxxxx>, Roger Pau Monné <roger.pau@xxxxxxxxxx>, Anthony PERARD <anthony.perard@xxxxxxxxxx>, Michal Orzel <michal.orzel@xxxxxxx>, "Julien Grall" <julien@xxxxxxx>, Stefano Stabellini <sstabellini@xxxxxxxxxx>
  • Delivery-date: Fri, 25 Jul 2025 06:20:55 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

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@xxxxxxx>
---
cc: Jan Beulich <jbeulich@xxxxxxxx>
cc: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>
cc: "Roger Pau Monné" <roger.pau@xxxxxxxxxx>
cc: Anthony PERARD <anthony.perard@xxxxxxxxxx>
cc: Michal Orzel <michal.orzel@xxxxxxx>
cc: Julien Grall <julien@xxxxxxx>
cc: Stefano Stabellini <sstabellini@xxxxxxxxxx>
---
 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




 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.