diff options
-rw-r--r-- | arch/sh/kernel/traps_32.c | 18 |
1 files changed, 12 insertions, 6 deletions
diff --git a/arch/sh/kernel/traps_32.c b/arch/sh/kernel/traps_32.c index 3da5a125d88..86639beac3a 100644 --- a/arch/sh/kernel/traps_32.c +++ b/arch/sh/kernel/traps_32.c | |||
@@ -452,12 +452,18 @@ int handle_unaligned_access(insn_size_t instruction, struct pt_regs *regs, | |||
452 | rm = regs->regs[index]; | 452 | rm = regs->regs[index]; |
453 | 453 | ||
454 | /* shout about fixups */ | 454 | /* shout about fixups */ |
455 | if (!expected && printk_ratelimit()) | 455 | if (!expected) { |
456 | printk(KERN_NOTICE "Fixing up unaligned %s access " | 456 | if (user_mode(regs) && (se_usermode & 1) && printk_ratelimit()) |
457 | "in \"%s\" pid=%d pc=0x%p ins=0x%04hx\n", | 457 | pr_notice("Fixing up unaligned userspace access " |
458 | user_mode(regs) ? "userspace" : "kernel", | 458 | "in \"%s\" pid=%d pc=0x%p ins=0x%04hx\n", |
459 | current->comm, task_pid_nr(current), | 459 | current->comm, task_pid_nr(current), |
460 | (void *)regs->pc, instruction); | 460 | (void *)regs->pc, instruction); |
461 | else if (se_kernmode_warn && printk_ratelimit()) | ||
462 | pr_notice("Fixing up unaligned kernel access " | ||
463 | "in \"%s\" pid=%d pc=0x%p ins=0x%04hx\n", | ||
464 | current->comm, task_pid_nr(current), | ||
465 | (void *)regs->pc, instruction); | ||
466 | } | ||
461 | 467 | ||
462 | ret = -EFAULT; | 468 | ret = -EFAULT; |
463 | switch (instruction&0xF000) { | 469 | switch (instruction&0xF000) { |