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 for Android: free password hash cracker in your pocket
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Date:	Tue, 29 Jan 2013 16:20:15 -0700
From:	Stephen Warren <swarren@...dotorg.org>
To:	"Rafael J. Wysocki" <rjw@...k.pl>, Len Brown <len.brown@...el.com>,
	Pavel Machek <pavel@....cz>
Cc:	linux-pm@...r.kernel.org, linux-kernel@...r.kernel.org,
	Stephen Warren <swarren@...dia.com>
Subject: [PATCH] PM / Hibernate: remove duplicate disable_nonboot_cpus()

From: Stephen Warren <swarren@...dia.com>

Within hibernate.c, hibernation_platform_enter() is only called from
power_down(), which in turn is only called by hibernate() after having
called hibernation_snapshot(), which in turn calls create_image() which
in turn calls disable_nonboot_cpus().

Elsewhere, snapshot_ioctl() allows hibernation_snapshot() and
hibernation_platform_enter() to be invoked via separate IOCTLs, but I
assume the rule is that SNAPSHOT_CREATE_IMAGE must be executed before
IOCTL SNAPSHOT_POWER_OFF, and hence the same ordering applies.

This means that disable_nonboot_cpus() must have been called already
before hibernation_platform_enter() is entered, and hence the call there
is redundant, so remove it.

Signed-off-by: Stephen Warren <swarren@...dia.com>
---
Note: I have compile-tested this on x86-64, but have not attempted to test
it in any way; I'm proposing this patch following code inspection.
---
 kernel/power/hibernate.c |    5 -----
 1 file changed, 5 deletions(-)

diff --git a/kernel/power/hibernate.c b/kernel/power/hibernate.c
index b26f5f1..4ddeacc 100644
--- a/kernel/power/hibernate.c
+++ b/kernel/power/hibernate.c
@@ -537,10 +537,6 @@ int hibernation_platform_enter(void)
 	if (error)
 		goto Platform_finish;
 
-	error = disable_nonboot_cpus();
-	if (error)
-		goto Platform_finish;
-
 	local_irq_disable();
 	syscore_suspend();
 	if (pm_wakeup_pending()) {
@@ -555,7 +551,6 @@ int hibernation_platform_enter(void)
  Power_up:
 	syscore_resume();
 	local_irq_enable();
-	enable_nonboot_cpus();
 
  Platform_finish:
 	hibernation_ops->finish();
-- 
1.7.10.4

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ