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

[xen master] mem-sharing: move (x86) / drop (Arm) arch_dump_shared_mem_info()



commit db75dfdb11dc4e837585bf61cc25dc0c8f048288
Author:     Jan Beulich <jbeulich@xxxxxxxx>
AuthorDate: Tue Aug 22 08:52:49 2023 +0200
Commit:     Jan Beulich <jbeulich@xxxxxxxx>
CommitDate: Tue Aug 22 08:52:49 2023 +0200

    mem-sharing: move (x86) / drop (Arm) arch_dump_shared_mem_info()
    
    When !MEM_SHARING no useful output is produced. Move the function into
    mm/mem_sharing.c while conditionalizing the call to it, thus allowing to
    drop it altogether from Arm (and eliminating the need to introduce stubs
    on PPC and RISC-V).
    
    Signed-off-by: Jan Beulich <jbeulich@xxxxxxxx>
    Reviewed-by: Luca Fancellu <luca.fancellu@xxxxxxx> #arm
    Acked-by: Stefano Stabellini <sstabellini@xxxxxxxxxx>
    Acked-by: Tamas K Lengyel <tamas@xxxxxxxxxxxxx>
---
 xen/arch/arm/mm.c             | 4 ----
 xen/arch/x86/mm.c             | 7 -------
 xen/arch/x86/mm/mem_sharing.c | 7 +++++++
 xen/common/keyhandler.c       | 2 ++
 4 files changed, 9 insertions(+), 11 deletions(-)

diff --git a/xen/arch/arm/mm.c b/xen/arch/arm/mm.c
index d1e1bc72bd..c34cc94c90 100644
--- a/xen/arch/arm/mm.c
+++ b/xen/arch/arm/mm.c
@@ -1294,10 +1294,6 @@ void free_init_memory(void)
     printk("Freed %ldkB init memory.\n", (long)(__init_end-__init_begin)>>10);
 }
 
-void arch_dump_shared_mem_info(void)
-{
-}
-
 int steal_page(
     struct domain *d, struct page_info *page, unsigned int memflags)
 {
diff --git a/xen/arch/x86/mm.c b/xen/arch/x86/mm.c
index 057e17c10e..28fdf820ef 100644
--- a/xen/arch/x86/mm.c
+++ b/xen/arch/x86/mm.c
@@ -6261,13 +6261,6 @@ void memguard_unguard_stack(void *p)
     map_pages_to_xen((unsigned long)p, virt_to_mfn(p), 1, PAGE_HYPERVISOR_RW);
 }
 
-void arch_dump_shared_mem_info(void)
-{
-    printk("Shared frames %u -- Saved frames %u\n",
-            mem_sharing_get_nr_shared_mfns(),
-            mem_sharing_get_nr_saved_mfns());
-}
-
 const struct platform_bad_page *__init get_platform_badpages(unsigned int 
*array_size)
 {
     u32 igd_id;
diff --git a/xen/arch/x86/mm/mem_sharing.c b/xen/arch/x86/mm/mem_sharing.c
index 8edbd9600f..ae5366d447 100644
--- a/xen/arch/x86/mm/mem_sharing.c
+++ b/xen/arch/x86/mm/mem_sharing.c
@@ -2329,3 +2329,10 @@ int mem_sharing_domctl(struct domain *d, struct 
xen_domctl_mem_sharing_op *mec)
 
     return rc;
 }
+
+void arch_dump_shared_mem_info(void)
+{
+    printk("Shared frames %u -- Saved frames %u\n",
+            mem_sharing_get_nr_shared_mfns(),
+            mem_sharing_get_nr_saved_mfns());
+}
diff --git a/xen/common/keyhandler.c b/xen/common/keyhandler.c
index 68d8166968..f4752859cc 100644
--- a/xen/common/keyhandler.c
+++ b/xen/common/keyhandler.c
@@ -365,7 +365,9 @@ static void cf_check dump_domains(unsigned char key)
         }
     }
 
+#ifdef CONFIG_MEM_SHARING
     arch_dump_shared_mem_info();
+#endif
 
     rcu_read_unlock(&domlist_read_lock);
 }
--
generated by git-patchbot for /home/xen/git/xen.git#master



 


Rackspace

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