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 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id AC404C433F5 for ; Thu, 21 Oct 2021 08:29:42 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 5A7676121E for ; Thu, 21 Oct 2021 08:29:42 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 5A7676121E Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=arm.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=kvack.org Received: by kanga.kvack.org (Postfix) id D8CD76B0071; Thu, 21 Oct 2021 04:29:41 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id D16016B0072; Thu, 21 Oct 2021 04:29:41 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id BDE13900002; Thu, 21 Oct 2021 04:29:41 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0124.hostedemail.com [216.40.44.124]) by kanga.kvack.org (Postfix) with ESMTP id A97826B0071 for ; Thu, 21 Oct 2021 04:29:41 -0400 (EDT) Received: from smtpin40.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay02.hostedemail.com (Postfix) with ESMTP id 60481289F1 for ; Thu, 21 Oct 2021 08:29:41 +0000 (UTC) X-FDA: 78719770962.40.0845786 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by imf27.hostedemail.com (Postfix) with ESMTP id 91D4F7000091 for ; Thu, 21 Oct 2021 08:29:39 +0000 (UTC) Received: by mail.kernel.org (Postfix) with ESMTPSA id 9654860FC0; Thu, 21 Oct 2021 08:29:38 +0000 (UTC) Date: Thu, 21 Oct 2021 09:29:35 +0100 From: Catalin Marinas To: Mike Rapoport Cc: linux-mm@kvack.org, Andrew Morton , Linus Torvalds , Mike Rapoport , Qian Cai , Vladimir Zapolskiy , linux-kernel@vger.kernel.org Subject: Re: [PATCH v2 1/2] Revert "memblock: exclude NOMAP regions from kmemleak" Message-ID: References: <20211021070929.23272-1-rppt@kernel.org> <20211021070929.23272-2-rppt@kernel.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20211021070929.23272-2-rppt@kernel.org> X-Rspamd-Server: rspam05 X-Rspamd-Queue-Id: 91D4F7000091 X-Stat-Signature: u584cirpti4jnaz1hpoi1531sznok9o5 Authentication-Results: imf27.hostedemail.com; dkim=none; spf=pass (imf27.hostedemail.com: domain of cmarinas@kernel.org designates 198.145.29.99 as permitted sender) smtp.mailfrom=cmarinas@kernel.org; dmarc=fail reason="SPF not aligned (relaxed), No valid DKIM" header.from=arm.com (policy=none) X-HE-Tag: 1634804979-873865 X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: On Thu, Oct 21, 2021 at 10:09:28AM +0300, Mike Rapoport wrote: > From: Mike Rapoport > > Commit 6e44bd6d34d6 ("memblock: exclude NOMAP regions from kmemleak") > breaks boot on EFI systems with kmemleak and VM_DEBUG enabled: > > efi: Processing EFI memory map: > efi: 0x000090000000-0x000091ffffff [Conventional| | | | | | | | | | |WB|WT|WC|UC] > efi: 0x000092000000-0x0000928fffff [Runtime Data|RUN| | | | | | | | | |WB|WT|WC|UC] > ------------[ cut here ]------------ > kernel BUG at mm/kmemleak.c:1140! > Internal error: Oops - BUG: 0 [#1] SMP > Modules linked in: > CPU: 0 PID: 0 Comm: swapper Not tainted 5.15.0-rc6-next-20211019+ #104 > pstate: 600000c5 (nZCv daIF -PAN -UAO -TCO -DIT -SSBS BTYPE=--) > pc : kmemleak_free_part_phys+0x64/0x8c > lr : kmemleak_free_part_phys+0x38/0x8c > sp : ffff800011eafbc0 > x29: ffff800011eafbc0 x28: 1fffff7fffb41c0d x27: fffffbfffda0e068 > x26: 0000000092000000 x25: 1ffff000023d5f94 x24: ffff800011ed84d0 > x23: ffff800011ed84c0 x22: ffff800011ed83d8 x21: 0000000000900000 > x20: ffff800011782000 x19: 0000000092000000 x18: ffff800011ee0730 > x17: 0000000000000000 x16: 0000000000000000 x15: 1ffff0000233252c > x14: ffff800019a905a0 x13: 0000000000000001 x12: ffff7000023d5ed7 > x11: 1ffff000023d5ed6 x10: ffff7000023d5ed6 x9 : dfff800000000000 > x8 : ffff800011eaf6b7 x7 : 0000000000000001 x6 : ffff800011eaf6b0 > x5 : 00008ffffdc2a12a x4 : ffff7000023d5ed7 x3 : 1ffff000023dbf99 > x2 : 1ffff000022f0463 x1 : 0000000000000000 x0 : ffffffffffffffff > Call trace: > kmemleak_free_part_phys+0x64/0x8c > memblock_mark_nomap+0x5c/0x78 > reserve_regions+0x294/0x33c > efi_init+0x2d0/0x490 > setup_arch+0x80/0x138 > start_kernel+0xa0/0x3ec > __primary_switched+0xc0/0xc8 > Code: 34000041 97d526e7 f9418e80 36000040 (d4210000) > random: get_random_bytes called from print_oops_end_marker+0x34/0x80 with crng_init=0 > ---[ end trace 0000000000000000 ]--- > > The crash happens because kmemleak_free_part_phys() tries to use __va() > before memstart_addr is initialized and this triggers a VM_BUG_ON() in > arch/arm64/include/asm/memory.h: > > Revert 6e44bd6d34d6 ("memblock: exclude NOMAP regions from kmemleak"), the > issue it is fixing will be fixed differently. > > Reported-by: Qian Cai > Signed-off-by: Mike Rapoport Acked-by: Catalin Marinas