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:	Sun, 03 Jun 2012 16:52:23 +0530
From:	"Srivatsa S. Bhat" <srivatsa.bhat@...ux.vnet.ibm.com>
To:	Yong Zhang <yong.zhang0@...il.com>
CC:	"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
	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 01/27] smpboot: Provide a generic method to boot secondary
 processors

On 06/03/2012 02:21 PM, Yong Zhang wrote:

> On Fri, Jun 01, 2012 at 05:39:27PM +0530, Srivatsa S. Bhat wrote:
>> +/* Implement the following functions in your architecture, as appropriate. */
>> +
>> +/**
>> + * __cpu_pre_starting()
>> + *
>> + * Implement whatever you need to do before the CPU_STARTING notifiers are
>> + * invoked. Note that the CPU_STARTING callbacks run *on* the cpu that is
>> + * coming up. So that cpu better be prepared! IOW, implement all the early
>> + * boot/init code for the cpu here. And do NOT enable interrupts.
>> + */
>> +#ifndef __cpu_pre_starting
> 
> Why the ifndef?
> 


In short, to avoid breaking build on x86.
We wanted to follow the x86 convention of having static inline functions in
arch/x86/include/asm/smp.h and use the smp_ops structure to route the calls
to x86 or xen as appropriate (see patch 4 in this series).

But __weak definitions interfere with that and break the build. Hence, we
followed what Linus suggested doing in a similar context:
https://lkml.org/lkml/2008/7/26/187

Regards,
Srivatsa S. Bhat

> 

>> +void __weak __cpu_pre_starting(void *arg) {}
>> +#endif
>> +
>> +/**
>> + *  __cpu_pre_online()
>> + *
>> + * Implement whatever you need to do before the upcoming CPU is set in the
>> + * cpu_online_mask. (Setting the cpu in the cpu_online_mask is like an
>> + * announcement that the cpu has come up, because it would be publicly
>> + * visible now). Again, don't enable interrupts.
>> + */
>> +#ifndef __cpu_pre_online
>> +void __weak __cpu_pre_online(void *arg) {}
>> +#endif
>> +


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