lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20210604140357.2602028-2-lee.jones@linaro.org>
Date:   Fri,  4 Jun 2021 15:03:53 +0100
From:   Lee Jones <lee.jones@...aro.org>
To:     lee.jones@...aro.org, linux@...linux.org.uk,
        catalin.marinas@....com, will@...nel.org, mark.rutland@....com,
        lorenzo.pieralisi@....com, sstabellini@...nel.org
Cc:     linux-arm-kernel@...ts.infradead.org, linux-kernel@...r.kernel.org,
        wsa+renesas@...g-engineering.com, linux@...ck-us.net,
        treding@...dia.com, arnd@...db.de, xen-devel@...ts.xenproject.org,
        patches@...linux.org.uk,
        Stefano Stabellini <stefano.stabellini@...citrix.com>
Subject: [PATCH 1/5] ARM: xen: Register with kernel restart handler

From: Guenter Roeck <linux@...ck-us.net>

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@...db.de>
Reviewed-by: Wolfram Sang <wsa+renesas@...g-engineering.com>
Reviewed-by: Stefano Stabellini <stefano.stabellini@...citrix.com>
Signed-off-by: Guenter Roeck <linux@...ck-us.net>
Signed-off-by: Thierry Reding <treding@...dia.com>
Signed-off-by: Lee Jones <lee.jones@...aro.org>
---
 arch/arm/xen/enlighten.c | 12 ++++++++++--
 1 file changed, 10 insertions(+), 2 deletions(-)

diff --git a/arch/arm/xen/enlighten.c b/arch/arm/xen/enlighten.c
index 8ad576ecd0f1d..7f1c106b746f8 100644
--- a/arch/arm/xen/enlighten.c
+++ b/arch/arm/xen/enlighten.c
@@ -29,6 +29,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>
@@ -181,11 +182,18 @@ void xen_reboot(int reason)
 	BUG_ON(rc);
 }
 
-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)
 {
 	xen_reboot(SHUTDOWN_reboot);
+
+	return NOTIFY_DONE;
 }
 
+static struct notifier_block xen_restart_nb = {
+	.notifier_call = xen_restart,
+	.priority = 192,
+};
 
 static void xen_power_off(void)
 {
@@ -404,7 +412,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.31.1

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ