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  PHC 
Open Source and information security mailing list archives
 
Hash Suite for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:	Wed, 17 Nov 2010 14:37:35 -0800
From:	Randy Dunlap <randy.dunlap@...cle.com>
To:	Linus Torvalds <torvalds@...ux-foundation.org>
CC:	Linux Kernel Mailing List <linux-kernel@...r.kernel.org>,
	Arnd Bergmann <arnd@...db.de>
Subject: Re: BKL: remove extraneous #include <smp_lock.h>

On 11/17/10 14:23, Linus Torvalds wrote:
> On Wed, Nov 17, 2010 at 2:05 PM, Randy Dunlap <randy.dunlap@...cle.com> wrote:
>>
>> smp_lock.h was removed from hardirq.h.  smp_lock.h provided the function prototype
>> for kernel_locked().  Should source files now #include <linux/smp_lock.h> ?
>> even when not being built for SMP?
> 
> Hmm. I think that part was a mistake, but I suspect the simplest fix
> for it is to simply get rid of "kernel_locked()". It has no other
> users than the hardirq.h one, so let's just move it there.
> 
> Something like the attached?
> 
> NOTE! The reason I _only_ take the CONFIG_LOCK_KERNEL version from
> smp_lock.h is because:
> 
>  - LOCK_KERNEL is defined by init/Kconfig as "(SMP || PREEMPT) && BKL"
> 
>  - inside hardirq.h we only use "kernel_locked()" inside "PREEMPT && BKL"
> 
>  - so "PREEMPT && BKL" implies "LOCK_KERNEL"
> 
>  - so the !LOCK_KERNEL kernel_locked() case is irrelevant.
> 
> unless I did a thinko somewhere.
> 
> Does this work in all configurations? TOTALLY UNTESTED! Caveat emptor.

It goes from one use of kernel_locked in *.[ch] to no uses of kernel_locked(),
so yes, it works for me.  (I did one previously-failing build with this patch,
and it built with no errors.)

Acked-by: Randy Dunlap <randy.dunlap@...cle.com>

-- 
~Randy
*** Remember to use Documentation/SubmitChecklist when testing your code ***
--
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