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:	Tue, 30 Dec 2014 00:06:22 -0500
From:	Pranith Kumar <bobby.prani@...il.com>
To:	Scott Wood <scottwood@...escale.com>
Cc:	Benjamin Herrenschmidt <benh@...nel.crashing.org>,
	Paul Mackerras <paulus@...ba.org>,
	Michael Ellerman <mpe@...erman.id.au>,
	Martin Schwidefsky <schwidefsky@...ibm.com>,
	Heiko Carstens <heiko.carstens@...ibm.com>,
	"supporter:S390" <linux390@...ibm.com>,
	Lai Jiangshan <laijs@...fujitsu.com>,
	"Paul E. McKenney" <paulmck@...ux.vnet.ibm.com>,
	Josh Triplett <josh@...htriplett.org>,
	Steven Rostedt <rostedt@...dmis.org>,
	Mathieu Desnoyers <mathieu.desnoyers@...icios.com>,
	Anton Blanchard <anton@...ba.org>,
	Andy Fleming <afleming@...escale.com>,
	Tiejun Chen <tiejun.chen@...driver.com>,
	Daniel Walter <dwalter@...gle.com>,
	Jens Freimann <jfrei@...ux.vnet.ibm.com>,
	Christian Borntraeger <borntraeger@...ibm.com>,
	"open list:LINUX FOR POWERPC..." <linuxppc-dev@...ts.ozlabs.org>,
	open list <linux-kernel@...r.kernel.org>,
	"open list:S390" <linux-s390@...r.kernel.org>
Subject: Re: [PATCH] srcu: Isolate srcu sections using CONFIG_SRCU

On Mon, Dec 29, 2014 at 6:05 PM, Scott Wood <scottwood@...escale.com> wrote:
> On Sat, 2014-12-27 at 12:17 -0500, Pranith Kumar wrote:
>> Isolate the SRCU functions and data structures within CONFIG_SRCU so that there
>> is a compile time failure if srcu is used when not enabled. This was decided to
>> be better than waiting until link time for a failure to occur.
>
> Yes, false positives and extra ifdefs are so much better. :-P
>
> Why not just ifdef the functions/macros, and leave the types alone?  If
> you're worried about direct access to struct members, you could even
> ifdef the members away while leaving the struct itself.  It is not
> normal practice in Linux to need ifdefs around #includes.

Yup, totally agree that this is not ideal. The idea here is to not
even compile the structure for tinification purposes. ifdefs for
headers are ugly, but given the current code structure, I was not able
to figure out any other way around it without major overhaul.

>
>> There are places which include kvm headers and utilize kvm data structures
>> without checking if KVM is enabled. In two such archs(s390, ppc64), the current
>> patch makes the uses of KVM conditional on KVM being enabled. The other option,
>> which is to enable KVM unconditionally seemed a bit too much as we could easily
>> figure out KVM only parts and enclose them in ifdefs.
>
> Maybe not so easy (mpc85xx_smp_defconfig with NOTIFY stuff turned off so
> that SRCU gets deselected):
>
> In file included from /home/scott/fsl/git/linux/upstream/arch/powerpc/include/asm/kvm_ppc.h:30:0,
>                  from /home/scott/fsl/git/linux/upstream/arch/powerpc/kernel/smp.c:39:
> /home/scott/fsl/git/linux/upstream/include/linux/kvm_host.h:366:21: error: field 'srcu' has incomplete type
> /home/scott/fsl/git/linux/upstream/include/linux/kvm_host.h:367:21: error: field 'irq_srcu' has incomplete type
> /home/scott/fsl/git/linux/upstream/scripts/Makefile.build:257: recipe for target 'arch/powerpc/kernel/smp.o' failed
> make[2]: *** [arch/powerpc/kernel/smp.o] Error 1
> /home/scott/fsl/git/linux/upstream/Makefile:955: recipe for target 'arch/powerpc/kernel' failed
> make[1]: *** [arch/powerpc/kernel] Error 2
> make[1]: *** Waiting for unfinished jobs....
>
> Are you sure KVM is the only SRCU user so impacted?  It's also likely
> that new such problems get introduced, because most people are going to
> have SRCU enabled and thus not notice the breakage they're adding.

Well, it is the major one which I encountered until now. There might
be other problems lurking which I will gladly try to fix if and when
they are reported.

>
> There's also at least one place that needs to be fixed, that currently
> expects to get other headers indirectly via srcu.h:
>
> /home/scott/fsl/git/linux/upstream/lib/assoc_array.c: In function 'assoc_array_apply_edit':
> /home/scott/fsl/git/linux/upstream/lib/assoc_array.c:1425:2: error: implicit declaration of function 'call_rcu' [-Werror=implicit-function-declaration]
> cc1: some warnings being treated as errors
> /home/scott/fsl/git/linux/upstream/scripts/Makefile.build:257: recipe for target 'lib/assoc_array.o' failed

I will send a patch fixing this(need to use rcupdate.h here
explicitly). Thanks for reporting these!

>
> -Scott
>
>



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