Re: [XenPPC]:PPC kernel shutdown & resume over Xen

2006-09-27 Thread Hollis Blanchard
On Tue, 2006-09-26 at 18:05 -0400, Yi Ge wrote:
> We've tried to shutdown and resume the domU kernel based on the code
> from xen-tools and reboot.c.
> The DomU has been suspended and got the status "s" in xm list, but we
> can't resume it. Who can tell us how the HYPERVISOR_suspend and its
> parameter "srec" works on the suspend/shutdown procedure? 

I don't think anybody else on this list has looked in to suspend before.
So I have two suggetions:
1) look into the Xen code that implements this hypercall. In particular,
you're looking for SCHEDOP_shutdown in xen/common/schedule.c
2) if you don't understand that, you can ask specific questions on
[EMAIL PROTECTED]

>From a quick read, it looks to me like the 'srec' parameter is totally
ignored, and may be an artifact from old code. If so, you should submit
a patch to xen-devel to remove it.

-- 
Hollis Blanchard
IBM Linux Technology Center


___
Xen-ppc-devel mailing list
Xen-ppc-devel@lists.xensource.com
http://lists.xensource.com/xen-ppc-devel


Re: [XenPPC]:PPC kernel shutdown & resume over Xen

2006-09-27 Thread Jimi Xenidis


On Sep 26, 2006, at 6:05 PM, Yi Ge wrote:

We've tried to shutdown and resume the domU kernel based on the  
code from xen-tools and reboot.c.

"Shutdown"?! you mean you mean "save", there is no return from shutdown.
The DomU has been suspended and got the status "s" in xm list, but  
we can't resume it.

This should have ultimately destroyed the domain, are saying it did not?
Who can tell us how the HYPERVISOR_suspend and its parameter "srec"  
works on the suspend/shutdown procedure?
Doesn't look like linuxppc even implements HYPERVISOR_suspend() so I  
assume you have it commented out because linux does not link?


HYPERVISOR_suspend() should not return until the domain has been  
"resored"

-JX


___
Xen-ppc-devel mailing list
Xen-ppc-devel@lists.xensource.com
http://lists.xensource.com/xen-ppc-devel


[XenPPC]:PPC kernel shutdown & resume over Xen

2006-09-26 Thread Yi Ge

We've tried to shutdown and resume the domU kernel based on the code from xen-tools and reboot.c.
The DomU has been suspended and got the status "s" in xm list, but we can't resume it. Who can tell us how the HYPERVISOR_suspend and its parameter "srec" works on the suspend/shutdown procedure? 

The code list here:
 
file:  linux-ppc-2.6.hg/drivers/xen/core/reboot.c
static int __do_suspend(void *ignore)
{
.
/*
 * We'll stop somewhere inside this hypercall. When it returns,
 * we'll start resuming after the restore.
 */
// HYPERVISOR_suspend(virt_to_mfn(xen_start_info));
		 -->// We don't know what's this parameter for, so comment it out in the routine calls.
printk("HYPERVISOR_shutdown(SHUTDOWN_suspend)\n");
HYPERVISOR_shutdown(SHUTDOWN_suspend);
		> Here the kernel suspended. 
printk("SUSPEND!!?? restoring...\n");
shutting_down = SHUTDOWN_INVALID;
//  set_fixmap(FIX_SHARED_INFO, xen_start_info->shared_info);
//  HYPERVISOR_shared_info = (shared_info_t *)fix_to_virt(FIX_SHARED_INFO);
		> Here to resume the kernel.
memset(empty_zero_page, 0, PAGE_SIZE);
gnttab_resume();
irq_resume();
//  time_resume();
//  switch_idle_mm();
//  __sti();
xencons_resume();
xenbus_resume();
smp_resume();
return err;
}

file:  xenppc-unstable.hg/tools/libxc/powerpc64/xc_ppc_linux_save.c
int
xc_linux_save(int xc_handle, int io_fd, uint32_t dom, uint32_t max_iters,
  uint32_t max_factor, uint32_t flags, int (*suspend)(int))
{
	...

/* This is a non-live suspend. Issue the call back to get the
   domain suspended */
	---> call the suspend routine to halt the domU kernel.
if (suspend_and_state(suspend, xc_handle, io_fd, dom, &info)) {
ERR("Domain appears not to have suspended");
goto out;
}

	  
	---> Here we expect to begin the resume procedure.
fprintf (stderr, "All memory is saved\n");
/* Success! */
rc = 0;


DPRINTF("Domain ready to be built.\n");

domctl.cmd = XEN_DOMCTL_setvcpucontext;
domctl.domain = (domid_t)dom;
domctl.u.vcpucontext.vcpu   = 0;
set_xen_guest_handle(domctl.u.vcpucontext.ctxt, &ctxt);
rc = xc_domctl(xc_handle, &domctl);

if (rc != 0) {
ERR("Couldn't build the domain");
goto out;
}

rc = 1;


 out:
	..
}
  
Best Regards,
Yi  Ge, PhD
IBM China Research Lab
Tel: (86-10) 58748024
Fax: (86-10) 58748230
E-Mail : [EMAIL PROTECTED]
Notes Mail: Yi Ge/China/[EMAIL PROTECTED]

Building 19 Zhongguancun Software Park, 
8 Dongbeiwang WestRoad, Haidian District, 
Beijing,P.R.C.100094


___
Xen-ppc-devel mailing list
Xen-ppc-devel@lists.xensource.com
http://lists.xensource.com/xen-ppc-devel