From 94dcf3eb5aab26ef3bbef3a34b1968f9a2d469f9 Mon Sep 17 00:00:00 2001 From: David Howells Date: Wed, 12 Nov 2008 15:35:55 +0000 Subject: [PATCH] --- yaml --- r: 118855 b: refs/heads/master c: 58a47481b6ecb6dd05ab4a788e1f2ae3c7c46f57 h: refs/heads/master i: 118853: c173940679af9fe18cb0e9c2b50a582baf3cd561 118851: 9abccb5e9f3bad1a765d95be69144cf43b57ec22 118847: c09381f54c05105b6b94b2ccc665006ff203b1cd v: v3 --- [refs] | 2 +- trunk/arch/mn10300/mm/misalignment.c | 52 ++++++++++++---------------- 2 files changed, 24 insertions(+), 30 deletions(-) diff --git a/[refs] b/[refs] index dd290a6d9ead..766b0bc40c17 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: bd9384a9fdd6c15da6b01b2844c3471d07a45d64 +refs/heads/master: 58a47481b6ecb6dd05ab4a788e1f2ae3c7c46f57 diff --git a/trunk/arch/mn10300/mm/misalignment.c b/trunk/arch/mn10300/mm/misalignment.c index 7b670a3d7659..94c4a4358065 100644 --- a/trunk/arch/mn10300/mm/misalignment.c +++ b/trunk/arch/mn10300/mm/misalignment.c @@ -329,10 +329,11 @@ asmlinkage void misalignment(struct pt_regs *regs, enum exception_code code) void *address; unsigned tmp, npop, dispsz, loop; + /* we don't fix up userspace misalignment faults */ if (user_mode(regs)) - sp = regs->sp; - else - sp = (unsigned long) regs + sizeof(*regs); + goto bus_error; + + sp = (unsigned long) regs + sizeof(*regs); kdebug("==>misalignment({pc=%lx,sp=%lx})", regs->pc, sp); @@ -386,15 +387,15 @@ asmlinkage void misalignment(struct pt_regs *regs, enum exception_code code) } /* didn't manage to find a fixup */ - if (!user_mode(regs)) - printk(KERN_CRIT "MISALIGN: %lx: unsupported instruction %x\n", - regs->pc, opcode); + printk(KERN_CRIT "MISALIGN: %lx: unsupported instruction %x\n", + regs->pc, opcode); failed: set_fs(seg); if (die_if_no_fixup("misalignment error", regs, code)) return; +bus_error: info.si_signo = SIGBUS; info.si_errno = 0; info.si_code = BUS_ADRALN; @@ -404,31 +405,27 @@ asmlinkage void misalignment(struct pt_regs *regs, enum exception_code code) /* error reading opcodes */ fetch_error: - if (!user_mode(regs)) - printk(KERN_CRIT - "MISALIGN: %p: fault whilst reading instruction data\n", - pc); + printk(KERN_CRIT + "MISALIGN: %p: fault whilst reading instruction data\n", + pc); goto failed; bad_addr_mode: - if (!user_mode(regs)) - printk(KERN_CRIT - "MISALIGN: %lx: unsupported addressing mode %x\n", - regs->pc, opcode); + printk(KERN_CRIT + "MISALIGN: %lx: unsupported addressing mode %x\n", + regs->pc, opcode); goto failed; bad_reg_mode: - if (!user_mode(regs)) - printk(KERN_CRIT - "MISALIGN: %lx: unsupported register mode %x\n", - regs->pc, opcode); + printk(KERN_CRIT + "MISALIGN: %lx: unsupported register mode %x\n", + regs->pc, opcode); goto failed; unsupported_instruction: - if (!user_mode(regs)) - printk(KERN_CRIT - "MISALIGN: %lx: unsupported instruction %x (%s)\n", - regs->pc, opcode, pop->name); + printk(KERN_CRIT + "MISALIGN: %lx: unsupported instruction %x (%s)\n", + regs->pc, opcode, pop->name); goto failed; transfer_failed: @@ -476,16 +473,14 @@ asmlinkage void misalignment(struct pt_regs *regs, enum exception_code code) kdebug("disp=%lx", disp); set_fs(KERNEL_XDS); - if (fixup || regs->epsw & EPSW_nSL) + if (fixup) set_fs(seg); tmp = (pop->params[0] ^ pop->params[1]) & 0x80000000; if (!tmp) { - if (!user_mode(regs)) - printk(KERN_CRIT - "MISALIGN: %lx:" - " insn not move to/from memory %x\n", - regs->pc, opcode); + printk(KERN_CRIT + "MISALIGN: %lx: insn not move to/from memory %x\n", + regs->pc, opcode); goto failed; } @@ -548,7 +543,6 @@ asmlinkage void misalignment(struct pt_regs *regs, enum exception_code code) misalignment_MOV_Lcc(regs, opcode); set_fs(seg); - return; } /*