xen-devel.lists.xenproject.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v2 2/6] ARM: xen: Register with kernel restart handler
       [not found] <1460688157-6551-1-git-send-email-linux@roeck-us.net>
@ 2016-04-15  2:42 ` Guenter Roeck
  2016-04-15 18:22   ` Stefano Stabellini
       [not found]   ` <alpine.DEB.2.10.1604151122090.3433@sstabellini-ThinkPad-X260>
  0 siblings, 2 replies; 4+ messages in thread
From: Guenter Roeck @ 2016-04-15  2:42 UTC (permalink / raw)
  To: Russell King, Catalin Marinas
  Cc: Stefano Stabellini, Wolfram Sang, linux-kernel,
	Geert Uytterhoeven, linux-arm-kernel, xen-devel, Guenter Roeck

Register with kernel restart handler instead of setting arm_pm_restart
directly.

Select a high priority of 192 to ensure that default restart handlers
are replaced if Xen is running.

Acked-by: Arnd Bergmann <arnd@arndb.de>
Reviewed-by: Wolfram Sang <wsa+renesas@sang-engineering.com>
Reviewed-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
---
v2: Rebased to v4.6-rc3, added Reviewed/by/Acked-by tags

 arch/arm/xen/enlighten.c | 13 +++++++++++--
 1 file changed, 11 insertions(+), 2 deletions(-)

diff --git a/arch/arm/xen/enlighten.c b/arch/arm/xen/enlighten.c
index 75cd7345c654..76a1d12fd27e 100644
--- a/arch/arm/xen/enlighten.c
+++ b/arch/arm/xen/enlighten.c
@@ -27,6 +27,7 @@
 #include <linux/cpu.h>
 #include <linux/console.h>
 #include <linux/pvclock_gtod.h>
+#include <linux/reboot.h>
 #include <linux/time64.h>
 #include <linux/timekeeping.h>
 #include <linux/timekeeper_internal.h>
@@ -193,14 +194,22 @@ after_register_vcpu_info:
 	put_cpu();
 }
 
-static void xen_restart(enum reboot_mode reboot_mode, const char *cmd)
+static int xen_restart(struct notifier_block *nb, unsigned long action,
+		       void *data)
 {
 	struct sched_shutdown r = { .reason = SHUTDOWN_reboot };
 	int rc;
 	rc = HYPERVISOR_sched_op(SCHEDOP_shutdown, &r);
 	BUG_ON(rc);
+
+	return NOTIFY_DONE;
 }
 
+static struct notifier_block xen_restart_nb = {
+	.notifier_call = xen_restart,
+	.priority = 192,
+};
+
 static void xen_power_off(void)
 {
 	struct sched_shutdown r = { .reason = SHUTDOWN_poweroff };
@@ -370,7 +379,7 @@ static int __init xen_pm_init(void)
 		return -ENODEV;
 
 	pm_power_off = xen_power_off;
-	arm_pm_restart = xen_restart;
+	register_restart_handler(&xen_restart_nb);
 	if (!xen_initial_domain()) {
 		struct timespec64 ts;
 		xen_read_wallclock(&ts);
-- 
2.5.0


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH v2 2/6] ARM: xen: Register with kernel restart handler
  2016-04-15  2:42 ` [PATCH v2 2/6] ARM: xen: Register with kernel restart handler Guenter Roeck
@ 2016-04-15 18:22   ` Stefano Stabellini
       [not found]   ` <alpine.DEB.2.10.1604151122090.3433@sstabellini-ThinkPad-X260>
  1 sibling, 0 replies; 4+ messages in thread
From: Stefano Stabellini @ 2016-04-15 18:22 UTC (permalink / raw)
  To: Guenter Roeck
  Cc: Stefano Stabellini, Russell King, Wolfram Sang, Catalin Marinas,
	linux-kernel, Geert Uytterhoeven, xen-devel, linux-arm-kernel

On Thu, 14 Apr 2016, Guenter Roeck wrote:
> Register with kernel restart handler instead of setting arm_pm_restart
> directly.
> 
> Select a high priority of 192 to ensure that default restart handlers
> are replaced if Xen is running.
> 
> Acked-by: Arnd Bergmann <arnd@arndb.de>
> Reviewed-by: Wolfram Sang <wsa+renesas@sang-engineering.com>
> Reviewed-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
> Signed-off-by: Guenter Roeck <linux@roeck-us.net>

Thanks. I assume this is going to go in via Russell or Catalin's tree
with the rest of your series?


> v2: Rebased to v4.6-rc3, added Reviewed/by/Acked-by tags
> 
>  arch/arm/xen/enlighten.c | 13 +++++++++++--
>  1 file changed, 11 insertions(+), 2 deletions(-)
> 
> diff --git a/arch/arm/xen/enlighten.c b/arch/arm/xen/enlighten.c
> index 75cd7345c654..76a1d12fd27e 100644
> --- a/arch/arm/xen/enlighten.c
> +++ b/arch/arm/xen/enlighten.c
> @@ -27,6 +27,7 @@
>  #include <linux/cpu.h>
>  #include <linux/console.h>
>  #include <linux/pvclock_gtod.h>
> +#include <linux/reboot.h>
>  #include <linux/time64.h>
>  #include <linux/timekeeping.h>
>  #include <linux/timekeeper_internal.h>
> @@ -193,14 +194,22 @@ after_register_vcpu_info:
>  	put_cpu();
>  }
>  
> -static void xen_restart(enum reboot_mode reboot_mode, const char *cmd)
> +static int xen_restart(struct notifier_block *nb, unsigned long action,
> +		       void *data)
>  {
>  	struct sched_shutdown r = { .reason = SHUTDOWN_reboot };
>  	int rc;
>  	rc = HYPERVISOR_sched_op(SCHEDOP_shutdown, &r);
>  	BUG_ON(rc);
> +
> +	return NOTIFY_DONE;
>  }
>  
> +static struct notifier_block xen_restart_nb = {
> +	.notifier_call = xen_restart,
> +	.priority = 192,
> +};
> +
>  static void xen_power_off(void)
>  {
>  	struct sched_shutdown r = { .reason = SHUTDOWN_poweroff };
> @@ -370,7 +379,7 @@ static int __init xen_pm_init(void)
>  		return -ENODEV;
>  
>  	pm_power_off = xen_power_off;
> -	arm_pm_restart = xen_restart;
> +	register_restart_handler(&xen_restart_nb);
>  	if (!xen_initial_domain()) {
>  		struct timespec64 ts;
>  		xen_read_wallclock(&ts);
> -- 
> 2.5.0
> 

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH v2 2/6] ARM: xen: Register with kernel restart handler
       [not found]   ` <alpine.DEB.2.10.1604151122090.3433@sstabellini-ThinkPad-X260>
@ 2016-04-15 19:35     ` Guenter Roeck
       [not found]     ` <20160415193544.GA2005@roeck-us.net>
  1 sibling, 0 replies; 4+ messages in thread
From: Guenter Roeck @ 2016-04-15 19:35 UTC (permalink / raw)
  To: Stefano Stabellini
  Cc: Russell King, Wolfram Sang, Catalin Marinas, linux-kernel,
	Geert Uytterhoeven, xen-devel, linux-arm-kernel

On Fri, Apr 15, 2016 at 11:22:36AM -0700, Stefano Stabellini wrote:
> On Thu, 14 Apr 2016, Guenter Roeck wrote:
> > Register with kernel restart handler instead of setting arm_pm_restart
> > directly.
> > 
> > Select a high priority of 192 to ensure that default restart handlers
> > are replaced if Xen is running.
> > 
> > Acked-by: Arnd Bergmann <arnd@arndb.de>
> > Reviewed-by: Wolfram Sang <wsa+renesas@sang-engineering.com>
> > Reviewed-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
> > Signed-off-by: Guenter Roeck <linux@roeck-us.net>
> 
> Thanks. I assume this is going to go in via Russell or Catalin's tree
> with the rest of your series?
> 
I would suggest Russell, if he is willing to pick it up, since it mostly
affects arm.

Guenter

> 
> > v2: Rebased to v4.6-rc3, added Reviewed/by/Acked-by tags
> > 
> >  arch/arm/xen/enlighten.c | 13 +++++++++++--
> >  1 file changed, 11 insertions(+), 2 deletions(-)
> > 
> > diff --git a/arch/arm/xen/enlighten.c b/arch/arm/xen/enlighten.c
> > index 75cd7345c654..76a1d12fd27e 100644
> > --- a/arch/arm/xen/enlighten.c
> > +++ b/arch/arm/xen/enlighten.c
> > @@ -27,6 +27,7 @@
> >  #include <linux/cpu.h>
> >  #include <linux/console.h>
> >  #include <linux/pvclock_gtod.h>
> > +#include <linux/reboot.h>
> >  #include <linux/time64.h>
> >  #include <linux/timekeeping.h>
> >  #include <linux/timekeeper_internal.h>
> > @@ -193,14 +194,22 @@ after_register_vcpu_info:
> >  	put_cpu();
> >  }
> >  
> > -static void xen_restart(enum reboot_mode reboot_mode, const char *cmd)
> > +static int xen_restart(struct notifier_block *nb, unsigned long action,
> > +		       void *data)
> >  {
> >  	struct sched_shutdown r = { .reason = SHUTDOWN_reboot };
> >  	int rc;
> >  	rc = HYPERVISOR_sched_op(SCHEDOP_shutdown, &r);
> >  	BUG_ON(rc);
> > +
> > +	return NOTIFY_DONE;
> >  }
> >  
> > +static struct notifier_block xen_restart_nb = {
> > +	.notifier_call = xen_restart,
> > +	.priority = 192,
> > +};
> > +
> >  static void xen_power_off(void)
> >  {
> >  	struct sched_shutdown r = { .reason = SHUTDOWN_poweroff };
> > @@ -370,7 +379,7 @@ static int __init xen_pm_init(void)
> >  		return -ENODEV;
> >  
> >  	pm_power_off = xen_power_off;
> > -	arm_pm_restart = xen_restart;
> > +	register_restart_handler(&xen_restart_nb);
> >  	if (!xen_initial_domain()) {
> >  		struct timespec64 ts;
> >  		xen_read_wallclock(&ts);
> > -- 
> > 2.5.0
> > 

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH v2 2/6] ARM: xen: Register with kernel restart handler
       [not found]     ` <20160415193544.GA2005@roeck-us.net>
@ 2016-04-15 21:10       ` Stefano Stabellini
  0 siblings, 0 replies; 4+ messages in thread
From: Stefano Stabellini @ 2016-04-15 21:10 UTC (permalink / raw)
  To: Guenter Roeck
  Cc: Stefano Stabellini, Russell King, Wolfram Sang, Catalin Marinas,
	linux-kernel, Geert Uytterhoeven, xen-devel, linux-arm-kernel

On Fri, 15 Apr 2016, Guenter Roeck wrote:
> On Fri, Apr 15, 2016 at 11:22:36AM -0700, Stefano Stabellini wrote:
> > On Thu, 14 Apr 2016, Guenter Roeck wrote:
> > > Register with kernel restart handler instead of setting arm_pm_restart
> > > directly.
> > > 
> > > Select a high priority of 192 to ensure that default restart handlers
> > > are replaced if Xen is running.
> > > 
> > > Acked-by: Arnd Bergmann <arnd@arndb.de>
> > > Reviewed-by: Wolfram Sang <wsa+renesas@sang-engineering.com>
> > > Reviewed-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
> > > Signed-off-by: Guenter Roeck <linux@roeck-us.net>
> > 
> > Thanks. I assume this is going to go in via Russell or Catalin's tree
> > with the rest of your series?
> > 
> I would suggest Russell, if he is willing to pick it up, since it mostly
> affects arm.

I am happy with that. In that case I'll remove this patch from my queue
not to have duplicates.


> 
> > 
> > > v2: Rebased to v4.6-rc3, added Reviewed/by/Acked-by tags
> > > 
> > >  arch/arm/xen/enlighten.c | 13 +++++++++++--
> > >  1 file changed, 11 insertions(+), 2 deletions(-)
> > > 
> > > diff --git a/arch/arm/xen/enlighten.c b/arch/arm/xen/enlighten.c
> > > index 75cd7345c654..76a1d12fd27e 100644
> > > --- a/arch/arm/xen/enlighten.c
> > > +++ b/arch/arm/xen/enlighten.c
> > > @@ -27,6 +27,7 @@
> > >  #include <linux/cpu.h>
> > >  #include <linux/console.h>
> > >  #include <linux/pvclock_gtod.h>
> > > +#include <linux/reboot.h>
> > >  #include <linux/time64.h>
> > >  #include <linux/timekeeping.h>
> > >  #include <linux/timekeeper_internal.h>
> > > @@ -193,14 +194,22 @@ after_register_vcpu_info:
> > >  	put_cpu();
> > >  }
> > >  
> > > -static void xen_restart(enum reboot_mode reboot_mode, const char *cmd)
> > > +static int xen_restart(struct notifier_block *nb, unsigned long action,
> > > +		       void *data)
> > >  {
> > >  	struct sched_shutdown r = { .reason = SHUTDOWN_reboot };
> > >  	int rc;
> > >  	rc = HYPERVISOR_sched_op(SCHEDOP_shutdown, &r);
> > >  	BUG_ON(rc);
> > > +
> > > +	return NOTIFY_DONE;
> > >  }
> > >  
> > > +static struct notifier_block xen_restart_nb = {
> > > +	.notifier_call = xen_restart,
> > > +	.priority = 192,
> > > +};
> > > +
> > >  static void xen_power_off(void)
> > >  {
> > >  	struct sched_shutdown r = { .reason = SHUTDOWN_poweroff };
> > > @@ -370,7 +379,7 @@ static int __init xen_pm_init(void)
> > >  		return -ENODEV;
> > >  
> > >  	pm_power_off = xen_power_off;
> > > -	arm_pm_restart = xen_restart;
> > > +	register_restart_handler(&xen_restart_nb);
> > >  	if (!xen_initial_domain()) {
> > >  		struct timespec64 ts;
> > >  		xen_read_wallclock(&ts);
> > > -- 
> > > 2.5.0
> > > 
> 

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2016-04-15 21:10 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <1460688157-6551-1-git-send-email-linux@roeck-us.net>
2016-04-15  2:42 ` [PATCH v2 2/6] ARM: xen: Register with kernel restart handler Guenter Roeck
2016-04-15 18:22   ` Stefano Stabellini
     [not found]   ` <alpine.DEB.2.10.1604151122090.3433@sstabellini-ThinkPad-X260>
2016-04-15 19:35     ` Guenter Roeck
     [not found]     ` <20160415193544.GA2005@roeck-us.net>
2016-04-15 21:10       ` Stefano Stabellini

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).