From patchwork Tue Mar 10 18:54:38 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Russell King - ARM Linux X-Patchwork-Id: 5980091 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id D2675BF440 for ; Tue, 10 Mar 2015 18:58:48 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 0E84B20211 for ; Tue, 10 Mar 2015 18:58:44 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.9]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 02CE0200EC for ; Tue, 10 Mar 2015 18:58:43 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1YVPJk-0002io-2n; Tue, 10 Mar 2015 18:55:48 +0000 Received: from pandora.arm.linux.org.uk ([2001:4d48:ad52:3201:214:fdff:fe10:1be6]) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1YVPJE-00010R-H9 for linux-arm-kernel@lists.infradead.org; Tue, 10 Mar 2015 18:55:17 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=arm.linux.org.uk; s=pandora-2014; h=Sender:In-Reply-To:Content-Transfer-Encoding:Content-Type:MIME-Version:References:Message-ID:Subject:Cc:To:From:Date; bh=QakEwZACMGAA+wUW1q3s4ECszo5UzYMI6ssbGXtFBUI=; b=CLufwGjVOBMVb7tyfOVqyVH7rCkewbPAvX+eqmOdOe6vfMV13PyrSUNzRwkX+KtEIfkLkcuovDwdreo8CEPLbFVeT5eW+KWJqEMk/q/YinvS2z9L6YrN51ba8+EIlCdvHOviyJhoHm5E2d/NdNCAdcuL4hSt9NQJfiObOr/Txgs=; Received: from n2100.arm.linux.org.uk ([fd8f:7570:feb6:1:214:fdff:fe10:4f86]:47463) by pandora.arm.linux.org.uk with esmtpsa (TLSv1:DHE-RSA-AES256-SHA:256) (Exim 4.82_1-5b7a7c0-XX) (envelope-from ) id 1YVPIj-0008Ei-QB; Tue, 10 Mar 2015 18:54:45 +0000 Received: from linux by n2100.arm.linux.org.uk with local (Exim 4.76) (envelope-from ) id 1YVPId-000448-Cs; Tue, 10 Mar 2015 18:54:39 +0000 Date: Tue, 10 Mar 2015 18:54:38 +0000 From: Russell King - ARM Linux To: Stas Sergeev Subject: Re: [PATCH] n_tty: use kmalloc() instead of vmalloc() to avoid crash on armada-xp Message-ID: <20150310185438.GW8656@n2100.arm.linux.org.uk> References: <54FF21BE.2040506@list.ru> <20150310171751.GD13687@e104818-lin.cambridge.arm.com> <54FF2986.6020503@list.ru> <20150310173807.GU8656@n2100.arm.linux.org.uk> <54FF3865.8080301@list.ru> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <54FF3865.8080301@list.ru> User-Agent: Mutt/1.5.23 (2014-03-12) X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20150310_115516_973306_7C1C51F6 X-CRM114-Status: GOOD ( 22.53 ) X-Spam-Score: -0.1 (/) Cc: Catalin Marinas , Andrew Morton , Linux kernel , linux-arm-kernel@lists.infradead.org X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Spam-Status: No, score=-4.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_MED, T_DKIM_INVALID, T_RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP On Tue, Mar 10, 2015 at 09:31:01PM +0300, Stas Sergeev wrote: > 10.03.2015 20:38, Russell King - ARM Linux ?????: > > On Tue, Mar 10, 2015 at 08:27:34PM +0300, Stas Sergeev wrote: > >> Please also find the same crash here: > >> http://lists.linaro.org/pipermail/kernel-build-reports/2014-June/003872.html > > Hmm, looks like from the exynos5420-arndale-octa failure in that, we > > don't dump the page table entries. We should do. Sorry about my > > previous mail. > > > > If you can reproduce this, please do so with this patch so that we > > can get the page table entries associated with the problem. Thanks. > > > > arch/arm/mm/fault.c | 1 + > > 1 file changed, 1 insertion(+) > > > > diff --git a/arch/arm/mm/fault.c b/arch/arm/mm/fault.c > > index a982dc3190df..6333d9c17875 100644 > > --- a/arch/arm/mm/fault.c > > +++ b/arch/arm/mm/fault.c > > @@ -552,6 +552,7 @@ do_DataAbort(unsigned long addr, unsigned int fsr, struct pt_regs *regs) > > > > pr_alert("Unhandled fault: %s (0x%03x) at 0x%08lx\n", > > inf->name, fsr, addr); > > + show_pte(current->mm, addr); > > > > info.si_signo = inf->sig; > > info.si_errno = 0; > > > > Thanks. > [ 5.383283] Unhandled fault: external abort on non-linefetch (0x808) > at 0xf00d3018 > [ 5.390871] pgd = c0004000 > [ 5.393583] [f00d3018] *pgd=2d404811, *pte=efc1e65f, *ppte=efc1e45f This is interesting. So, the L1 page table entry is: PMD_TYPE_TABLE PMD_BIT4 PMD_DOMAIN(0) Pointing at physical address 0x2f404800 L2 page table entry: PTE_EXT_XN PTE_BUFFERABLE PTE_CACHEABLE PTE_EXT_AP_UNO_SRW PTE_EXT_TEX(1) PTE_EXT_SHARED Physical address 0xefc1e000 That corresponds with L_PTE_MT_WRITEALLOC, so that's a memory type mapping with cacheable, write-back, write-allocate attributes. The thing which has me wondering though is the difference in physical addresses - that looks /very/ wrong - unless you have close to 4GB of memory. Let's see whether we can get some debug from vmalloc to work out what's going on - can you also apply the patch below. Also, if you could include details about how much memory your platform has, and where it's located, that would be useful - passing memblock=debug should allow us to see what's going on at the memblock level. Also, the full kernel boot log would be useful to see. Thanks. (Patch isn't tested.) mm/vmalloc.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/mm/vmalloc.c b/mm/vmalloc.c index 35b25e1340ca..3379bcd6d280 100644 --- a/mm/vmalloc.c +++ b/mm/vmalloc.c @@ -129,6 +129,8 @@ static int vmap_pte_range(pmd_t *pmd, unsigned long addr, return -EBUSY; if (WARN_ON(!page)) return -ENOMEM; +printk("vmalloc: mapping page %p (0x%08lx000) at 0x%08lx\n", + page, page_to_pfn(page), addr); set_pte_at(&init_mm, addr, pte, mk_pte(page, prot)); (*nr)++; } while (pte++, addr += PAGE_SIZE, addr != end);