From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-5.4 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,UNPARSEABLE_RELAY,URIBL_BLOCKED,USER_AGENT_SANE_2 autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 01747C48BE5 for ; Wed, 16 Jun 2021 00:43:57 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id BC17961107 for ; Wed, 16 Jun 2021 00:43:56 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org BC17961107 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=mediatek.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Date:CC:To:From:Subject:Message-ID:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=HJ0UnpFbaWvrHF2u4wYKX5ABYAtZ1IBVumeBju94eZ8=; b=GhmTY2DEHw/akt qpv5thHA7EMgFmu6mbXDWIte9AJzEMqPjHlTiL+/sNWcajIVJ5xuMHZ0Y6T0g4IRWgojqionKJ7CK 31IgQsUdaaOkCWAIWyegLWned5N3F9VgsmZVXGm8eKJV04CSr1kMxUUHdXQ7hqaA3UIaRvacW1M+7 9OobO2Pjs2PklXjyuj3PNphj0ZdMjbrb8qH4mGlGqjrQuvbwXBPRypwLwvN2V22RimU5Osktv4i9d bdhfmfb1HIN4C2skUVA3nB6QTayDy4q2A713wsRb7pXVhPZ/ebbi+Zc2PofiMRs9yD+hTpZlW9eYu QGtcs1u6LK427WJPQK1Q==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1ltJcY-004Asy-WA; Wed, 16 Jun 2021 00:41:31 +0000 Received: from mailgw01.mediatek.com ([216.200.240.184]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1ltJaw-004A6i-Ci for linux-arm-kernel@lists.infradead.org; Wed, 16 Jun 2021 00:39:52 +0000 X-UUID: 8be62165e9ec4eaa85138fca4f5bed6d-20210615 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=mediatek.com; s=dk; h=Content-Transfer-Encoding:MIME-Version:Content-Type:References:In-Reply-To:Date:CC:To:From:Subject:Message-ID; bh=T+5dG9Zv3Son1yPsM21G3NCtpvIaSc9W4NcOU1b0ap8=; b=kosHJA69cABZ7Ux/p+hCOJUjkEbCqndBatKiVT+Z99PNM2yaY/V+uXhnUgk23Qasq5Wjd5AeFoED2V0FzubRyEan9wYH8haLfyFLW78g2TDcMTYfjmi9RC2PmCNxKXPxo7nOroAsByBoR0QWYR0WzUoKv4db72ydVv1GN9Dx/CA=; X-UUID: 8be62165e9ec4eaa85138fca4f5bed6d-20210615 Received: from mtkcas66.mediatek.inc [(172.29.193.44)] by mailgw01.mediatek.com (envelope-from ) (musrelay.mediatek.com ESMTP with TLSv1.2 ECDHE-RSA-AES256-SHA384 256/256) with ESMTP id 1975678480; Tue, 15 Jun 2021 17:39:33 -0700 Received: from MTKMBS06N2.mediatek.inc (172.21.101.130) by MTKMBS62N1.mediatek.inc (172.29.193.41) with Microsoft SMTP Server (TLS) id 15.0.1497.2; Tue, 15 Jun 2021 17:29:31 -0700 Received: from mtkcas11.mediatek.inc (172.21.101.40) by mtkmbs06n2.mediatek.inc (172.21.101.130) with Microsoft SMTP Server (TLS) id 15.0.1497.2; Wed, 16 Jun 2021 08:29:29 +0800 Received: from [172.21.77.33] (172.21.77.33) by mtkcas11.mediatek.inc (172.21.101.73) with Microsoft SMTP Server id 15.0.1497.2 via Frontend Transport; Wed, 16 Jun 2021 08:29:29 +0800 Message-ID: <1623803369.8887.9.camel@mtkswgap22> Subject: Re: [next] [arm64] kernel BUG at arch/arm64/mm/physaddr.c From: Miles Chen To: Mark Rutland CC: Naresh Kamboju , Mike Rapoport , Andrew Morton , "Linux-Next Mailing List" , linux-mm , Linux ARM , open list , Will Deacon , , , "Stephen Rothwell" , Arnd Bergmann , "Ard Biesheuvel" , Catalin Marinas , Christophe Leroy Date: Wed, 16 Jun 2021 08:29:29 +0800 In-Reply-To: <20210615131902.GB47121@C02TD0UTHF1T.local> References: <20210615124745.GA47121@C02TD0UTHF1T.local> <20210615131902.GB47121@C02TD0UTHF1T.local> X-Mailer: Evolution 3.2.3-0ubuntu6 MIME-Version: 1.0 X-MTK: N X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210615_173950_752182_0A46FDAC X-CRM114-Status: GOOD ( 26.31 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On Tue, 2021-06-15 at 14:19 +0100, Mark Rutland wrote: > On Tue, Jun 15, 2021 at 01:47:45PM +0100, Mark Rutland wrote: > > On Tue, Jun 15, 2021 at 04:41:25PM +0530, Naresh Kamboju wrote: > > > Following kernel crash reported while boot linux next 20210615 tag on qemu_arm64 > > > with allmodconfig build. > > > > > > [ 0.000000] Booting Linux on physical CPU 0x0000000000 [0x410fd034] > > > [ 0.000000] Linux version 5.13.0-rc6-next-20210615 > > > (tuxmake@ac7978cddede) (aarch64-linux-gnu-gcc (Debian 11.1.0-1) > > > 11.1.0, GNU ld (GNU Binutils for Debian) 2.36.50.20210601) #1 SMP > > > PREEMPT Tue Jun 15 10:20:51 UTC 2021 > > > [ 0.000000] Machine model: linux,dummy-virt > > > [ 0.000000] earlycon: pl11 at MMIO 0x0000000009000000 (options '') > > > [ 0.000000] printk: bootconsole [pl11] enabled > > > [ 0.000000] efi: UEFI not found. > > > [ 0.000000] NUMA: No NUMA configuration found > > > [ 0.000000] NUMA: Faking a node at [mem > > > 0x0000000040000000-0x00000000bfffffff] > > > [ 0.000000] NUMA: NODE_DATA [mem 0xbfc00d40-0xbfc03fff] > > > [ 0.000000] ------------[ cut here ]------------ > > > [ 0.000000] kernel BUG at arch/arm64/mm/physaddr.c:27! > > > [ 0.000000] Internal error: Oops - BUG: 0 [#1] PREEMPT SMP > > > [ 0.000000] Modules linked in: > > > [ 0.000000] CPU: 0 PID: 0 Comm: swapper Tainted: G T > > > 5.13.0-rc6-next-20210615 #1 c150a8161d8ff395c5ae7ee0c3c8f22c3689fae4 > > > [ 0.000000] Hardware name: linux,dummy-virt (DT) > > > [ 0.000000] pstate: 404000c5 (nZcv daIF +PAN -UAO -TCO BTYPE=--) > > > [ 0.000000] pc : __phys_addr_symbol+0x44/0xc0 > > > [ 0.000000] lr : __phys_addr_symbol+0x44/0xc0 > > > [ 0.000000] sp : ffff800014287b00 > > > [ 0.000000] x29: ffff800014287b00 x28: fc49a9b89db36f0a x27: ffffffffffffffff > > > [ 0.000000] x26: 0000000000000280 x25: 0000000000000010 x24: ffff8000145a8000 > > > [ 0.000000] x23: 0000000008000000 x22: 0000000000000010 x21: 0000000000000000 > > > [ 0.000000] x20: ffff800010000000 x19: ffff00007fc00d40 x18: 0000000000000000 > > > [ 0.000000] x17: 00000000003ee000 x16: 00000000bfc12000 x15: 0000001000000000 > > > [ 0.000000] x14: 000000000000de8c x13: 0000001000000000 x12: 00000000f1f1f1f1 > > > [ 0.000000] x11: dfff800000000000 x10: ffff700002850eea x9 : 0000000000000000 > > > [ 0.000000] x8 : ffff00007fbe0d40 x7 : 0000000000000000 x6 : 000000000000003f > > > [ 0.000000] x5 : 0000000000000040 x4 : 0000000000000005 x3 : ffff8000142bb0c0 > > > [ 0.000000] x2 : 0000000000000000 x1 : 0000000000000000 x0 : 0000000000000000 > > > [ 0.000000] Call trace: > > > [ 0.000000] __phys_addr_symbol+0x44/0xc0 > > > [ 0.000000] sparse_init_nid+0x98/0x6d0 > > > > From the looks of it, this is pgdat_to_phys, as introduced in next > > commit: > > > > e1db6ef7336d817c ("mm/sparse: fix check_usemap_section_nr warnings") > > > > It appears thta allmodconfig doesn't have CONFIG_NEED_MULTIPLE_NODES=y, > > but does have CONFIG_NUMA=y, and so *does* use the dynamically-allocated > > node_data array (since contig_page_data is only defined for !NUMA). > > > > I don't think that commit is correct. > > Looking some more, it looks like that's correct in isolation, but it > clashes with commit: > > 5831eedad2ac6f38 ("mm: replace CONFIG_NEED_MULTIPLE_NODES with CONFIG_NUMA") > > ... and I reckon it'd be clearer and more robust to define > pgdat_to_phys() in the same ifdefs as contig_page_data so that > these, stay in-sync. e.g. have: > > | #ifdef CONFIG_NUMA > | #define pgdat_to_phys(x) virt_to_phys(x) > | #else /* CONFIG_NUMA */ > | > | extern struct pglist_data contig_page_data; > | ... > | #define pgdat_to_phys(x) __pa_symbol(&contig_page_data) > | > | #endif /* CONIFIG_NUMA */ > > ... which'd also make clear that contig_page_data is the *only* expected > pglist_data. Thanks for your suggestion. It looks more clear, I will submit another patch for this. (after the merge) Miles > Thanks, > Mark. > > > Thanks, > > Mark. > > > > > [ 0.000000] sparse_init+0x460/0x4d4 > > > [ 0.000000] bootmem_init+0x110/0x340 > > > [ 0.000000] setup_arch+0x1b8/0x2e0 > > > [ 0.000000] start_kernel+0x110/0x870 > > > [ 0.000000] __primary_switched+0xa8/0xb0 > > > [ 0.000000] Code: 940ccf23 eb13029f 54000069 940cce60 (d4210000) > > > [ 0.000000] random: get_random_bytes called from > > > oops_exit+0x54/0xc0 with crng_init=0 > > > [ 0.000000] ---[ end trace 0000000000000000 ]--- > > > [ 0.000000] Kernel panic - not syncing: Oops - BUG: Fatal exception > > > [ 0.000000] ---[ end Kernel panic - not syncing: Oops - BUG: Fatal > > > exception ]--- > > > > > > Reported-by: Naresh Kamboju > > > > > > -- > > > Linaro LKFT > > > https://lkft.linaro.org _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel