* [PATCH]xen/acpi: make poweroff really work for pv-ops dom0
@ 2009-11-24 1:33 Wei, Gang
2009-11-24 19:32 ` Jeremy Fitzhardinge
2009-11-24 23:13 ` Jeremy Fitzhardinge
0 siblings, 2 replies; 6+ messages in thread
From: Wei, Gang @ 2009-11-24 1:33 UTC (permalink / raw)
To: Jeremy Fitzhardinge; +Cc: Xen-devel
[-- Attachment #1: Type: text/plain, Size: 1127 bytes --]
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.
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,
[-- Attachment #2: pvops-dom0-poweroff-fix.patch --]
[-- Type: application/octet-stream, Size: 1094 bytes --]
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.
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,
[-- Attachment #3: Type: text/plain, Size: 138 bytes --]
_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xensource.com
http://lists.xensource.com/xen-devel
^ permalink raw reply related [flat|nested] 6+ messages in thread
* Re: [PATCH]xen/acpi: make poweroff really work for pv-ops dom0
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
2009-11-25 2:38 ` Wei, Gang
2009-11-24 23:13 ` Jeremy Fitzhardinge
1 sibling, 1 reply; 6+ messages in thread
From: Jeremy Fitzhardinge @ 2009-11-24 19:32 UTC (permalink / raw)
To: Wei, Gang; +Cc: Xen-devel
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,
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH]xen/acpi: make poweroff really work for pv-ops dom0
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
@ 2009-11-24 23:13 ` Jeremy Fitzhardinge
2009-11-25 6:57 ` Wei, Gang
1 sibling, 1 reply; 6+ messages in thread
From: Jeremy Fitzhardinge @ 2009-11-24 23:13 UTC (permalink / raw)
To: Wei, Gang; +Cc: Xen-devel
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.
>
BTW, there have been several reports of hangs on reboot (I see it myself
on some systems). Could there be a similar problem in that area?
Thanks,
J
^ permalink raw reply [flat|nested] 6+ messages in thread
* RE: [PATCH]xen/acpi: make poweroff really work for pv-ops dom0
2009-11-24 19:32 ` Jeremy Fitzhardinge
@ 2009-11-25 2:38 ` Wei, Gang
0 siblings, 0 replies; 6+ messages in thread
From: Wei, Gang @ 2009-11-25 2:38 UTC (permalink / raw)
To: Jeremy Fitzhardinge; +Cc: Xen-devel
You are right. To make Xen poweroff really work for ACPI system, it requires dom0 to provide some assistance such as _SST invoke and so on.
Jimmy
Jeremy Fitzhardinge wrote:
> 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,
^ permalink raw reply [flat|nested] 6+ messages in thread
* RE: [PATCH]xen/acpi: make poweroff really work for pv-ops dom0
2009-11-24 23:13 ` Jeremy Fitzhardinge
@ 2009-11-25 6:57 ` Wei, Gang
2009-11-25 19:26 ` Jeremy Fitzhardinge
0 siblings, 1 reply; 6+ messages in thread
From: Wei, Gang @ 2009-11-25 6:57 UTC (permalink / raw)
To: Jeremy Fitzhardinge; +Cc: Xen-devel
Jeremy Fitzhardinge wrote:
> 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.
>>
>
> BTW, there have been several reports of hangs on reboot (I see it
> myself on some systems). Could there be a similar problem in that
> area?
Reboot is currently working well for me. Any log or description on the hangs?
Jimmy
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH]xen/acpi: make poweroff really work for pv-ops dom0
2009-11-25 6:57 ` Wei, Gang
@ 2009-11-25 19:26 ` Jeremy Fitzhardinge
0 siblings, 0 replies; 6+ messages in thread
From: Jeremy Fitzhardinge @ 2009-11-25 19:26 UTC (permalink / raw)
To: Wei, Gang; +Cc: Xen-devel
On 11/24/09 22:57, Wei, Gang wrote:
> Reboot is currently working well for me. Any log or description on the hangs?
>
The symptom is the system just hangs at the point where it prints
"rebooting...". I can drop into the Xen console and trigger a reboot,
but the kernel itself seems dead. Next time I'll get a context dump to
see where the kernel is sitting.
J
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2009-11-25 19:26 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
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
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
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.