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

[PATCH] Consolidate bust_spinlocks()

Part of long forgotten patch
http://groups.google.com/group/fa.linux.kernel/msg/e98e941ce1cf29f6?dmode=source
Since then, m32r grabbed two copies.

Leave s390 copy because of important absence of CONFIG_VT, but remove
references to non-existent timerlist_lock. ia64 also loses timerlist_lock.

Signed-off-by: Alexey Dobriyan <adobriyan@openvz.org>
Acked-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
Cc: Andi Kleen <ak@muc.de>
Cc: "Luck, Tony" <tony.luck@intel.com>
Cc: Hirokazu Takata <takata@linux-m32r.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>

authored by

Kirill Korotaev and committed by
Linus Torvalds
cefc8be8 c530cba6

+5 -135
-26
arch/i386/mm/fault.c
··· 60 60 } 61 61 62 62 /* 63 - * Unlock any spinlocks which will prevent us from getting the 64 - * message out 65 - */ 66 - void bust_spinlocks(int yes) 67 - { 68 - int loglevel_save = console_loglevel; 69 - 70 - if (yes) { 71 - oops_in_progress = 1; 72 - return; 73 - } 74 - #ifdef CONFIG_VT 75 - unblank_screen(); 76 - #endif 77 - oops_in_progress = 0; 78 - /* 79 - * OK, the message is on the console. Now we call printk() 80 - * without oops_in_progress set so that printk will give klogd 81 - * a poke. Hold onto your hats... 82 - */ 83 - console_loglevel = 15; /* NMI oopser may have shut the console up */ 84 - printk(" "); 85 - console_loglevel = loglevel_save; 86 - } 87 - 88 - /* 89 63 * Return EIP plus the CS segment base. The segment limit is also 90 64 * adjusted, clamped to the kernel/user address space (whichever is 91 65 * appropriate), and returned in *eip_limit.
-30
arch/ia64/kernel/traps.c
··· 24 24 #include <asm/uaccess.h> 25 25 #include <asm/kdebug.h> 26 26 27 - extern spinlock_t timerlist_lock; 28 - 29 27 fpswa_interface_t *fpswa_interface; 30 28 EXPORT_SYMBOL(fpswa_interface); 31 29 ··· 49 51 if (ia64_boot_param->fpswa) 50 52 /* FPSWA fixup: make the interface pointer a kernel virtual address: */ 51 53 fpswa_interface = __va(ia64_boot_param->fpswa); 52 - } 53 - 54 - /* 55 - * Unlock any spinlocks which will prevent us from getting the message out (timerlist_lock 56 - * is acquired through the console unblank code) 57 - */ 58 - void 59 - bust_spinlocks (int yes) 60 - { 61 - int loglevel_save = console_loglevel; 62 - 63 - if (yes) { 64 - oops_in_progress = 1; 65 - return; 66 - } 67 - 68 - #ifdef CONFIG_VT 69 - unblank_screen(); 70 - #endif 71 - oops_in_progress = 0; 72 - /* 73 - * OK, the message is on the console. Now we call printk() without 74 - * oops_in_progress set so that printk will give klogd a poke. Hold onto 75 - * your hats... 76 - */ 77 - console_loglevel = 15; /* NMI oopser may have shut the console up */ 78 - printk(" "); 79 - console_loglevel = loglevel_save; 80 54 } 81 55 82 56 void
-26
arch/m32r/mm/fault-nommu.c
··· 44 44 #define tlb_entry_d tlb_entry_d_dat[smp_processor_id()] 45 45 #endif 46 46 47 - /* 48 - * Unlock any spinlocks which will prevent us from getting the 49 - * message out 50 - */ 51 - void bust_spinlocks(int yes) 52 - { 53 - int loglevel_save = console_loglevel; 54 - 55 - if (yes) { 56 - oops_in_progress = 1; 57 - return; 58 - } 59 - #ifdef CONFIG_VT 60 - unblank_screen(); 61 - #endif 62 - oops_in_progress = 0; 63 - /* 64 - * OK, the message is on the console. Now we call printk() 65 - * without oops_in_progress set so that printk will give klogd 66 - * a poke. Hold onto your hats... 67 - */ 68 - console_loglevel = 15; /* NMI oopser may have shut the console up */ 69 - printk(" "); 70 - console_loglevel = loglevel_save; 71 - } 72 - 73 47 void do_BUG(const char *file, int line) 74 48 { 75 49 bust_spinlocks(1);
-26
arch/m32r/mm/fault.c
··· 49 49 50 50 extern void init_tlb(void); 51 51 52 - /* 53 - * Unlock any spinlocks which will prevent us from getting the 54 - * message out 55 - */ 56 - void bust_spinlocks(int yes) 57 - { 58 - int loglevel_save = console_loglevel; 59 - 60 - if (yes) { 61 - oops_in_progress = 1; 62 - return; 63 - } 64 - #ifdef CONFIG_VT 65 - unblank_screen(); 66 - #endif 67 - oops_in_progress = 0; 68 - /* 69 - * OK, the message is on the console. Now we call printk() 70 - * without oops_in_progress set so that printk will give klogd 71 - * a poke. Hold onto your hats... 72 - */ 73 - console_loglevel = 15; /* NMI oopser may have shut the console up */ 74 - printk(" "); 75 - console_loglevel = loglevel_save; 76 - } 77 - 78 52 /*======================================================================* 79 53 * do_page_fault() 80 54 *======================================================================*
+1 -3
arch/s390/mm/fault.c
··· 83 83 } 84 84 #endif 85 85 86 - extern spinlock_t timerlist_lock; 87 86 88 87 /* 89 88 * Unlock any spinlocks which will prevent us from getting the 90 - * message out (timerlist_lock is acquired through the 91 - * console unblank code) 89 + * message out. 92 90 */ 93 91 void bust_spinlocks(int yes) 94 92 {
-21
arch/x86_64/mm/fault.c
··· 69 69 return atomic_notifier_call_chain(&notify_page_fault_chain, val, &args); 70 70 } 71 71 72 - void bust_spinlocks(int yes) 73 - { 74 - int loglevel_save = console_loglevel; 75 - if (yes) { 76 - oops_in_progress = 1; 77 - } else { 78 - #ifdef CONFIG_VT 79 - unblank_screen(); 80 - #endif 81 - oops_in_progress = 0; 82 - /* 83 - * OK, the message is on the console. Now we call printk() 84 - * without oops_in_progress set so that printk will give klogd 85 - * a poke. Hold onto your hats... 86 - */ 87 - console_loglevel = 15; /* NMI oopser may have shut the console up */ 88 - printk(" "); 89 - console_loglevel = loglevel_save; 90 - } 91 - } 92 - 93 72 /* Sometimes the CPU reports invalid exceptions on prefetch. 94 73 Check that here and ignore. 95 74 Opcode checker based on code by Richard Brunner */
+3 -2
lib/Makefile
··· 3 3 # 4 4 5 5 lib-y := ctype.o string.o vsprintf.o cmdline.o \ 6 - bust_spinlocks.o rbtree.o radix-tree.o dump_stack.o \ 6 + rbtree.o radix-tree.o dump_stack.o \ 7 7 idr.o div64.o int_sqrt.o bitmap.o extable.o prio_tree.o \ 8 8 sha1.o irq_regs.o reciprocal_div.o 9 9 ··· 12 12 13 13 lib-y += kobject.o kref.o kobject_uevent.o klist.o 14 14 15 - obj-y += sort.o parser.o halfmd4.o debug_locks.o random32.o iomap.o 15 + obj-y += sort.o parser.o halfmd4.o debug_locks.o random32.o iomap.o \ 16 + bust_spinlocks.o 16 17 17 18 ifeq ($(CONFIG_DEBUG_KOBJECT),y) 18 19 CFLAGS_kobject.o += -DDEBUG
+1 -1
lib/bust_spinlocks.c
··· 14 14 #include <linux/vt_kern.h> 15 15 16 16 17 - void bust_spinlocks(int yes) 17 + void __attribute__((weak)) bust_spinlocks(int yes) 18 18 { 19 19 if (yes) { 20 20 oops_in_progress = 1;