| 
 This code has been tested under simple suspend & resume scenario:  
 The xc_save doesn't destroy the domain, and domU resume from the memory. 
 
diff -r 933613959bf6 drivers/xen/core/reboot.c 
--- a/drivers/xen/core/reboot.c	Wed Oct 04 11:20:16 2006 -0400 
+++ b/drivers/xen/core/reboot.c	Thu Oct 05 16:11:06 2006 -0400 
@@ -83,7 +83,6 @@ static void __shutdown_handler(void *unu 
 static void __shutdown_handler(void *unused); 
 static DECLARE_WORK(shutdown_work, __shutdown_handler, NULL); 
  
-#ifndef CONFIG_PPC_XEN 
 /* Ensure we run on the idle task page tables so that we will 
    switch page tables before running user space. This is needed 
    on architectures with separate kernel and user page tables 
@@ -105,21 +104,24 @@ static int __do_suspend(void *ignore) 
 { 
 	int i, j, k, fpp, err; 
  
+#ifndef CONFIG_PPC_XEN 
 	extern unsigned long max_pfn; 
 	extern unsigned long *pfn_to_mfn_frame_list_list; 
 	extern unsigned long *pfn_to_mfn_frame_list[]; 
  
 	extern void time_resume(void); 
- 
+#endif 
 	BUG_ON(smp_processor_id() != 0); 
 	BUG_ON(in_interrupt()); 
  
+	printk("Entering do_suspend  \n");  //DEBUG 
+#ifndef CONFIG_PPC_XEN 
 	if (xen_feature(XENFEAT_auto_translated_physmap)) { 
 		printk(KERN_WARNING "Cannot suspend in " 
 		       "auto_translated_physmap mode.\n"); 
 		return -EOPNOTSUPP; 
 	} 
- 
+#endif 
 	err = smp_suspend(); 
 	if (err) 
 		return err; 
@@ -131,15 +133,18 @@ static int __do_suspend(void *ignore) 
 #ifdef __i386__ 
 	kmem_cache_shrink(pgd_cache); 
 #endif 
+#ifndef CONFIG_PPC_XEN 
 	mm_pin_all(); 
- 
+#endif 
 	__cli(); 
 	preempt_enable(); 
  
 	gnttab_suspend(); 
  
 	HYPERVISOR_shared_info = (shared_info_t *)empty_zero_page; 
+#ifndef CONFIG_PPC_XEN 
 	clear_fixmap(FIX_SHARED_INFO); 
+#endif 
  
 	xen_start_info->store_mfn = mfn_to_pfn(xen_start_info->store_mfn); 
 	xen_start_info->console_mfn = mfn_to_pfn(xen_start_info->console_mfn); 
@@ -151,13 +156,19 @@ static int __do_suspend(void *ignore) 
 	HYPERVISOR_suspend(virt_to_mfn(xen_start_info)); 
  
 	shutting_down = SHUTDOWN_INVALID; 
- 
+	 
+	printk("Here we're resuming \n");  //DEBUG 
+ 
+#ifndef CONFIG_PPC_XEN 
 	set_fixmap(FIX_SHARED_INFO, xen_start_info->shared_info); 
  
 	HYPERVISOR_shared_info = (shared_info_t *)fix_to_virt(FIX_SHARED_INFO); 
- 
+#else 
+	HYPERVISOR_shared_info = (shared_info_t *)__va(xen_start_info->shared_info); 
+#endif 
 	memset(empty_zero_page, 0, PAGE_SIZE); 
  
+#ifndef CONFIG_PPC_XEN 
 	HYPERVISOR_shared_info->arch.pfn_to_mfn_frame_list_list = 
 		virt_to_mfn(pfn_to_mfn_frame_list_list); 
  
@@ -173,13 +184,15 @@ static int __do_suspend(void *ignore) 
 			virt_to_mfn(&phys_to_machine_mapping[i]); 
 	} 
 	HYPERVISOR_shared_info->arch.max_pfn = max_pfn; 
+#endif 
  
 	gnttab_resume(); 
  
 	irq_resume(); 
  
+#ifndef CONFIG_PPC_XEN 
 	time_resume(); 
- 
+#endif 
 	switch_idle_mm(); 
  
 	__sti(); 
@@ -192,13 +205,6 @@ static int __do_suspend(void *ignore) 
  
 	return err; 
 } 
-#else  /* CONFIG_PPC_XEN */ 
-static int __do_suspend(void *ignore) 
-{ 
-	printk("SUSPEND!!??\n"); 
-	return 0; 
-} 
-#endif  /* CONFIG_PPC_XEN */ 
  
 static int shutdown_process(void *__unused) 
 { 
diff -r 933613959bf6 include/asm-powerpc/system.h 
--- a/include/asm-powerpc/system.h	Wed Oct 04 11:20:16 2006 -0400 
+++ b/include/asm-powerpc/system.h	Thu Oct 05 16:13:38 2006 -0400 
@@ -433,5 +433,12 @@ extern void account_system_vtime(struct  
 extern void account_system_vtime(struct task_struct *); 
 #endif 
  
+#ifndef	__cli 
+ 
+#define __cli() local_irq_disable() 
+#define	__sti() local_irq_enable() 
+#endif	/* __cli */ 
+ 
+ 
 #endif /* __KERNEL__ */ 
 #endif /* _ASM_POWERPC_SYSTEM_H */ 
diff -r 933613959bf6 include/asm-powerpc/xen/asm/hypercall.h 
--- a/include/asm-powerpc/xen/asm/hypercall.h	Wed Oct 04 11:20:16 2006 -0400 
+++ b/include/asm-powerpc/xen/asm/hypercall.h	Thu Oct 05 16:16:40 2006 -0400 
@@ -60,6 +60,16 @@ static inline int HYPERVISOR_shutdown(un 
 	return HYPERVISOR_sched_op(SCHEDOP_shutdown, &sched_shutdown); 
 } 
  
+ 
+static inline int HYPERVISOR_suspend(unsigned long srec) 
+{ 
+	struct sched_shutdown sched_shutdown = { 
+		.reason = SHUTDOWN_suspend 
+	}; 
+ 
+	return HYPERVISOR_sched_op(SCHEDOP_shutdown, &sched_shutdown); 
+} 
+ 
 static inline int HYPERVISOR_set_timer_op(unsigned long arg) 
 { 
 	return plpar_hcall_norets(XEN_MARK(__HYPERVISOR_set_timer_op), arg); 
 
 
Best Regards, 
Yi  Ge, PhD 
IBM China Research Lab 
Tel: (86-10) 58748024 
Fax: (86-10) 58748230 
E-Mail : geyi@xxxxxxxxxx 
Notes Mail: Yi Ge/China/IBM@IBMCN 
 
Building 19 Zhongguancun Software Park,  
8 Dongbeiwang WestRoad, Haidian District,  
Beijing,P.R.C.100094 
 
 
 _______________________________________________
Xen-ppc-devel mailing list
Xen-ppc-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-ppc-devel 
 |