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: <20081024110742.GD4620@osiris.boeblingen.de.ibm.com>
Date:	Fri, 24 Oct 2008 13:07:42 +0200
From:	Heiko Carstens <heiko.carstens@...ibm.com>
To:	walt <w41ter@...il.com>
Cc:	Rusty Russell <rusty@...tcorp.com.au>,
	Linux Kernel <linux-kernel@...r.kernel.org>
Subject: Re: commit a802dd0e breaks console keyboard input

On Thu, Oct 23, 2008 at 05:09:24PM -0700, walt wrote:
> Hi team,
>
> commit a802dd0eb5fc97a50cf1abb1f788a8f6cc5db635
> Author: Heiko Carstens <heiko.carstens@...ibm.com>
> Date:   Mon Oct 13 23:50:08 2008 +0200
>
>     Call init_workqueues before pre smp initcalls.
>
> This commit causes the console login prompt to ignore my keystrokes
> so I'm unable to log in (though ssh works fine).  Oddly, if I hit
> ctrl-alt-delete the machine does reboot, but no other keystrokes
> appear on the screen or have any effect that I can detect.
>
> No surprise that this problem appears only on my dual-core amd64
> machine, while the k7 single processor machine works normally.
>
> I've not seen anyone else complaining on the linux list, so maybe
> this is a BIOS bug on the affected machine?  It's an ECS mobo with
> a GeForce6100PM-M2 chipset, and I use a ps/2 keyboard.

Could you try the patch below and see if it makes any difference?
Thanks!

---
 include/linux/stop_machine.h |   16 +++++++++++-----
 init/main.c                  |    3 +--
 kernel/stop_machine.c        |    8 ++++++++
 3 files changed, 20 insertions(+), 7 deletions(-)

Index: linux-2.6/include/linux/stop_machine.h
===================================================================
--- linux-2.6.orig/include/linux/stop_machine.h
+++ linux-2.6/include/linux/stop_machine.h
@@ -8,6 +8,16 @@
 #include <linux/cpumask.h>
 #include <asm/system.h>
 
+static inline int stop_machine_simple(int (*fn)(void *), void *data,
+				      const cpumask_t *cpus)
+{
+	int ret;
+	local_irq_disable();
+	ret = fn(data);
+	local_irq_enable();
+	return ret;
+}
+
 #if defined(CONFIG_STOP_MACHINE) && defined(CONFIG_SMP)
 
 /**
@@ -40,11 +50,7 @@ int __stop_machine(int (*fn)(void *), vo
 static inline int stop_machine(int (*fn)(void *), void *data,
 			       const cpumask_t *cpus)
 {
-	int ret;
-	local_irq_disable();
-	ret = fn(data);
-	local_irq_enable();
-	return ret;
+	return stop_machine_simple(fn, data, cpus);
 }
 #endif /* CONFIG_SMP */
 #endif /* _LINUX_STOP_MACHINE */
Index: linux-2.6/kernel/stop_machine.c
===================================================================
--- linux-2.6.orig/kernel/stop_machine.c
+++ linux-2.6/kernel/stop_machine.c
@@ -43,6 +43,7 @@ static struct workqueue_struct *stop_mac
 static struct stop_machine_data active, idle;
 static const cpumask_t *active_cpus;
 static void *stop_machine_work;
+static int sm_initialized;
 
 static void set_state(enum stopmachine_state newstate)
 {
@@ -114,6 +115,10 @@ int __stop_machine(int (*fn)(void *), vo
 	struct work_struct *sm_work;
 	int i;
 
+	WARN_ON_ONCE(!sm_initialized);
+	if (num_online_cpus() == 1)
+		return stop_machine_simple(fn, data, cpus);
+
 	/* Set up initial state. */
 	mutex_lock(&lock);
 	num_threads = num_online_cpus();
@@ -157,7 +162,10 @@ EXPORT_SYMBOL_GPL(stop_machine);
 static int __init stop_machine_init(void)
 {
 	stop_machine_wq = create_rt_workqueue("kstop");
+	BUG_ON(!stop_machine_wq);
 	stop_machine_work = alloc_percpu(struct work_struct);
+	BUG_ON(!stop_machine_work);
+	sm_initialized = 1;
 	return 0;
 }
 early_initcall(stop_machine_init);
Index: linux-2.6/init/main.c
===================================================================
--- linux-2.6.orig/init/main.c
+++ linux-2.6/init/main.c
@@ -851,10 +851,9 @@ static int __init kernel_init(void * unu
 
 	cad_pid = task_pid(current);
 
-	init_workqueues();
-
 	smp_prepare_cpus(setup_max_cpus);
 
+	init_workqueues();
 	do_pre_smp_initcalls();
 	start_boot_trace();
 
--
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