All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jeremy Fitzhardinge <jeremy@goop.org>
To: "Wei, Gang" <gang.wei@intel.com>
Cc: Xen-devel <xen-devel@lists.xensource.com>
Subject: Re: [PATCH]xen/acpi: make poweroff really work for pv-ops dom0
Date: Tue, 24 Nov 2009 11:32:52 -0800	[thread overview]
Message-ID: <4B0C34E4.9020108@goop.org> (raw)
In-Reply-To: <8FED46E8A9CA574792FC7AACAC38FE7714FEC8776E@PDSMSX501.ccr.corp.intel.com>

On 11/23/09 17:33, Wei, Gang wrote:
> xen/acpi: Make poweroff really work for pv-ops dom0
>
> sched_op(SHUTDOWN_poweroff) hypercall will only halt all physical cpus without
> really poweroff the system. Use pm_power_off fn to achieve it.
>   

It seems unfortunate that Xen can't actually implement SHUTDOWN_poweroff
in a manner that the name suggests ;)  But it can't because it may need
to interpret _SST to do it...

Thanks,
    J

> Signed-off-by: Wei Gang <gang.wei@intel.com>
>
> diff --git a/arch/x86/xen/enlighten.c b/arch/x86/xen/enlighten.c
> index ecb9b0d..d9fd3f4 100644
> --- a/arch/x86/xen/enlighten.c
> +++ b/arch/x86/xen/enlighten.c
> @@ -1058,6 +1058,14 @@ static void xen_machine_halt(void)
>  	xen_reboot(SHUTDOWN_poweroff);
>  }
>  
> +static void xen_machine_power_off(void)
> +{
> +	if (pm_power_off) 
> +		pm_power_off();
> +	else
> +		xen_reboot(SHUTDOWN_poweroff);
> +}
> +
>  static void xen_crash_shutdown(struct pt_regs *regs)
>  {
>  	xen_reboot(SHUTDOWN_crash);
> @@ -1066,7 +1074,7 @@ static void xen_crash_shutdown(struct pt_regs *regs)
>  static const struct machine_ops __initdata xen_machine_ops = {
>  	.restart = xen_restart,
>  	.halt = xen_machine_halt,
> -	.power_off = xen_machine_halt,
> +	.power_off = xen_machine_power_off,
>  	.shutdown = xen_machine_halt,
>  	.crash_shutdown = xen_crash_shutdown,
>  	.emergency_restart = xen_emergency_restart,

  reply	other threads:[~2009-11-24 19:32 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-11-24  1:33 [PATCH]xen/acpi: make poweroff really work for pv-ops dom0 Wei, Gang
2009-11-24 19:32 ` Jeremy Fitzhardinge [this message]
2009-11-25  2:38   ` Wei, Gang
2009-11-24 23:13 ` Jeremy Fitzhardinge
2009-11-25  6:57   ` Wei, Gang
2009-11-25 19:26     ` Jeremy Fitzhardinge

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4B0C34E4.9020108@goop.org \
    --to=jeremy@goop.org \
    --cc=gang.wei@intel.com \
    --cc=xen-devel@lists.xensource.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.