Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

Merge tag 'locking-urgent-2021-07-11' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip

Pull locking fixes from Ingo Molnar:

- Fix a Sparc crash

- Fix a number of objtool warnings

- Fix /proc/lockdep output on certain configs

- Restore a kprobes fail-safe

* tag 'locking-urgent-2021-07-11' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
locking/atomic: sparc: Fix arch_cmpxchg64_local()
kprobe/static_call: Restore missing static_call_text_reserved()
static_call: Fix static_call_text_reserved() vs __init
jump_label: Fix jump_label_text_reserved() vs __init
locking/lockdep: Fix meaningless /proc/lockdep output of lock classes on !CONFIG_PROVE_LOCKING

+33 -23
+1 -1
arch/sparc/include/asm/cmpxchg_64.h
··· 201 201 #define arch_cmpxchg64_local(ptr, o, n) \ 202 202 ({ \ 203 203 BUILD_BUG_ON(sizeof(*(ptr)) != 8); \ 204 - cmpxchg_local((ptr), (o), (n)); \ 204 + arch_cmpxchg_local((ptr), (o), (n)); \ 205 205 }) 206 206 #define arch_cmpxchg64(ptr, o, n) arch_cmpxchg64_local((ptr), (o), (n)) 207 207
+8 -5
kernel/jump_label.c
··· 316 316 } 317 317 318 318 static int __jump_label_text_reserved(struct jump_entry *iter_start, 319 - struct jump_entry *iter_stop, void *start, void *end) 319 + struct jump_entry *iter_stop, void *start, void *end, bool init) 320 320 { 321 321 struct jump_entry *iter; 322 322 323 323 iter = iter_start; 324 324 while (iter < iter_stop) { 325 - if (addr_conflict(iter, start, end)) 326 - return 1; 325 + if (init || !jump_entry_is_init(iter)) { 326 + if (addr_conflict(iter, start, end)) 327 + return 1; 328 + } 327 329 iter++; 328 330 } 329 331 ··· 564 562 565 563 ret = __jump_label_text_reserved(mod->jump_entries, 566 564 mod->jump_entries + mod->num_jump_entries, 567 - start, end); 565 + start, end, mod->state == MODULE_STATE_COMING); 568 566 569 567 module_put(mod); 570 568 ··· 790 788 */ 791 789 int jump_label_text_reserved(void *start, void *end) 792 790 { 791 + bool init = system_state < SYSTEM_RUNNING; 793 792 int ret = __jump_label_text_reserved(__start___jump_table, 794 - __stop___jump_table, start, end); 793 + __stop___jump_table, start, end, init); 795 794 796 795 if (ret) 797 796 return ret;
+2
kernel/kprobes.c
··· 35 35 #include <linux/ftrace.h> 36 36 #include <linux/cpu.h> 37 37 #include <linux/jump_label.h> 38 + #include <linux/static_call.h> 38 39 #include <linux/perf_event.h> 39 40 40 41 #include <asm/sections.h> ··· 1562 1561 if (!kernel_text_address((unsigned long) p->addr) || 1563 1562 within_kprobe_blacklist((unsigned long) p->addr) || 1564 1563 jump_label_text_reserved(p->addr, p->addr) || 1564 + static_call_text_reserved(p->addr, p->addr) || 1565 1565 find_bug((unsigned long)p->addr)) { 1566 1566 ret = -EINVAL; 1567 1567 goto out;
+14 -12
kernel/locking/lockdep_proc.c
··· 70 70 #ifdef CONFIG_DEBUG_LOCKDEP 71 71 seq_printf(m, " OPS:%8ld", debug_class_ops_read(class)); 72 72 #endif 73 - #ifdef CONFIG_PROVE_LOCKING 74 - seq_printf(m, " FD:%5ld", lockdep_count_forward_deps(class)); 75 - seq_printf(m, " BD:%5ld", lockdep_count_backward_deps(class)); 76 - #endif 73 + if (IS_ENABLED(CONFIG_PROVE_LOCKING)) { 74 + seq_printf(m, " FD:%5ld", lockdep_count_forward_deps(class)); 75 + seq_printf(m, " BD:%5ld", lockdep_count_backward_deps(class)); 77 76 78 - get_usage_chars(class, usage); 79 - seq_printf(m, " %s", usage); 77 + get_usage_chars(class, usage); 78 + seq_printf(m, " %s", usage); 79 + } 80 80 81 81 seq_printf(m, ": "); 82 82 print_name(m, class); 83 83 seq_puts(m, "\n"); 84 84 85 - list_for_each_entry(entry, &class->locks_after, entry) { 86 - if (entry->distance == 1) { 87 - seq_printf(m, " -> [%p] ", entry->class->key); 88 - print_name(m, entry->class); 89 - seq_puts(m, "\n"); 85 + if (IS_ENABLED(CONFIG_PROVE_LOCKING)) { 86 + list_for_each_entry(entry, &class->locks_after, entry) { 87 + if (entry->distance == 1) { 88 + seq_printf(m, " -> [%p] ", entry->class->key); 89 + print_name(m, entry->class); 90 + seq_puts(m, "\n"); 91 + } 90 92 } 93 + seq_puts(m, "\n"); 91 94 } 92 - seq_puts(m, "\n"); 93 95 94 96 return 0; 95 97 }
+8 -5
kernel/static_call.c
··· 292 292 293 293 static int __static_call_text_reserved(struct static_call_site *iter_start, 294 294 struct static_call_site *iter_stop, 295 - void *start, void *end) 295 + void *start, void *end, bool init) 296 296 { 297 297 struct static_call_site *iter = iter_start; 298 298 299 299 while (iter < iter_stop) { 300 - if (addr_conflict(iter, start, end)) 301 - return 1; 300 + if (init || !static_call_is_init(iter)) { 301 + if (addr_conflict(iter, start, end)) 302 + return 1; 303 + } 302 304 iter++; 303 305 } 304 306 ··· 326 324 327 325 ret = __static_call_text_reserved(mod->static_call_sites, 328 326 mod->static_call_sites + mod->num_static_call_sites, 329 - start, end); 327 + start, end, mod->state == MODULE_STATE_COMING); 330 328 331 329 module_put(mod); 332 330 ··· 461 459 462 460 int static_call_text_reserved(void *start, void *end) 463 461 { 462 + bool init = system_state < SYSTEM_RUNNING; 464 463 int ret = __static_call_text_reserved(__start_static_call_sites, 465 - __stop_static_call_sites, start, end); 464 + __stop_static_call_sites, start, end, init); 466 465 467 466 if (ret) 468 467 return ret;