From: dave.martin@linaro.org (Dave Martin)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH] ARM: alignment: Enable verbose fault messages for user BUS_ADRALN signals
Date: Mon, 16 Jan 2012 18:02:16 +0000 [thread overview]
Message-ID: <1326736936-27443-1-git-send-email-dave.martin@linaro.org> (raw)
A UDBG_BUS flag (1 << 4) is recognised for the user_debug= command
line option to the kernel, but currently this does not cause
anything to be printed for unhandled alignment faults delivered to
userspace.
This patch reports such faults to the kernel log when the UDBG_BUS
flag it set, in a similar way to the way other faults are already
reported.
Signed-off-by: Dave Martin <dave.martin@linaro.org>
---
arch/arm/mm/alignment.c | 11 +++++++++++
1 files changed, 11 insertions(+), 0 deletions(-)
diff --git a/arch/arm/mm/alignment.c b/arch/arm/mm/alignment.c
index c335c76..3e1c616 100644
--- a/arch/arm/mm/alignment.c
+++ b/arch/arm/mm/alignment.c
@@ -922,6 +922,17 @@ do_alignment(unsigned long addr, unsigned int fsr, struct pt_regs *regs)
si.si_code = BUS_ADRALN;
si.si_addr = (void __user *)addr;
+#ifdef CONFIG_DEBUG_USER
+ if (user_debug & UDBG_BUS) {
+ printk(KERN_DEBUG "%s: alignment fault (%d) at 0x%08lx, code 0x%03x\n",
+ current->comm, si.si_signo,
+ (unsigned long)si.si_addr, fsr);
+
+ show_pte(current->mm, addr);
+ show_regs(regs);
+ }
+#endif
+
force_sig_info(si.si_signo, &si, current);
} else {
/*
--
1.7.4.1
reply other threads:[~2012-01-16 18:02 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1326736936-27443-1-git-send-email-dave.martin@linaro.org \
--to=dave.martin@linaro.org \
--cc=linux-arm-kernel@lists.infradead.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).