aboutsummaryrefslogtreecommitdiffstats
path: root/arch/sparc/kernel/unaligned_32.c
diff options
context:
space:
mode:
Diffstat (limited to 'arch/sparc/kernel/unaligned_32.c')
-rw-r--r--arch/sparc/kernel/unaligned_32.c15
1 files changed, 3 insertions, 12 deletions
diff --git a/arch/sparc/kernel/unaligned_32.c b/arch/sparc/kernel/unaligned_32.c
index 6b1e6cde6fff..f8514e291e15 100644
--- a/arch/sparc/kernel/unaligned_32.c
+++ b/arch/sparc/kernel/unaligned_32.c
@@ -17,8 +17,7 @@
17#include <asm/uaccess.h> 17#include <asm/uaccess.h>
18#include <linux/smp.h> 18#include <linux/smp.h>
19#include <linux/smp_lock.h> 19#include <linux/smp_lock.h>
20 20#include <linux/perf_event.h>
21/* #define DEBUG_MNA */
22 21
23enum direction { 22enum direction {
24 load, /* ld, ldd, ldh, ldsh */ 23 load, /* ld, ldd, ldh, ldsh */
@@ -29,12 +28,6 @@ enum direction {
29 invalid, 28 invalid,
30}; 29};
31 30
32#ifdef DEBUG_MNA
33static char *dirstrings[] = {
34 "load", "store", "both", "fpload", "fpstore", "invalid"
35};
36#endif
37
38static inline enum direction decode_direction(unsigned int insn) 31static inline enum direction decode_direction(unsigned int insn)
39{ 32{
40 unsigned long tmp = (insn >> 21) & 1; 33 unsigned long tmp = (insn >> 21) & 1;
@@ -255,10 +248,7 @@ asmlinkage void kernel_unaligned_trap(struct pt_regs *regs, unsigned int insn)
255 unsigned long addr = compute_effective_address(regs, insn); 248 unsigned long addr = compute_effective_address(regs, insn);
256 int err; 249 int err;
257 250
258#ifdef DEBUG_MNA 251 perf_sw_event(PERF_COUNT_SW_ALIGNMENT_FAULTS, 1, 0, regs, addr);
259 printk("KMNA: pc=%08lx [dir=%s addr=%08lx size=%d] retpc[%08lx]\n",
260 regs->pc, dirstrings[dir], addr, size, regs->u_regs[UREG_RETPC]);
261#endif
262 switch (dir) { 252 switch (dir) {
263 case load: 253 case load:
264 err = do_int_load(fetch_reg_addr(((insn>>25)&0x1f), 254 err = do_int_load(fetch_reg_addr(((insn>>25)&0x1f),
@@ -350,6 +340,7 @@ asmlinkage void user_unaligned_trap(struct pt_regs *regs, unsigned int insn)
350 } 340 }
351 341
352 addr = compute_effective_address(regs, insn); 342 addr = compute_effective_address(regs, insn);
343 perf_sw_event(PERF_COUNT_SW_ALIGNMENT_FAULTS, 1, 0, regs, addr);
353 switch(dir) { 344 switch(dir) {
354 case load: 345 case load:
355 err = do_int_load(fetch_reg_addr(((insn>>25)&0x1f), 346 err = do_int_load(fetch_reg_addr(((insn>>25)&0x1f),