diff options
Diffstat (limited to 'lib')
-rw-r--r-- | lib/Kconfig.debug | 1 | ||||
-rw-r--r-- | lib/Kconfig.kasan | 8 | ||||
-rw-r--r-- | lib/find_last_bit.c | 41 | ||||
-rw-r--r-- | lib/string.c | 2 |
4 files changed, 8 insertions, 44 deletions
diff --git a/lib/Kconfig.debug b/lib/Kconfig.debug index 17670573dda8..ba2b0c87e65b 100644 --- a/lib/Kconfig.debug +++ b/lib/Kconfig.debug | |||
@@ -1281,6 +1281,7 @@ config RCU_TORTURE_TEST_SLOW_INIT_DELAY | |||
1281 | int "How much to slow down RCU grace-period initialization" | 1281 | int "How much to slow down RCU grace-period initialization" |
1282 | range 0 5 | 1282 | range 0 5 |
1283 | default 3 | 1283 | default 3 |
1284 | depends on RCU_TORTURE_TEST_SLOW_INIT | ||
1284 | help | 1285 | help |
1285 | This option specifies the number of jiffies to wait between | 1286 | This option specifies the number of jiffies to wait between |
1286 | each rcu_node structure initialization. | 1287 | each rcu_node structure initialization. |
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 | |||
10 | help | 10 | help |
11 | Enables kernel address sanitizer - runtime memory debugger, | 11 | Enables kernel address sanitizer - runtime memory debugger, |
12 | designed to find out-of-bounds accesses and use-after-free bugs. | 12 | designed to find out-of-bounds accesses and use-after-free bugs. |
13 | This is strictly debugging feature. It consumes about 1/8 | 13 | This is strictly a debugging feature and it requires a gcc version |
14 | of available memory and brings about ~x3 performance slowdown. | 14 | of 4.9.2 or later. Detection of out of bounds accesses to stack or |
15 | global variables requires gcc 5.0 or later. | ||
16 | This feature consumes about 1/8 of available memory and brings about | ||
17 | ~x3 performance slowdown. | ||
15 | For better error detection enable CONFIG_STACKTRACE, | 18 | For better error detection enable CONFIG_STACKTRACE, |
16 | and add slub_debug=U to boot cmdline. | 19 | and add slub_debug=U to boot cmdline. |
17 | 20 | ||
@@ -40,6 +43,7 @@ config KASAN_INLINE | |||
40 | memory accesses. This is faster than outline (in some workloads | 43 | memory accesses. This is faster than outline (in some workloads |
41 | it gives about x2 boost over outline instrumentation), but | 44 | it gives about x2 boost over outline instrumentation), but |
42 | make kernel's .text size much bigger. | 45 | make kernel's .text size much bigger. |
46 | This requires a gcc version of 5.0 or later. | ||
43 | 47 | ||
44 | endchoice | 48 | endchoice |
45 | 49 | ||
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 @@ | |||
1 | /* find_last_bit.c: fallback find next bit implementation | ||
2 | * | ||
3 | * Copyright (C) 2008 IBM Corporation | ||
4 | * Written by Rusty Russell <rusty@rustcorp.com.au> | ||
5 | * (Inspired by David Howell's find_next_bit implementation) | ||
6 | * | ||
7 | * Rewritten by Yury Norov <yury.norov@gmail.com> to decrease | ||
8 | * size and improve performance, 2015. | ||
9 | * | ||
10 | * This program is free software; you can redistribute it and/or | ||
11 | * modify it under the terms of the GNU General Public License | ||
12 | * as published by the Free Software Foundation; either version | ||
13 | * 2 of the License, or (at your option) any later version. | ||
14 | */ | ||
15 | |||
16 | #include <linux/bitops.h> | ||
17 | #include <linux/bitmap.h> | ||
18 | #include <linux/export.h> | ||
19 | #include <linux/kernel.h> | ||
20 | |||
21 | #ifndef find_last_bit | ||
22 | |||
23 | unsigned long find_last_bit(const unsigned long *addr, unsigned long size) | ||
24 | { | ||
25 | if (size) { | ||
26 | unsigned long val = BITMAP_LAST_WORD_MASK(size); | ||
27 | unsigned long idx = (size-1) / BITS_PER_LONG; | ||
28 | |||
29 | do { | ||
30 | val &= addr[idx]; | ||
31 | if (val) | ||
32 | return idx * BITS_PER_LONG + __fls(val); | ||
33 | |||
34 | val = ~0ul; | ||
35 | } while (idx--); | ||
36 | } | ||
37 | return size; | ||
38 | } | ||
39 | EXPORT_SYMBOL(find_last_bit); | ||
40 | |||
41 | #endif | ||
diff --git a/lib/string.c b/lib/string.c index a5792019193c..bb3d4b6993c4 100644 --- a/lib/string.c +++ b/lib/string.c | |||
@@ -607,7 +607,7 @@ EXPORT_SYMBOL(memset); | |||
607 | void memzero_explicit(void *s, size_t count) | 607 | void memzero_explicit(void *s, size_t count) |
608 | { | 608 | { |
609 | memset(s, 0, count); | 609 | memset(s, 0, count); |
610 | barrier(); | 610 | barrier_data(s); |
611 | } | 611 | } |
612 | EXPORT_SYMBOL(memzero_explicit); | 612 | EXPORT_SYMBOL(memzero_explicit); |
613 | 613 | ||