Linux 4.13.16
[linux/fpc-iii.git] / arch / x86 / xen / suspend_pv.c
blob3abe4f07f34a4292fc571485f7b5dbee4824f2b8
1 #include <linux/types.h>
3 #include <asm/fixmap.h>
5 #include <asm/xen/hypercall.h>
6 #include <asm/xen/page.h>
8 #include "xen-ops.h"
10 void xen_pv_pre_suspend(void)
12 xen_mm_pin_all();
14 xen_start_info->store_mfn = mfn_to_pfn(xen_start_info->store_mfn);
15 xen_start_info->console.domU.mfn =
16 mfn_to_pfn(xen_start_info->console.domU.mfn);
18 BUG_ON(!irqs_disabled());
20 HYPERVISOR_shared_info = &xen_dummy_shared_info;
21 if (HYPERVISOR_update_va_mapping(fix_to_virt(FIX_PARAVIRT_BOOTMAP),
22 __pte_ma(0), 0))
23 BUG();
26 void xen_pv_post_suspend(int suspend_cancelled)
28 xen_build_mfn_list_list();
30 xen_setup_shared_info();
32 if (suspend_cancelled) {
33 xen_start_info->store_mfn =
34 pfn_to_mfn(xen_start_info->store_mfn);
35 xen_start_info->console.domU.mfn =
36 pfn_to_mfn(xen_start_info->console.domU.mfn);
37 } else {
38 #ifdef CONFIG_SMP
39 BUG_ON(xen_cpu_initialized_map == NULL);
40 cpumask_copy(xen_cpu_initialized_map, cpu_online_mask);
41 #endif
42 xen_vcpu_restore();
45 xen_mm_unpin_all();