Skip to contentSkip to conversation

SHUTDOWN_suspend

DISCUSSION Jan Beulich 2 participants 2 messages Jan 17, 2008

lore
Share & tools
lore
#0 lore raw

Could someone explain to me the mechanisms by which the SHUTDOWN_suspend sub-command of SCHEDOP_shutdown is handled? I am namely having a hard time finding where the non-zero return code unmodified_drivers/linux-2.6/platform-pci/machine_reboot.c:bp_suspend() checks for gets injected.

Besides that it puzzles me that this is being used differently by the pv-on-hvm drivers and the ones on a pv kernel: the latter pass an extra argument, the consumer of which I again cannot seem to be able to find. I'm specifically interested if it is valid to replace the pv drivers' use (through HYPERVISOR_shutdown()) with a call to HYPERVISOR_suspend(), and whether in that case passing just any value for the 'srec' parameter is possible.

Thanks, Jan

#1 lore raw
Quoted 5 lines · Jan Beulich

Could someone explain to me the mechanisms by which the SHUTDOWN_suspend sub-command of SCHEDOP_shutdown is handled? I am namely having a hard time finding where the non-zero return code unmodified_drivers/linux-2.6/platform-pci/machine_reboot.c:bp_suspend() checks for gets injected.

The non-zero return code is injected by the tools: see tools/libxc/xc_resume.c:modify_returncode().

Quoted 7 lines

Besides that it puzzles me that this is being used differently by the pv-on-hvm drivers and the ones on a pv kernel: the latter pass an extra argument, the consumer of which I again cannot seem to be able to find. I'm specifically interested if it is valid to replace the pv drivers' use (through HYPERVISOR_shutdown()) with a call to HYPERVISOR_suspend(), and whether in that case passing just any value for the 'srec' parameter is possible.

The extra argument is not really consumed by the suspend hypercall. It ends up in %esi when the hypercall occurs and can then be pulled out of the vcpu's register context by the toolstack. This is simply a convention between tools and guest -- Xen itself is not really involved.

HVM guests do not pass this extra parameter to the tools, because it is not required.

-- Keir