From patchwork Wed Nov 30 08:03:56 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Maninder Singh X-Patchwork-Id: 9453889 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 86FCE60585 for ; Wed, 30 Nov 2016 08:10:46 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 7809B283E9 for ; Wed, 30 Nov 2016 08:10:46 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 6B05D283F8; Wed, 30 Nov 2016 08:10:46 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-4.2 required=2.0 tests=BAYES_00, RCVD_IN_DNSWL_MED autolearn=unavailable version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.9]) (using TLSv1.2 with cipher AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id E950A283E9 for ; Wed, 30 Nov 2016 08:10:45 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.85_2 #1 (Red Hat Linux)) id 1cBzx6-0006n1-4J; Wed, 30 Nov 2016 08:09:16 +0000 Received: from mailout1.samsung.com ([203.254.224.24]) by bombadil.infradead.org with esmtps (Exim 4.85_2 #1 (Red Hat Linux)) id 1cBzx1-0006Xz-1v for linux-arm-kernel@lists.infradead.org; Wed, 30 Nov 2016 08:09:12 +0000 Received: from epcpsbgm2new.samsung.com (epcpsbgm2 [203.254.230.27]) by mailout1.samsung.com (Oracle Communications Messaging Server 7.0.5.31.0 64bit (built May 5 2014)) with ESMTP id <0OHG00EQO3YG4600@mailout1.samsung.com> for linux-arm-kernel@lists.infradead.org; Wed, 30 Nov 2016 17:08:47 +0900 (KST) X-AuditID: cbfee61b-f796f6d000004092-60-583e890f792f Received: from epmmp2 ( [203.254.227.17]) by epcpsbgm2new.samsung.com (EPCPMTA) with SMTP id 98.5D.16530.F098E385; Wed, 30 Nov 2016 17:08:47 +0900 (KST) Received: from localhost.localdomain ([107.108.92.210]) by mmp2.samsung.com (Oracle Communications Messaging Server 7.0.5.31.0 64bit (built May 5 2014)) with ESMTPA id <0OHG00A4Z3YHNQA0@mmp2.samsung.com>; Wed, 30 Nov 2016 17:08:47 +0900 (KST) From: Maninder Singh To: catalin.marinas@arm.com, will.deacon@arm.com, james.morse@arm.com, mark.rutland@arm.com, akpm@linux-foundation.org, sandeepa.s.prabhu@gmail.com, labbott@redhat.com, shijie.huang@arm.com Subject: [PATCH 1/2] arm64: Correcting format specifier for printin 64 bit addresses Date: Wed, 30 Nov 2016 13:33:56 +0530 Message-id: <1480493036-47334-1-git-send-email-maninder1.s@samsung.com> X-Mailer: git-send-email 1.9.1 X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFmpikeLIzCtJLcpLzFFi42I5/e+xoC5/p12Ewexf4hYvXk1gsZizfg2b xftlPYwW9/ctZ7JYuecHk8Wmx9dYLS7vmsNmcXh+G4vF0usXmSzuvdnKZPFoyQE2iztds5gs Dp2cy2jx8uMJFgc+jzXz1jB67Jx1l93jxIzfLB6bl9R7vN93lc2jb8sqRo/Pm+QC2KPcbDJS E1NSixRS85LzUzLz0m2VQkPcdC2UFPISc1NtlSJ0fUOClBTKEnNKgTwjAzTg4BzgHqykb5fg ljF54hGWgk7hinNdi9gaGG/ydzFyckgImEh0duxkhrDFJC7cW8/WxcjFISQwi1HiRfcesISQ wE9GiW2XS0FsNgE9iVW79rCAFIkIHGSU2NmxBqyDWeAoo8TEa11gHcICYRKdbc/ZQWwWAVWJ o8c7GEFsXgF3iXkbm6DWyUmcPDaZdQIj9wJGhlWMEqkFyQXFSem5Rnmp5XrFibnFpXnpesn5 uZsYweH/THoH4+Fd7ocYBTgYlXh4F8yxjRBiTSwrrsw9xCjBwawkwmvebhchxJuSWFmVWpQf X1Sak1p8iNEU6ICJzFKiyfnA2MwriTc0MTcxNzawMLe0NDFSEudtnP0sXEggPbEkNTs1tSC1 CKaPiYNTqoHxqMzimxKyXb9UlR7cdLkvKX/Q3zunfHPhhpQ/rDP12k0dl8/flNG65brMulSB 829tLAsnM22/waqrdZIhIP3Vn5337Le/PfPu5t7r+/na3bSZo1dJb/Ta8WfNm+MqcrP+nCw3 uM0sVr/2v69scJkXx/bwbYdjI6YcKrec94rD1OVQ2IMLge3sSizFGYmGWsxFxYkAN82dfZUC AAA= X-MTR: 20000000000000000@CPGS X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20161130_000911_387856_E88BA275 X-CRM114-Status: GOOD ( 11.53 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Vaneet Narang , linux-kernel@vger.kernel.org, ajeet.y@samsung.com, Maninder Singh , linux-arm-kernel@lists.infradead.org, pankaj.m@samsung.com MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP This patch corrects format specifier for printing 64 bit addresses. Before Patch ============ [ 68.251603] Unable to handle kernel NULL pointer dereference at virtual address 00000000 [ 68.251673] pgd = ffffffc013950000 [ 68.251782] [00000000] *pgd=0000000093e19003, *pud=0000000093e19003, *pmd=0000000000000000 After patch =========== [ 8.565030] Unable to handle kernel NULL pointer dereference at virtual address 0000000000000000 [ 8.565389] pgd = ffffffc013872000 [ 8.565553] [0000000000000000] *pgd=0000000093874003, *pud=0000000093874003, *pmd=0000000000000000 and same for user space fault. Signed-off-by: Vaneet Narang Signed-off-by: Maninder Singh --- arch/arm64/mm/fault.c | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/arch/arm64/mm/fault.c b/arch/arm64/mm/fault.c index a78a5c4..8cb5c93 100644 --- a/arch/arm64/mm/fault.c +++ b/arch/arm64/mm/fault.c @@ -77,7 +77,7 @@ void show_pte(struct mm_struct *mm, unsigned long addr) pr_alert("pgd = %p\n", mm->pgd); pgd = pgd_offset(mm, addr); - pr_alert("[%08lx] *pgd=%016llx", addr, pgd_val(*pgd)); + pr_alert("[%016lx] *pgd=%016llx", addr, pgd_val(*pgd)); do { pud_t *pud; @@ -177,7 +177,7 @@ static void __do_kernel_fault(struct mm_struct *mm, unsigned long addr, * No handler, we'll have to terminate things with extreme prejudice. */ bust_spinlocks(1); - pr_alert("Unable to handle kernel %s at virtual address %08lx\n", + pr_alert("Unable to handle kernel %s at virtual address %016lx\n", (addr < PAGE_SIZE) ? "NULL pointer dereference" : "paging request", addr); @@ -198,9 +198,15 @@ static void __do_user_fault(struct task_struct *tsk, unsigned long addr, struct siginfo si; if (unhandled_signal(tsk, sig) && show_unhandled_signals_ratelimited()) { - pr_info("%s[%d]: unhandled %s (%d) at 0x%08lx, esr 0x%03x\n", - tsk->comm, task_pid_nr(tsk), fault_name(esr), sig, - addr, esr); + if (compat_user_mode(regs)) + pr_info("%s[%d]: unhandled %s (%d) at 0x%08lx, esr 0x%03x\n", + tsk->comm, task_pid_nr(tsk), fault_name(esr), sig, + addr, esr); + else + pr_info("%s[%d]: unhandled %s (%d) at 0x%016lx, esr 0x%03x\n", + tsk->comm, task_pid_nr(tsk), fault_name(esr), sig, + addr, esr); + show_pte(tsk->mm, addr); show_regs(regs); }