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]
Date:	Fri, 28 Sep 2007 09:22:34 -0400
From:	Mark Lord <lkml@....ca>
To:	"Rafael J. Wysocki" <rjw@...k.pl>
Cc:	Len Brown <lenb@...nel.org>,
	Linux Kernel <linux-kernel@...r.kernel.org>,
	simon.derr@...l.net
Subject: Re: Problems with SMP & ACPI powering off

Rafael J. Wysocki wrote:
> On Friday, 28 September 2007 06:57, Len Brown wrote:
>> On Thursday 27 September 2007 18:00, Rafael J. Wysocki wrote:
>>> On Thursday, 27 September 2007 23:29, Mark Lord wrote:
>>>> Question:  do we disable all CPUs except 0 when doing ACPI power off?
>>> No, but we should.
>> We used to.
>> It is absolutely mandatory -- else it confuses the BIOS on some boards
>> b/c it isn't expecting SMM to get entered from other than cpu0.
> 
> Can we use the CPU hotplug for that, like in the suspend/hibernation case?

Well, so far it's working:  about ten poweroffs since I patched it,
and no issues with any of them.  Prior to that, it seemed like about
one in five poweroffs wouldn't (power off).

It'll take a lot more testing to confirm, though.

What can I call to determine if more than one CPU is enabled, anyway?

Here's the hack I'm using here, very situation (2 cores) specific,
and it still has some printk's leftover with a sleep so I have time
to read them before the lights go out.  :)

--- old/arch/i386/kernel/reboot.c	2007-09-27 17:17:00.000000000 -0400
+++ linux/arch/i386/kernel/reboot.c	2007-09-27 17:15:35.000000000 -0400
@@ -393,8 +393,22 @@
 	.halt = native_machine_halt,
 };
 
+static void kill_cpu1(void)
+{
+	extern int cpu_down(unsigned int cpu);
+
+	printk(KERN_EMERG "kill_cpu1: was running on CPU%d\n", smp_processor_id());
+	/* Some bioses don't like being called from CPU != 0 */
+	set_cpus_allowed(current, cpumask_of_cpu(0));
+	printk(KERN_EMERG "kill_cpu1: now running on CPU%d\n", smp_processor_id());
+	cpu_down(1);
+	printk(KERN_EMERG "kill_cpu1: done\n");
+	msleep(1000);
+}
+
 void machine_power_off(void)
 {
+	(void)kill_cpu1();
 	machine_ops.power_off();
 }
 
-
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