From patchwork Mon Jan 16 18:02:16 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dave Martin X-Patchwork-Id: 6234 Return-Path: X-Original-To: patchwork@peony.canonical.com Delivered-To: patchwork@peony.canonical.com Received: from fiordland.canonical.com (fiordland.canonical.com [91.189.94.145]) by peony.canonical.com (Postfix) with ESMTP id BF1F723F83 for ; Mon, 16 Jan 2012 18:02:30 +0000 (UTC) Received: from mail-bk0-f52.google.com (mail-bk0-f52.google.com [209.85.214.52]) by fiordland.canonical.com (Postfix) with ESMTP id A1980A1830D for ; Mon, 16 Jan 2012 18:02:30 +0000 (UTC) Received: by bkbzt4 with SMTP id zt4so820586bkb.11 for ; Mon, 16 Jan 2012 10:02:30 -0800 (PST) Received: by 10.205.139.66 with SMTP id iv2mr5433717bkc.27.1326736950343; Mon, 16 Jan 2012 10:02:30 -0800 (PST) X-Forwarded-To: linaro-patchwork@canonical.com X-Forwarded-For: patch@linaro.org linaro-patchwork@canonical.com Delivered-To: patches@linaro.org Received: by 10.205.82.144 with SMTP id ac16cs96987bkc; Mon, 16 Jan 2012 10:02:30 -0800 (PST) Received: by 10.181.13.208 with SMTP id fa16mr22159092wid.12.1326736948638; Mon, 16 Jan 2012 10:02:28 -0800 (PST) Received: from mail-wi0-f178.google.com (mail-wi0-f178.google.com [209.85.212.178]) by mx.google.com with ESMTPS id o19si10384075weq.18.2012.01.16.10.02.28 (version=TLSv1/SSLv3 cipher=OTHER); Mon, 16 Jan 2012 10:02:28 -0800 (PST) Received-SPF: neutral (google.com: 209.85.212.178 is neither permitted nor denied by best guess record for domain of dave.martin@linaro.org) client-ip=209.85.212.178; Authentication-Results: mx.google.com; spf=neutral (google.com: 209.85.212.178 is neither permitted nor denied by best guess record for domain of dave.martin@linaro.org) smtp.mail=dave.martin@linaro.org Received: by wibhj19 with SMTP id hj19so2841721wib.37 for ; Mon, 16 Jan 2012 10:02:28 -0800 (PST) Received: by 10.180.100.200 with SMTP id fa8mr20130242wib.8.1326736948367; Mon, 16 Jan 2012 10:02:28 -0800 (PST) Received: from e103592.peterhouse.linaro.org (fw-lnat.cambridge.arm.com. [217.140.96.63]) by mx.google.com with ESMTPS id q34sm23175571wbm.15.2012.01.16.10.02.26 (version=SSLv3 cipher=OTHER); Mon, 16 Jan 2012 10:02:27 -0800 (PST) From: Dave Martin To: linux-arm-kernel@lists.infradead.org Cc: patches@linaro.org, Javi Merino Subject: [PATCH] ARM: alignment: Enable verbose fault messages for user BUS_ADRALN signals Date: Mon, 16 Jan 2012 18:02:16 +0000 Message-Id: <1326736936-27443-1-git-send-email-dave.martin@linaro.org> X-Mailer: git-send-email 1.7.4.1 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 --- 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 { /*