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

Blackfin: irqs: do not trace arch_local_{*,irq_*} functions

Do not trace arch_local_save_flags(), arch_local_irq_*() and friends.
Although they are marked inline, gcc may still make a function out of
them and add it to the pool of functions that are traced by the function
tracer. This can cause undesirable results (kernel panic, triple faults,
etc).

Add the notrace notation to prevent them from ever being traced.

Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
Signed-off-by: Mike Frysinger <vapier@gentoo.org>

authored by

Steven Rostedt and committed by
Mike Frysinger
a2de3f79 b0d3dc12

+21 -21
+21 -21
arch/blackfin/include/asm/irqflags.h
··· 18 18 extern unsigned long bfin_irq_flags; 19 19 #endif 20 20 21 - static inline void bfin_sti(unsigned long flags) 21 + static inline notrace void bfin_sti(unsigned long flags) 22 22 { 23 23 asm volatile("sti %0;" : : "d" (flags)); 24 24 } 25 25 26 - static inline unsigned long bfin_cli(void) 26 + static inline notrace unsigned long bfin_cli(void) 27 27 { 28 28 unsigned long flags; 29 29 asm volatile("cli %0;" : "=d" (flags)); ··· 40 40 /* 41 41 * Hard, untraced CPU interrupt flag manipulation and access. 42 42 */ 43 - static inline void __hard_local_irq_disable(void) 43 + static inline notrace void __hard_local_irq_disable(void) 44 44 { 45 45 bfin_cli(); 46 46 } 47 47 48 - static inline void __hard_local_irq_enable(void) 48 + static inline notrace void __hard_local_irq_enable(void) 49 49 { 50 50 bfin_sti(bfin_irq_flags); 51 51 } 52 52 53 - static inline unsigned long hard_local_save_flags(void) 53 + static inline notrace unsigned long hard_local_save_flags(void) 54 54 { 55 55 return bfin_read_IMASK(); 56 56 } 57 57 58 - static inline unsigned long __hard_local_irq_save(void) 58 + static inline notrace unsigned long __hard_local_irq_save(void) 59 59 { 60 60 unsigned long flags; 61 61 flags = bfin_cli(); ··· 65 65 return flags; 66 66 } 67 67 68 - static inline int hard_irqs_disabled_flags(unsigned long flags) 68 + static inline notrace int hard_irqs_disabled_flags(unsigned long flags) 69 69 { 70 70 return (flags & ~0x3f) == 0; 71 71 } 72 72 73 - static inline int hard_irqs_disabled(void) 73 + static inline notrace int hard_irqs_disabled(void) 74 74 { 75 75 unsigned long flags = hard_local_save_flags(); 76 76 return hard_irqs_disabled_flags(flags); 77 77 } 78 78 79 - static inline void __hard_local_irq_restore(unsigned long flags) 79 + static inline notrace void __hard_local_irq_restore(unsigned long flags) 80 80 { 81 81 if (!hard_irqs_disabled_flags(flags)) 82 82 __hard_local_irq_enable(); ··· 113 113 /* 114 114 * Interrupt pipe interface to linux/irqflags.h. 115 115 */ 116 - static inline void arch_local_irq_disable(void) 116 + static inline notrace void arch_local_irq_disable(void) 117 117 { 118 118 __check_irqop_context(); 119 119 __ipipe_stall_root(); 120 120 barrier(); 121 121 } 122 122 123 - static inline void arch_local_irq_enable(void) 123 + static inline notrace void arch_local_irq_enable(void) 124 124 { 125 125 barrier(); 126 126 __check_irqop_context(); 127 127 __ipipe_unstall_root(); 128 128 } 129 129 130 - static inline unsigned long arch_local_save_flags(void) 130 + static inline notrace unsigned long arch_local_save_flags(void) 131 131 { 132 132 return __ipipe_test_root() ? bfin_no_irqs : bfin_irq_flags; 133 133 } 134 134 135 - static inline int arch_irqs_disabled_flags(unsigned long flags) 135 + static inline notrace int arch_irqs_disabled_flags(unsigned long flags) 136 136 { 137 137 return flags == bfin_no_irqs; 138 138 } 139 139 140 - static inline unsigned long arch_local_irq_save(void) 140 + static inline notrace unsigned long arch_local_irq_save(void) 141 141 { 142 142 unsigned long flags; 143 143 ··· 148 148 return flags; 149 149 } 150 150 151 - static inline void arch_local_irq_restore(unsigned long flags) 151 + static inline notrace void arch_local_irq_restore(unsigned long flags) 152 152 { 153 153 __check_irqop_context(); 154 154 __ipipe_restore_root(flags == bfin_no_irqs); 155 155 } 156 156 157 - static inline unsigned long arch_mangle_irq_bits(int virt, unsigned long real) 157 + static inline notrace unsigned long arch_mangle_irq_bits(int virt, unsigned long real) 158 158 { 159 159 /* 160 160 * Merge virtual and real interrupt mask bits into a single ··· 163 163 return (real & ~(1 << 31)) | ((virt != 0) << 31); 164 164 } 165 165 166 - static inline int arch_demangle_irq_bits(unsigned long *x) 166 + static inline notrace int arch_demangle_irq_bits(unsigned long *x) 167 167 { 168 168 int virt = (*x & (1 << 31)) != 0; 169 169 *x &= ~(1L << 31); ··· 174 174 * Interface to various arch routines that may be traced. 175 175 */ 176 176 #ifdef CONFIG_IPIPE_TRACE_IRQSOFF 177 - static inline void hard_local_irq_disable(void) 177 + static inline notrace void hard_local_irq_disable(void) 178 178 { 179 179 if (!hard_irqs_disabled()) { 180 180 __hard_local_irq_disable(); ··· 182 182 } 183 183 } 184 184 185 - static inline void hard_local_irq_enable(void) 185 + static inline notrace void hard_local_irq_enable(void) 186 186 { 187 187 if (hard_irqs_disabled()) { 188 188 ipipe_trace_end(0x80000000); ··· 190 190 } 191 191 } 192 192 193 - static inline unsigned long hard_local_irq_save(void) 193 + static inline notrace unsigned long hard_local_irq_save(void) 194 194 { 195 195 unsigned long flags = hard_local_save_flags(); 196 196 if (!hard_irqs_disabled_flags(flags)) { ··· 200 200 return flags; 201 201 } 202 202 203 - static inline void hard_local_irq_restore(unsigned long flags) 203 + static inline notrace void hard_local_irq_restore(unsigned long flags) 204 204 { 205 205 if (!hard_irqs_disabled_flags(flags)) { 206 206 ipipe_trace_end(0x80000001);