diff options
author | Yi Li <yi.li@analog.com> | 2009-08-20 00:17:47 -0400 |
---|---|---|
committer | Mike Frysinger <vapier@gentoo.org> | 2009-09-16 22:10:32 -0400 |
commit | b6dbde27dd95cc0397d9722ad8365fa93a07b0d3 (patch) | |
tree | 1743551be50d891228e8b2ea5d9ac0811d01355c /arch/blackfin/kernel/traps.c | |
parent | 00dd66d012f944817a7d0cdcb0c8cb174e46937a (diff) |
Blackfin: use raw_smp_processor_id() in exception code
When preempt debugging is enabled, smp_processor_id() may utilize the
"current" structure. This may not be safe to access under all exceptions
due to it being in dynamically allocated memory. So in exception code,
make sure we use raw_smp_processor_id() instead to get at the real value
directly.
Signed-off-by: Yi Li <yi.li@analog.com>
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
Diffstat (limited to 'arch/blackfin/kernel/traps.c')
-rw-r--r-- | arch/blackfin/kernel/traps.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/arch/blackfin/kernel/traps.c b/arch/blackfin/kernel/traps.c index 7b3ba06e10ad..56464cb8edf3 100644 --- a/arch/blackfin/kernel/traps.c +++ b/arch/blackfin/kernel/traps.c | |||
@@ -227,7 +227,7 @@ asmlinkage void double_fault_c(struct pt_regs *fp) | |||
227 | printk(KERN_EMERG "Double Fault\n"); | 227 | printk(KERN_EMERG "Double Fault\n"); |
228 | #ifdef CONFIG_DEBUG_DOUBLEFAULT_PRINT | 228 | #ifdef CONFIG_DEBUG_DOUBLEFAULT_PRINT |
229 | if (((long)fp->seqstat & SEQSTAT_EXCAUSE) == VEC_UNCOV) { | 229 | if (((long)fp->seqstat & SEQSTAT_EXCAUSE) == VEC_UNCOV) { |
230 | unsigned int cpu = smp_processor_id(); | 230 | unsigned int cpu = raw_smp_processor_id(); |
231 | char buf[150]; | 231 | char buf[150]; |
232 | decode_address(buf, cpu_pda[cpu].retx_doublefault); | 232 | decode_address(buf, cpu_pda[cpu].retx_doublefault); |
233 | printk(KERN_EMERG "While handling exception (EXCAUSE = 0x%x) at %s:\n", | 233 | printk(KERN_EMERG "While handling exception (EXCAUSE = 0x%x) at %s:\n", |
@@ -263,7 +263,7 @@ asmlinkage notrace void trap_c(struct pt_regs *fp) | |||
263 | int j; | 263 | int j; |
264 | #endif | 264 | #endif |
265 | #ifdef CONFIG_DEBUG_HUNT_FOR_ZERO | 265 | #ifdef CONFIG_DEBUG_HUNT_FOR_ZERO |
266 | unsigned int cpu = smp_processor_id(); | 266 | unsigned int cpu = raw_smp_processor_id(); |
267 | #endif | 267 | #endif |
268 | const char *strerror = NULL; | 268 | const char *strerror = NULL; |
269 | int sig = 0; | 269 | int sig = 0; |
@@ -1098,7 +1098,7 @@ void show_regs(struct pt_regs *fp) | |||
1098 | struct irqaction *action; | 1098 | struct irqaction *action; |
1099 | unsigned int i; | 1099 | unsigned int i; |
1100 | unsigned long flags = 0; | 1100 | unsigned long flags = 0; |
1101 | unsigned int cpu = smp_processor_id(); | 1101 | unsigned int cpu = raw_smp_processor_id(); |
1102 | unsigned char in_atomic = (bfin_read_IPEND() & 0x10) || in_atomic(); | 1102 | unsigned char in_atomic = (bfin_read_IPEND() & 0x10) || in_atomic(); |
1103 | 1103 | ||
1104 | verbose_printk(KERN_NOTICE "\n"); | 1104 | verbose_printk(KERN_NOTICE "\n"); |
@@ -1126,13 +1126,13 @@ void show_regs(struct pt_regs *fp) | |||
1126 | 1126 | ||
1127 | verbose_printk(KERN_NOTICE "\nSEQUENCER STATUS:\t\t%s\n", print_tainted()); | 1127 | verbose_printk(KERN_NOTICE "\nSEQUENCER STATUS:\t\t%s\n", print_tainted()); |
1128 | verbose_printk(KERN_NOTICE " SEQSTAT: %08lx IPEND: %04lx IMASK: %04lx SYSCFG: %04lx\n", | 1128 | verbose_printk(KERN_NOTICE " SEQSTAT: %08lx IPEND: %04lx IMASK: %04lx SYSCFG: %04lx\n", |
1129 | (long)fp->seqstat, fp->ipend, cpu_pda[smp_processor_id()].ex_imask, fp->syscfg); | 1129 | (long)fp->seqstat, fp->ipend, cpu_pda[raw_smp_processor_id()].ex_imask, fp->syscfg); |
1130 | if (fp->ipend & EVT_IRPTEN) | 1130 | if (fp->ipend & EVT_IRPTEN) |
1131 | verbose_printk(KERN_NOTICE " Global Interrupts Disabled (IPEND[4])\n"); | 1131 | verbose_printk(KERN_NOTICE " Global Interrupts Disabled (IPEND[4])\n"); |
1132 | if (!(cpu_pda[smp_processor_id()].ex_imask & (EVT_IVG13 | EVT_IVG12 | EVT_IVG11 | | 1132 | if (!(cpu_pda[raw_smp_processor_id()].ex_imask & (EVT_IVG13 | EVT_IVG12 | EVT_IVG11 | |
1133 | EVT_IVG10 | EVT_IVG9 | EVT_IVG8 | EVT_IVG7 | EVT_IVTMR))) | 1133 | EVT_IVG10 | EVT_IVG9 | EVT_IVG8 | EVT_IVG7 | EVT_IVTMR))) |
1134 | verbose_printk(KERN_NOTICE " Peripheral interrupts masked off\n"); | 1134 | verbose_printk(KERN_NOTICE " Peripheral interrupts masked off\n"); |
1135 | if (!(cpu_pda[smp_processor_id()].ex_imask & (EVT_IVG15 | EVT_IVG14))) | 1135 | if (!(cpu_pda[raw_smp_processor_id()].ex_imask & (EVT_IVG15 | EVT_IVG14))) |
1136 | verbose_printk(KERN_NOTICE " Kernel interrupts masked off\n"); | 1136 | verbose_printk(KERN_NOTICE " Kernel interrupts masked off\n"); |
1137 | if ((fp->seqstat & SEQSTAT_EXCAUSE) == VEC_HWERR) { | 1137 | if ((fp->seqstat & SEQSTAT_EXCAUSE) == VEC_HWERR) { |
1138 | verbose_printk(KERN_NOTICE " HWERRCAUSE: 0x%lx\n", | 1138 | verbose_printk(KERN_NOTICE " HWERRCAUSE: 0x%lx\n", |