aboutsummaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorH. Peter Anvin <hpa@linux.intel.com>2014-02-07 14:27:30 -0500
committerH. Peter Anvin <hpa@linux.intel.com>2014-02-07 14:27:30 -0500
commita3b072cd180c12e8fe0ece9487b9065808327640 (patch)
tree62b982041be84748852d77cdf6ca5639ef40858f /lib
parent75a1ba5b2c529db60ca49626bcaf0bddf4548438 (diff)
parent081cd62a010f97b5bc1d2b0cd123c5abc692b68a (diff)
Merge tag 'efi-urgent' into x86/urgent
* Avoid WARN_ON() when mapping BGRT on Baytrail (EFI 32-bit). Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
Diffstat (limited to 'lib')
-rw-r--r--lib/Kconfig.debug50
-rw-r--r--lib/Makefile4
-rw-r--r--lib/assoc_array.c2
-rw-r--r--lib/average.c6
-rw-r--r--lib/cmdline.c14
-rw-r--r--lib/cpumask.c4
-rw-r--r--lib/decompress_unlz4.c1
-rw-r--r--lib/dma-debug.c197
-rw-r--r--lib/dynamic_debug.c29
-rw-r--r--lib/flex_array.c7
-rw-r--r--lib/fonts/Kconfig6
-rw-r--r--lib/genalloc.c5
-rw-r--r--lib/hash.c39
-rw-r--r--lib/kobject.c96
-rw-r--r--lib/kobject_uevent.c10
-rw-r--r--lib/kstrtox.c1
-rw-r--r--lib/parser.c62
-rw-r--r--lib/percpu-refcount.c3
-rw-r--r--lib/percpu_ida.c21
-rw-r--r--lib/rbtree_test.c13
-rw-r--r--lib/reciprocal_div.c24
-rw-r--r--lib/scatterlist.c3
-rw-r--r--lib/show_mem.c6
-rw-r--r--lib/swiotlb.c38
-rw-r--r--lib/test_module.c33
-rw-r--r--lib/test_user_copy.c110
-rw-r--r--lib/vsprintf.c33
27 files changed, 650 insertions, 167 deletions
diff --git a/lib/Kconfig.debug b/lib/Kconfig.debug
index 6982094a7e74..dbf94a7d25a8 100644
--- a/lib/Kconfig.debug
+++ b/lib/Kconfig.debug
@@ -1556,17 +1556,6 @@ config PROVIDE_OHCI1394_DMA_INIT
1556 1556
1557 See Documentation/debugging-via-ohci1394.txt for more information. 1557 See Documentation/debugging-via-ohci1394.txt for more information.
1558 1558
1559config FIREWIRE_OHCI_REMOTE_DMA
1560 bool "Remote debugging over FireWire with firewire-ohci"
1561 depends on FIREWIRE_OHCI
1562 help
1563 This option lets you use the FireWire bus for remote debugging
1564 with help of the firewire-ohci driver. It enables unfiltered
1565 remote DMA in firewire-ohci.
1566 See Documentation/debugging-via-ohci1394.txt for more information.
1567
1568 If unsure, say N.
1569
1570config BUILD_DOCSRC 1559config BUILD_DOCSRC
1571 bool "Build targets in Documentation/ tree" 1560 bool "Build targets in Documentation/ tree"
1572 depends on HEADERS_CHECK 1561 depends on HEADERS_CHECK
@@ -1584,8 +1573,43 @@ config DMA_API_DEBUG
1584 With this option you will be able to detect common bugs in device 1573 With this option you will be able to detect common bugs in device
1585 drivers like double-freeing of DMA mappings or freeing mappings that 1574 drivers like double-freeing of DMA mappings or freeing mappings that
1586 were never allocated. 1575 were never allocated.
1587 This option causes a performance degredation. Use only if you want 1576
1588 to debug device drivers. If unsure, say N. 1577 This also attempts to catch cases where a page owned by DMA is
1578 accessed by the cpu in a way that could cause data corruption. For
1579 example, this enables cow_user_page() to check that the source page is
1580 not undergoing DMA.
1581
1582 This option causes a performance degradation. Use only if you want to
1583 debug device drivers and dma interactions.
1584
1585 If unsure, say N.
1586
1587config TEST_MODULE
1588 tristate "Test module loading with 'hello world' module"
1589 default n
1590 depends on m
1591 help
1592 This builds the "test_module" module that emits "Hello, world"
1593 on printk when loaded. It is designed to be used for basic
1594 evaluation of the module loading subsystem (for example when
1595 validating module verification). It lacks any extra dependencies,
1596 and will not normally be loaded by the system unless explicitly
1597 requested by name.
1598
1599 If unsure, say N.
1600
1601config TEST_USER_COPY
1602 tristate "Test user/kernel boundary protections"
1603 default n
1604 depends on m
1605 help
1606 This builds the "test_user_copy" module that runs sanity checks
1607 on the copy_to/from_user infrastructure, making sure basic
1608 user/kernel boundary testing is working. If it fails to load,
1609 a regression has been detected in the user/kernel memory boundary
1610 protections.
1611
1612 If unsure, say N.
1589 1613
1590source "samples/Kconfig" 1614source "samples/Kconfig"
1591 1615
diff --git a/lib/Makefile b/lib/Makefile
index 04944e9993ed..48140e3ba73f 100644
--- a/lib/Makefile
+++ b/lib/Makefile
@@ -26,11 +26,13 @@ obj-y += bcd.o div64.o sort.o parser.o halfmd4.o debug_locks.o random32.o \
26 bust_spinlocks.o hexdump.o kasprintf.o bitmap.o scatterlist.o \ 26 bust_spinlocks.o hexdump.o kasprintf.o bitmap.o scatterlist.o \
27 gcd.o lcm.o list_sort.o uuid.o flex_array.o iovec.o clz_ctz.o \ 27 gcd.o lcm.o list_sort.o uuid.o flex_array.o iovec.o clz_ctz.o \
28 bsearch.o find_last_bit.o find_next_bit.o llist.o memweight.o kfifo.o \ 28 bsearch.o find_last_bit.o find_next_bit.o llist.o memweight.o kfifo.o \
29 percpu-refcount.o percpu_ida.o 29 percpu-refcount.o percpu_ida.o hash.o
30obj-y += string_helpers.o 30obj-y += string_helpers.o
31obj-$(CONFIG_TEST_STRING_HELPERS) += test-string_helpers.o 31obj-$(CONFIG_TEST_STRING_HELPERS) += test-string_helpers.o
32obj-y += kstrtox.o 32obj-y += kstrtox.o
33obj-$(CONFIG_TEST_KSTRTOX) += test-kstrtox.o 33obj-$(CONFIG_TEST_KSTRTOX) += test-kstrtox.o
34obj-$(CONFIG_TEST_MODULE) += test_module.o
35obj-$(CONFIG_TEST_USER_COPY) += test_user_copy.o
34 36
35ifeq ($(CONFIG_DEBUG_KOBJECT),y) 37ifeq ($(CONFIG_DEBUG_KOBJECT),y)
36CFLAGS_kobject.o += -DDEBUG 38CFLAGS_kobject.o += -DDEBUG
diff --git a/lib/assoc_array.c b/lib/assoc_array.c
index 1b6a44f1ec3e..c0b1007011e1 100644
--- a/lib/assoc_array.c
+++ b/lib/assoc_array.c
@@ -157,7 +157,7 @@ enum assoc_array_walk_status {
157 assoc_array_walk_tree_empty, 157 assoc_array_walk_tree_empty,
158 assoc_array_walk_found_terminal_node, 158 assoc_array_walk_found_terminal_node,
159 assoc_array_walk_found_wrong_shortcut, 159 assoc_array_walk_found_wrong_shortcut,
160} status; 160};
161 161
162struct assoc_array_walk_result { 162struct assoc_array_walk_result {
163 struct { 163 struct {
diff --git a/lib/average.c b/lib/average.c
index 99a67e662b3c..114d1beae0c7 100644
--- a/lib/average.c
+++ b/lib/average.c
@@ -53,8 +53,10 @@ EXPORT_SYMBOL(ewma_init);
53 */ 53 */
54struct ewma *ewma_add(struct ewma *avg, unsigned long val) 54struct ewma *ewma_add(struct ewma *avg, unsigned long val)
55{ 55{
56 avg->internal = avg->internal ? 56 unsigned long internal = ACCESS_ONCE(avg->internal);
57 (((avg->internal << avg->weight) - avg->internal) + 57
58 ACCESS_ONCE(avg->internal) = internal ?
59 (((internal << avg->weight) - internal) +
58 (val << avg->factor)) >> avg->weight : 60 (val << avg->factor)) >> avg->weight :
59 (val << avg->factor); 61 (val << avg->factor);
60 return avg; 62 return avg;
diff --git a/lib/cmdline.c b/lib/cmdline.c
index eb6791188cf5..d4932f745e92 100644
--- a/lib/cmdline.c
+++ b/lib/cmdline.c
@@ -49,13 +49,13 @@ static int get_range(char **str, int *pint)
49 * 3 - hyphen found to denote a range 49 * 3 - hyphen found to denote a range
50 */ 50 */
51 51
52int get_option (char **str, int *pint) 52int get_option(char **str, int *pint)
53{ 53{
54 char *cur = *str; 54 char *cur = *str;
55 55
56 if (!cur || !(*cur)) 56 if (!cur || !(*cur))
57 return 0; 57 return 0;
58 *pint = simple_strtol (cur, str, 0); 58 *pint = simple_strtol(cur, str, 0);
59 if (cur == *str) 59 if (cur == *str)
60 return 0; 60 return 0;
61 if (**str == ',') { 61 if (**str == ',') {
@@ -67,6 +67,7 @@ int get_option (char **str, int *pint)
67 67
68 return 1; 68 return 1;
69} 69}
70EXPORT_SYMBOL(get_option);
70 71
71/** 72/**
72 * get_options - Parse a string into a list of integers 73 * get_options - Parse a string into a list of integers
@@ -84,13 +85,13 @@ int get_option (char **str, int *pint)
84 * the parse to end (typically a null terminator, if @str is 85 * the parse to end (typically a null terminator, if @str is
85 * completely parseable). 86 * completely parseable).
86 */ 87 */
87