~ [ source navigation ] ~ [ diff markup ] ~ [ identifier search ] ~

TOMOYO Linux Cross Reference
Linux/arch/x86/xen/suspend.c

Version: ~ [ linux-5.9 ] ~ [ linux-5.8.14 ] ~ [ linux-5.7.19 ] ~ [ linux-5.6.19 ] ~ [ linux-5.5.19 ] ~ [ linux-5.4.70 ] ~ [ linux-5.3.18 ] ~ [ linux-5.2.21 ] ~ [ linux-5.1.21 ] ~ [ linux-5.0.21 ] ~ [ linux-4.20.17 ] ~ [ linux-4.19.150 ] ~ [ linux-4.18.20 ] ~ [ linux-4.17.19 ] ~ [ linux-4.16.18 ] ~ [ linux-4.15.18 ] ~ [ linux-4.14.200 ] ~ [ linux-4.13.16 ] ~ [ linux-4.12.14 ] ~ [ linux-4.11.12 ] ~ [ linux-4.10.17 ] ~ [ linux-4.9.238 ] ~ [ linux-4.8.17 ] ~ [ linux-4.7.10 ] ~ [ linux-4.6.7 ] ~ [ linux-4.5.7 ] ~ [ linux-4.4.238 ] ~ [ linux-4.3.6 ] ~ [ linux-4.2.8 ] ~ [ linux-4.1.52 ] ~ [ linux-4.0.9 ] ~ [ linux-3.19.8 ] ~ [ linux-3.18.140 ] ~ [ linux-3.17.8 ] ~ [ linux-3.16.85 ] ~ [ linux-3.15.10 ] ~ [ linux-3.14.79 ] ~ [ linux-3.13.11 ] ~ [ linux-3.12.74 ] ~ [ linux-3.11.10 ] ~ [ linux-3.10.108 ] ~ [ linux-2.6.32.71 ] ~ [ linux-2.6.0 ] ~ [ linux-2.4.37.11 ] ~ [ unix-v6-master ] ~ [ ccs-tools-1.8.5 ] ~ [ policy-sample ] ~
Architecture: ~ [ i386 ] ~ [ alpha ] ~ [ m68k ] ~ [ mips ] ~ [ ppc ] ~ [ sparc ] ~ [ sparc64 ] ~

  1 #include <linux/types.h>
  2 #include <linux/clockchips.h>
  3 
  4 #include <xen/interface/xen.h>
  5 #include <xen/grant_table.h>
  6 #include <xen/events.h>
  7 
  8 #include <asm/xen/hypercall.h>
  9 #include <asm/xen/page.h>
 10 #include <asm/fixmap.h>
 11 
 12 #include "xen-ops.h"
 13 #include "mmu.h"
 14 
 15 void xen_arch_pre_suspend(void)
 16 {
 17         xen_start_info->store_mfn = mfn_to_pfn(xen_start_info->store_mfn);
 18         xen_start_info->console.domU.mfn =
 19                 mfn_to_pfn(xen_start_info->console.domU.mfn);
 20 
 21         BUG_ON(!irqs_disabled());
 22 
 23         HYPERVISOR_shared_info = &xen_dummy_shared_info;
 24         if (HYPERVISOR_update_va_mapping(fix_to_virt(FIX_PARAVIRT_BOOTMAP),
 25                                          __pte_ma(0), 0))
 26                 BUG();
 27 }
 28 
 29 void xen_arch_hvm_post_suspend(int suspend_cancelled)
 30 {
 31 #ifdef CONFIG_XEN_PVHVM
 32         int cpu;
 33         if (!suspend_cancelled)
 34             xen_hvm_init_shared_info();
 35         xen_callback_vector();
 36         xen_unplug_emulated_devices();
 37         if (xen_feature(XENFEAT_hvm_safe_pvclock)) {
 38                 for_each_online_cpu(cpu) {
 39                         xen_setup_runstate_info(cpu);
 40                 }
 41         }
 42 #endif
 43 }
 44 
 45 void xen_arch_post_suspend(int suspend_cancelled)
 46 {
 47         xen_build_mfn_list_list();
 48 
 49         xen_setup_shared_info();
 50 
 51         if (suspend_cancelled) {
 52                 xen_start_info->store_mfn =
 53                         pfn_to_mfn(xen_start_info->store_mfn);
 54                 xen_start_info->console.domU.mfn =
 55                         pfn_to_mfn(xen_start_info->console.domU.mfn);
 56         } else {
 57 #ifdef CONFIG_SMP
 58                 BUG_ON(xen_cpu_initialized_map == NULL);
 59                 cpumask_copy(xen_cpu_initialized_map, cpu_online_mask);
 60 #endif
 61                 xen_vcpu_restore();
 62         }
 63 
 64 }
 65 
 66 static void xen_vcpu_notify_restore(void *data)
 67 {
 68         unsigned long reason = (unsigned long)data;
 69 
 70         /* Boot processor notified via generic timekeeping_resume() */
 71         if ( smp_processor_id() == 0)
 72                 return;
 73 
 74         clockevents_notify(reason, NULL);
 75 }
 76 
 77 void xen_arch_resume(void)
 78 {
 79         on_each_cpu(xen_vcpu_notify_restore,
 80                     (void *)CLOCK_EVT_NOTIFY_RESUME, 1);
 81 }
 82 

~ [ source navigation ] ~ [ diff markup ] ~ [ identifier search ] ~

kernel.org | git.kernel.org | LWN.net | Project Home | Wiki (Japanese) | Wiki (English) | SVN repository | Mail admin

Linux® is a registered trademark of Linus Torvalds in the United States and other countries.
TOMOYO® is a registered trademark of NTT DATA CORPORATION.

osdn.jp