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: <4FC8B1C6.4050503@linux.vnet.ibm.com>
Date:	Fri, 01 Jun 2012 17:42:54 +0530
From:	"Srivatsa S. Bhat" <srivatsa.bhat@...ux.vnet.ibm.com>
To:	"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>
CC:	Tony Luck <tony.luck@...el.com>,
	Ralf Baechle <ralf@...ux-mips.org>,
	Benjamin Herrenschmidt <benh@...nel.crashing.org>,
	Paul Mundt <lethal@...ux-sh.org>,
	Chris Metcalf <cmetcalf@...era.com>,
	Konrad Rzeszutek Wilk <konrad.wilk@...cle.com>,
	Mike Frysinger <vapier@...too.org>,
	Hirokazu Takata <takata@...ux-m32r.org>,
	Richard Kuo <rkuo@...eaurora.org>,
	David Howells <dhowells@...hat.com>,
	Bob Liu <lliubbo@...il.com>,
	"David S. Miller" <davem@...emloft.net>,
	Richard Weinberger <richard@....at>,
	Jesper Nilsson <jesper.nilsson@...s.com>,
	"James E.J. Bottomley" <jejb@...isc-linux.org>,
	Martin Schwidefsky <schwidefsky@...ibm.com>,
	Russell King <linux@....linux.org.uk>,
	Matt Turner <mattst88@...il.com>, nikunj@...ux.vnet.ibm.com
Subject: Re: [PATCH 02/27] smpboot: Add provisions for arch-specific locking
 around cpu_online_mask

Adding arch maintainers to Cc, which I had missed earlier. No changes to the 
patch.

======

From: Srivatsa S. Bhat <srivatsa.bhat@...ux.vnet.ibm.com>
Subject: [PATCH 02/27] smpboot: Add provisions for arch-specific locking around cpu_online_mask

We want to make smp booting as generic as possible and remove code
duplication in arch/ directories.

While manipulating the cpu_online_mask, x86 uses an additional lock, i.e.,
'vector_lock'. So provide a generic way to implement such arch-specific
extra locking, by providing weakly defined functions arch_vector_lock()
and arch_vector_unlock() which can be overriden by different architectures
suitably.

Cc: Thomas Gleixner <tglx@...utronix.de>
Cc: Suresh Siddha <suresh.b.siddha@...el.com>
Cc: Venkatesh Pallipadi <venki@...gle.com>
Cc: Tony Luck <tony.luck@...el.com>
Cc: Ralf Baechle <ralf@...ux-mips.org>
Cc: Benjamin Herrenschmidt <benh@...nel.crashing.org>
Cc: Paul Mundt <lethal@...ux-sh.org>
Cc: Chris Metcalf <cmetcalf@...era.com>
Cc: Konrad Rzeszutek Wilk <konrad.wilk@...cle.com>
Cc: Mike Frysinger <vapier@...too.org>
Cc: Hirokazu Takata <takata@...ux-m32r.org>
Cc: Richard Kuo <rkuo@...eaurora.org>
Cc: David Howells <dhowells@...hat.com>
Cc: Bob Liu <lliubbo@...il.com>
Cc: "David S. Miller" <davem@...emloft.net>
Cc: Richard Weinberger <richard@....at>
Cc: Jesper Nilsson <jesper.nilsson@...s.com>
Cc: "James E.J. Bottomley" <jejb@...isc-linux.org>
Cc: Martin Schwidefsky <schwidefsky@...ibm.com>
Cc: Russell King <linux@....linux.org.uk>
Cc: Matt Turner <mattst88@...il.com>
Signed-off-by: Srivatsa S. Bhat <srivatsa.bhat@...ux.vnet.ibm.com>
---

 kernel/smpboot.c |   11 ++++++++++-
 1 files changed, 10 insertions(+), 1 deletions(-)

diff --git a/kernel/smpboot.c b/kernel/smpboot.c
index 6c26133..5ae1805 100644
--- a/kernel/smpboot.c
+++ b/kernel/smpboot.c
@@ -107,6 +107,13 @@ void __weak __cpu_pre_online(void *arg) {}
 void __weak __cpu_post_online(void *arg) {}
 #endif
 
+/*
+ * Optional arch-specific locking for manipulating cpu_online_mask while
+ * bringing up secondary CPUs.
+ */
+void __weak arch_vector_lock(void) {}
+void __weak arch_vector_unlock(void) {}
+
 
 /**
  * smpboot_start_secondary - Generic way to boot secondary processors
@@ -129,8 +136,10 @@ void __cpuinit smpboot_start_secondary(void *arg)
 
 	__cpu_pre_online(arg);
 
-	/* Set the CPU in the cpu_online_mask */
+	/* Set the CPU in the cpu_online_mask with required locks held */
+	arch_vector_lock();
 	set_cpu_online(cpu, true);
+	arch_vector_unlock();
 
 	__cpu_post_online(arg);
 


--
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