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-next>] [day] [month] [year] [list]
Message-Id: <1448279946-19975-1-git-send-email-nyushchenko@dev.rtsoft.ru>
Date:	Mon, 23 Nov 2015 14:59:06 +0300
From:	nyushchenko@....rtsoft.ru
To:	Russell King <linux@....linux.org.uk>,
	Will Deacon <will.deacon@....com>,
	Ard Biesheuvel <ard.biesheuvel@...aro.org>,
	Rob Herring <robh@...nel.org>,
	Ian Campbell <ian.campbell@...rix.com>,
	Pavel Machek <pavel@....cz>, Mason <slash.tmp@...e.fr>,
	Paul Kocialkowski <contact@...lk.fr>,
	Masahiro Yamada <yamada.m@...panasonic.com>
Cc:	linux-arm-kernel@...ts.infradead.org, linux-kernel@...r.kernel.org,
	nyushchenko@....rtsoft.ru, kuznetsovg@....rtsoft.ru
Subject: [RFC/PATCH] arm: do not skip SMP init calls on SMP_ON_UP case

From: Nikita Yushchenko <nyushchenko@....rtsoft.ru>

While running an imx6s boasrd, I got following message in boot log:

[    0.032414] CPU1: failed to boot: -38

This looked strange: imx6s is singe-core and kernel perfectly knows
that. However, for some reason it tries to initialize CPU 1?

I found this to be caused by
- CONFIG_SMP_ON_UP successfully detects that system is single core,
- this causes is_smp() to return false,
- this causes setup_arch() to skip smp_init_cpus() call,
- this skips board-specific code that sets cpu_possible mask.

By looking at the code, I don't understand why several initialization
routines are called only in is_smp() case - while other kernel
CONFIG_SMP code does not check is_smp() every time and uses what should
have been initialized by skipped routines.

Thus I propose making these init calls regardless of is_smp() check.
Calls are already conditional on CONFIG_SMP. This will make init and
usage sides consistent.

Signed-off-by: Nikita Yushchenko <nyushchenko@....rtsoft.ru>
---
 arch/arm/kernel/setup.c | 16 +++++++---------
 1 file changed, 7 insertions(+), 9 deletions(-)

diff --git a/arch/arm/kernel/setup.c b/arch/arm/kernel/setup.c
index 20edd34..8a14fce 100644
--- a/arch/arm/kernel/setup.c
+++ b/arch/arm/kernel/setup.c
@@ -980,16 +980,14 @@ void __init setup_arch(char **cmdline_p)
 	psci_dt_init();
 	xen_early_init();
 #ifdef CONFIG_SMP
-	if (is_smp()) {
-		if (!mdesc->smp_init || !mdesc->smp_init()) {
-			if (psci_smp_available())
-				smp_set_ops(&psci_smp_ops);
-			else if (mdesc->smp)
-				smp_set_ops(mdesc->smp);
-		}
-		smp_init_cpus();
-		smp_build_mpidr_hash();
+	if (!mdesc->smp_init || !mdesc->smp_init()) {
+		if (psci_smp_available())
+			smp_set_ops(&psci_smp_ops);
+		else if (mdesc->smp)
+			smp_set_ops(mdesc->smp);
 	}
+	smp_init_cpus();
+	smp_build_mpidr_hash();
 #endif
 
 	if (!is_smp())
-- 
2.1.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