Skip to content

Commit 94a1b19

Browse files
committed
parisc: Show kernel unaligned memory accesses
Warn if some kernel function triggers unaligned memory accesses. Signed-off-by: Helge Deller <deller@gmx.de>
1 parent 73cb4a2 commit 94a1b19

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

arch/parisc/kernel/unaligned.c

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -399,6 +399,13 @@ void handle_unaligned(struct pt_regs *regs)
399399

400400
if (!unaligned_enabled)
401401
goto force_sigbus;
402+
} else {
403+
static DEFINE_RATELIMIT_STATE(kernel_ratelimit, 5 * HZ, 5);
404+
if (!(current->thread.flags & PARISC_UAC_NOPRINT) &&
405+
__ratelimit(&kernel_ratelimit))
406+
pr_warn("Kernel: unaligned access to " RFMT " in %pS "
407+
"(iir " RFMT ")\n",
408+
regs->ior, (void *)regs->iaoq[0], regs->iir);
402409
}
403410

404411
/* handle modification - OK, it's ugly, see the instruction manual */

0 commit comments

Comments
 (0)