]> xenbits.xensource.com Git - mini-os.git/commitdiff
Save/Restore Support: Add arch_mm_pre|post_suspend
authorBruno Alvisio <bruno.alvisio@gmail.com>
Tue, 19 Dec 2017 01:17:53 +0000 (17:17 -0800)
committerWei Liu <wei.liu2@citrix.com>
Wed, 21 Mar 2018 09:16:49 +0000 (09:16 +0000)
For PV guests the pagetables reference the real MFNs rather than PFNs, so when
the guest is resumed into a different area of a hosts memory, these will need to
be rewritten.

PVH guests are auto-translated so no memory operation is needed.

Signed-off-by: Bruno Alvisio <bruno.alvisio@gmail.com>
Reviewed-by: Samuel Thibault <samuel.thibault@ens-lyon.org>
arch/x86/mm.c
include/x86/arch_mm.h

index 05ad029147e846226b63a85e08dae9bb2eeb923e..003f9e165089bcfa949957147cf099c9f15e7d0d 100644 (file)
@@ -848,6 +848,20 @@ void arch_init_p2m(unsigned long max_pfn)
 
     arch_remap_p2m(max_pfn);
 }
+
+void arch_mm_pre_suspend(void)
+{
+    /* TODO: Pre suspend arch specific operations. */
+}
+
+void arch_mm_post_suspend(int canceled)
+{
+    /* TODO: Post suspend arch specific operations. */
+}
+#else
+void arch_mm_pre_suspend(void){ }
+
+void arch_mm_post_suspend(int canceled){ }
 #endif
 
 void arch_init_mm(unsigned long* start_pfn_p, unsigned long* max_pfn_p)
index ab8a53e521476b55e2e2a8235d5c2a15e27e2932..cbbeb21567a06296e54bf0ec881e302f32e62c7e 100644 (file)
@@ -279,6 +279,9 @@ pgentry_t *need_pgt(unsigned long addr);
 void arch_mm_preinit(void *p);
 unsigned long alloc_virt_kernel(unsigned n_pages);
 
+void arch_mm_pre_suspend(void);
+void arch_mm_post_suspend(int canceled);
+
 #ifndef CONFIG_PARAVIRT
 void arch_print_memmap(void);
 #endif