diff options
Diffstat (limited to 'lib')
| -rw-r--r-- | lib/Kconfig.kasan | 8 | ||||
| -rw-r--r-- | lib/find_last_bit.c | 41 | 
2 files changed, 6 insertions, 43 deletions
| diff --git a/lib/Kconfig.kasan b/lib/Kconfig.kasan index 4fecaedc80a2..777eda7d1ab4 100644 --- a/lib/Kconfig.kasan +++ b/lib/Kconfig.kasan @@ -10,8 +10,11 @@ config KASAN  	help  	  Enables kernel address sanitizer - runtime memory debugger,  	  designed to find out-of-bounds accesses and use-after-free bugs. -	  This is strictly debugging feature. It consumes about 1/8 -	  of available memory and brings about ~x3 performance slowdown. +	  This is strictly a debugging feature and it requires a gcc version +	  of 4.9.2 or later. Detection of out of bounds accesses to stack or +	  global variables requires gcc 5.0 or later. +	  This feature consumes about 1/8 of available memory and brings about +	  ~x3 performance slowdown.  	  For better error detection enable CONFIG_STACKTRACE,  	  and add slub_debug=U to boot cmdline. @@ -40,6 +43,7 @@ config KASAN_INLINE  	  memory accesses. This is faster than outline (in some workloads  	  it gives about x2 boost over outline instrumentation), but  	  make kernel's .text size much bigger. +	  This requires a gcc version of 5.0 or later.  endchoice diff --git a/lib/find_last_bit.c b/lib/find_last_bit.c deleted file mode 100644 index 3e3be40c6a6e..000000000000 --- a/lib/find_last_bit.c +++ /dev/null @@ -1,41 +0,0 @@ -/* find_last_bit.c: fallback find next bit implementation - * - * Copyright (C) 2008 IBM Corporation - * Written by Rusty Russell <rusty@rustcorp.com.au> - * (Inspired by David Howell's find_next_bit implementation) - * - * Rewritten by Yury Norov <yury.norov@gmail.com> to decrease - * size and improve performance, 2015. - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version - * 2 of the License, or (at your option) any later version. - */ - -#include <linux/bitops.h> -#include <linux/bitmap.h> -#include <linux/export.h> -#include <linux/kernel.h> - -#ifndef find_last_bit - -unsigned long find_last_bit(const unsigned long *addr, unsigned long size) -{ -	if (size) { -		unsigned long val = BITMAP_LAST_WORD_MASK(size); -		unsigned long idx = (size-1) / BITS_PER_LONG; - -		do { -			val &= addr[idx]; -			if (val) -				return idx * BITS_PER_LONG + __fls(val); - -			val = ~0ul; -		} while (idx--); -	} -	return size; -} -EXPORT_SYMBOL(find_last_bit); - -#endif | 
