diff options
author | Michal Simek <monstr@monstr.eu> | 2009-09-15 03:49:53 -0400 |
---|---|---|
committer | Michal Simek <monstr@monstr.eu> | 2009-09-22 04:00:43 -0400 |
commit | bfc32ad09bd5b077aac62f09e24d10374001c07b (patch) | |
tree | 6b25b90decdc2ee0c07625762933e44b08f148ef /arch/microblaze/kernel | |
parent | 7ba3fe55d0187cb16c5b205bb131893031b10e66 (diff) |
microblaze: Don't be noisy when userspace causes hardware exceptions
Signed-off-by: Michal Simek <monstr@monstr.eu>
Diffstat (limited to 'arch/microblaze/kernel')
-rw-r--r-- | arch/microblaze/kernel/exceptions.c | 31 |
1 files changed, 20 insertions, 11 deletions
diff --git a/arch/microblaze/kernel/exceptions.c b/arch/microblaze/kernel/exceptions.c index 0cb64a31e89a..e64a5c7282a5 100644 --- a/arch/microblaze/kernel/exceptions.c +++ b/arch/microblaze/kernel/exceptions.c | |||
@@ -72,7 +72,8 @@ asmlinkage void full_exception(struct pt_regs *regs, unsigned int type, | |||
72 | #endif | 72 | #endif |
73 | 73 | ||
74 | #if 0 | 74 | #if 0 |
75 | printk(KERN_WARNING "Exception %02x in %s mode, FSR=%08x PC=%08x ESR=%08x\n", | 75 | printk(KERN_WARNING "Exception %02x in %s mode, FSR=%08x PC=%08x " \ |
76 | "ESR=%08x\n", | ||
76 | type, user_mode(regs) ? "user" : "kernel", fsr, | 77 | type, user_mode(regs) ? "user" : "kernel", fsr, |
77 | (unsigned int) regs->pc, (unsigned int) regs->esr); | 78 | (unsigned int) regs->pc, (unsigned int) regs->esr); |
78 | #endif | 79 | #endif |
@@ -80,42 +81,50 @@ asmlinkage void full_exception(struct pt_regs *regs, unsigned int type, | |||
80 | switch (type & 0x1F) { | 81 | switch (type & 0x1F) { |
81 | case MICROBLAZE_ILL_OPCODE_EXCEPTION: | 82 | case MICROBLAZE_ILL_OPCODE_EXCEPTION: |
82 | if (user_mode(regs)) { | 83 | if (user_mode(regs)) { |
83 | printk(KERN_WARNING "Illegal opcode exception in user mode.\n"); | 84 | pr_debug(KERN_WARNING "Illegal opcode exception " \ |
85 | "in user mode.\n"); | ||
84 | _exception(SIGILL, regs, ILL_ILLOPC, addr); | 86 | _exception(SIGILL, regs, ILL_ILLOPC, addr); |
85 | return; | 87 | return; |
86 | } | 88 | } |
87 | printk(KERN_WARNING "Illegal opcode exception in kernel mode.\n"); | 89 | printk(KERN_WARNING "Illegal opcode exception " \ |
90 | "in kernel mode.\n"); | ||
88 | die("opcode exception", regs, SIGBUS); | 91 | die("opcode exception", regs, SIGBUS); |
89 | break; | 92 | break; |
90 | case MICROBLAZE_IBUS_EXCEPTION: | 93 | case MICROBLAZE_IBUS_EXCEPTION: |
91 | if (user_mode(regs)) { | 94 | if (user_mode(regs)) { |
92 | printk(KERN_WARNING "Instruction bus error exception in user mode.\n"); | 95 | pr_debug(KERN_WARNING "Instruction bus error " \ |
96 | "exception in user mode.\n"); | ||
93 | _exception(SIGBUS, regs, BUS_ADRERR, addr); | 97 | _exception(SIGBUS, regs, BUS_ADRERR, addr); |
94 | return; | 98 | return; |
95 | } | 99 | } |
96 | printk(KERN_WARNING "Instruction bus error exception in kernel mode.\n"); | 100 | printk(KERN_WARNING "Instruction bus error exception " \ |
101 | "in kernel mode.\n"); | ||
97 | die("bus exception", regs, SIGBUS); | 102 | die("bus exception", regs, SIGBUS); |
98 | break; | 103 | break; |
99 | case MICROBLAZE_DBUS_EXCEPTION: | 104 | case MICROBLAZE_DBUS_EXCEPTION: |
100 | if (user_mode(regs)) { | 105 | if (user_mode(regs)) { |
101 | printk(KERN_WARNING "Data bus error exception in user mode.\n"); | 106 | pr_debug(KERN_WARNING "Data bus error exception " \ |
107 | "in user mode.\n"); | ||
102 | _exception(SIGBUS, regs, BUS_ADRERR, addr); | 108 | _exception(SIGBUS, regs, BUS_ADRERR, addr); |
103 | return; | 109 | return; |
104 | } | 110 | } |
105 | printk(KERN_WARNING "Data bus error exception in kernel mode.\n"); | 111 | printk(KERN_WARNING "Data bus error exception " \ |
112 | "in kernel mode.\n"); | ||
106 | die("bus exception", regs, SIGBUS); | 113 | die("bus exception", regs, SIGBUS); |
107 | break; | 114 | break; |
108 | case MICROBLAZE_DIV_ZERO_EXCEPTION: | 115 | case MICROBLAZE_DIV_ZERO_EXCEPTION: |
109 | if (user_mode(regs)) { | 116 | if (user_mode(regs)) { |
110 | printk(KERN_WARNING "Divide by zero exception in user mode\n"); | 117 | pr_debug(KERN_WARNING "Divide by zero exception " \ |
118 | "in user mode\n"); | ||
111 | _exception(SIGILL, regs, ILL_ILLOPC, addr); | 119 | _exception(SIGILL, regs, ILL_ILLOPC, addr); |
112 | return; | 120 | return; |
113 | } | 121 | } |
114 | printk(KERN_WARNING "Divide by zero exception in kernel mode.\n"); | 122 | printk(KERN_WARNING "Divide by zero exception " \ |
123 | "in kernel mode.\n"); | ||
115 | die("Divide by exception", regs, SIGBUS); | 124 | die("Divide by exception", regs, SIGBUS); |
116 | break; | 125 | break; |
117 | case MICROBLAZE_FPU_EXCEPTION: | 126 | case MICROBLAZE_FPU_EXCEPTION: |
118 | printk(KERN_WARNING "FPU exception\n"); | 127 | pr_debug(KERN_WARNING "FPU exception\n"); |
119 | /* IEEE FP exception */ | 128 | /* IEEE FP exception */ |
120 | /* I removed fsr variable and use code var for storing fsr */ | 129 | /* I removed fsr variable and use code var for storing fsr */ |
121 | if (fsr & FSR_IO) | 130 | if (fsr & FSR_IO) |
@@ -133,7 +142,7 @@ asmlinkage void full_exception(struct pt_regs *regs, unsigned int type, | |||
133 | 142 | ||
134 | #ifdef CONFIG_MMU | 143 | #ifdef CONFIG_MMU |
135 | case MICROBLAZE_PRIVILEGED_EXCEPTION: | 144 | case MICROBLAZE_PRIVILEGED_EXCEPTION: |
136 | printk(KERN_WARNING "Privileged exception\n"); | 145 | pr_debug(KERN_WARNING "Privileged exception\n"); |
137 | /* "brk r0,r0" - used as debug breakpoint */ | 146 | /* "brk r0,r0" - used as debug breakpoint */ |
138 | if (get_user(code, (unsigned long *)regs->pc) == 0 | 147 | if (get_user(code, (unsigned long *)regs->pc) == 0 |
139 | && code == 0x980c0000) { | 148 | && code == 0x980c0000) { |