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=-14.4 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,INCLUDES_CR_TRAILER,INCLUDES_PATCH,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=unavailable 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 3E468C432BE for ; Mon, 30 Aug 2021 10:43:11 +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 0A5566023E for ; Mon, 30 Aug 2021 10:43:11 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 0A5566023E Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=kernel.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=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:In-Reply-To:MIME-Version:References: Message-ID:Subject:Cc:To:From:Date:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=25IeymqOnFtEq2tfsae2JvN/3Xglm0Hf9xrNnhmU89c=; b=j3gt2U9uxF1eRH LFl+GdhgupXuKDeoP/MCuSYYjcRZqZg+6xfzx5tCiuG/Hsl7R2gX9MA093KmfKIHYAlI+2r2TtSqG SjKD0r+f4wPz8/N7NDqZftftJYjHpBJLW57HZ+3geMJjTDpUHuefLeW+RLuF+JxrQgoOZ2KVFRLgz dvzuEJ6J4qMi7hvUuZcPlaCFtb1JgWmupklXk/l64YUTSkdO33hoecqqv7vpdhtHeUQwfy0N9bjQx if2bLIou5UPT5j7BGIT21orEP1XbgBKPPH9PWXLIrXH+idQFhiLNqwXgXesT318/NSu0P40Y5abGK 803cIa+s3HigZytRCjWw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1mKeil-00H0hT-PH; Mon, 30 Aug 2021 10:40:55 +0000 Received: from mail.kernel.org ([198.145.29.99]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1mKeii-00H0gg-Lu for linux-arm-kernel@lists.infradead.org; Mon, 30 Aug 2021 10:40:54 +0000 Received: by mail.kernel.org (Postfix) with ESMTPSA id 1E79260F44; Mon, 30 Aug 2021 10:40:47 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1630320051; bh=7qfLr0VtVSbY6W/H7Ge6jxOSj7hU+UemeOyR0BLGs7U=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=HQyzLmokeUJWuKnQGoiFODpH5hHsyVp7i2y8GTqJI4ywZkl3uD9cSQGpWZIGDV8tW p20znOkft40kCcg6kz4WmHm9nTz8XFAYVuncxo6912ks/12dFYsrlmmCXg5T7/Tisp Z8EoIQFR3la1ADN7mwXuVdKRQxkk0jcCWxivPQLx7ZyHI+IYgb/zJ2jhyo2ezOrT9k KuIG3EmaxQEuJyl248KCyip3zs7n2MiM2QF/d0zQ1NjvQUOzl9AJIGYzikLZwLkGfy sLJ0ARgw7ZCll8/MxK9wekfuAO7se8hM7Cexyyq1Vom33NVT+R8x99c9uyV6/rydQT xdJemCpc1ueBw== Date: Mon, 30 Aug 2021 13:40:44 +0300 From: Mike Rapoport To: Chen Wandun , Andrew Morton Cc: catalin.marinas@arm.com, will@kernel.org, ardb@kernel.org, nsaenz@kernel.org, anshuman.khandual@arm.com, geert+renesas@glider.be, rafael.j.wysocki@intel.com, robh@kernel.org, kirill.shtuemov@linux.intel.com, sfr@canb.auug.org.au, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, wangkefeng.wang@huawei.com, weiyongjun1@huawei.com, guohanjun@huawei.com Subject: Re: [PATCH] arm64: kdump: Skip kmemleak scan reserved memory for kdump Message-ID: References: <20210827092246.3565437-1-chenwandun@huawei.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20210827092246.3565437-1-chenwandun@huawei.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210830_034052_792538_86D21788 X-CRM114-Status: GOOD ( 18.37 ) 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 Fri, Aug 27, 2021 at 05:22:46PM +0800, Chen Wandun wrote: > Trying to boot with kdump + kmemleak, command will result in a crash: > "echo scan > /sys/kernel/debug/kmemleak" > > crashkernel reserved: 0x0000000007c00000 - 0x0000000027c00000 (512 MB) > Kernel command line: BOOT_IMAGE=(hd1,gpt2)/vmlinuz-5.14.0-rc5-next-20210809+ root=/dev/mapper/ao-root ro rd.lvm.lv=ao/root rd.lvm.lv=ao/swap crashkernel=512M > Unable to handle kernel paging request at virtual address ffff000007c00000 > Mem abort info: > ESR = 0x96000007 > EC = 0x25: DABT (current EL), IL = 32 bits > SET = 0, FnV = 0 > EA = 0, S1PTW = 0 > FSC = 0x07: level 3 translation fault > Data abort info: > ISV = 0, ISS = 0x00000007 > CM = 0, WnR = 0 > swapper pgtable: 64k pages, 48-bit VAs, pgdp=00002024f0d80000 > [ffff000007c00000] pgd=1800205ffffd0003, p4d=1800205ffffd0003, pud=1800205ffffd0003, pmd=1800205ffffc0003, pte=0068000007c00f06 > Internal error: Oops: 96000007 [#1] SMP > pstate: 804000c9 (Nzcv daIF +PAN -UAO -TCO -DIT -SSBS BTYPE=--) > pc : scan_block+0x98/0x230 > lr : scan_block+0x94/0x230 > sp : ffff80008d6cfb70 > x29: ffff80008d6cfb70 x28: 0000000000000000 x27: 0000000000000000 > x26: 00000000000000c0 x25: 0000000000000001 x24: 0000000000000000 > x23: ffffa88a6b18b398 x22: ffff000007c00ff9 x21: ffffa88a6ac7fc40 > x20: ffffa88a6af6a830 x19: ffff000007c00000 x18: 0000000000000000 > x17: 0000000000000000 x16: 0000000000000000 x15: ffffffffffffffff > x14: ffffffff00000000 x13: ffffffffffffffff x12: 0000000000000020 > x11: 0000000000000000 x10: 0000000001080000 x9 : ffffa88a6951c77c > x8 : ffffa88a6a893988 x7 : ffff203ff6cfb3c0 x6 : ffffa88a6a52b3c0 > x5 : ffff203ff6cfb3c0 x4 : 0000000000000000 x3 : 0000000000000000 > x2 : 0000000000000001 x1 : ffff20226cb56a40 x0 : 0000000000000000 > Call trace: > scan_block+0x98/0x230 > scan_gray_list+0x120/0x270 > kmemleak_scan+0x3a0/0x648 > kmemleak_write+0x3ac/0x4c8 > full_proxy_write+0x6c/0xa0 > vfs_write+0xc8/0x2b8 > ksys_write+0x70/0xf8 > __arm64_sys_write+0x24/0x30 > invoke_syscall+0x4c/0x110 > el0_svc_common+0x9c/0x190 > do_el0_svc+0x30/0x98 > el0_svc+0x28/0xd8 > el0t_64_sync_handler+0x90/0xb8 > el0t_64_sync+0x180/0x184 > > The reserved memory for kdump will be looked up by kmemleak, this area > will be set invalid when kdump service is bring up. That will result in > crash when kmemleak scan this area. > > Fixes: 461ef12c4375 ("memblock: make memblock_find_in_range method private") The commit id will change because patches in mmotm tree do not have stable commit ids... > Signed-off-by: Chen Wandun Reviewed-by: Mike Rapoport Andrew, can you please pick it up? > --- > arch/arm64/mm/init.c | 2 ++ > 1 file changed, 2 insertions(+) > > diff --git a/arch/arm64/mm/init.c b/arch/arm64/mm/init.c > index b16be52233c6..dc0c44622bfd 100644 > --- a/arch/arm64/mm/init.c > +++ b/arch/arm64/mm/init.c > @@ -30,6 +30,7 @@ > #include > #include > #include > +#include > > #include > #include > @@ -101,6 +102,7 @@ static void __init reserve_crashkernel(void) > pr_info("crashkernel reserved: 0x%016llx - 0x%016llx (%lld MB)\n", > crash_base, crash_base + crash_size, crash_size >> 20); > > + kmemleak_ignore_phys(crash_base); > crashk_res.start = crash_base; > crashk_res.end = crash_base + crash_size - 1; > } > -- > 2.18.0.huawei.25 > -- Sincerely yours, Mike. _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel 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=-16.4 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=ham 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 80B51C432BE for ; Mon, 30 Aug 2021 10:40:54 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 58D15610D1 for ; Mon, 30 Aug 2021 10:40:54 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236376AbhH3Klq (ORCPT ); Mon, 30 Aug 2021 06:41:46 -0400 Received: from mail.kernel.org ([198.145.29.99]:40550 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236325AbhH3Klp (ORCPT ); Mon, 30 Aug 2021 06:41:45 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 1E79260F44; Mon, 30 Aug 2021 10:40:47 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1630320051; bh=7qfLr0VtVSbY6W/H7Ge6jxOSj7hU+UemeOyR0BLGs7U=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=HQyzLmokeUJWuKnQGoiFODpH5hHsyVp7i2y8GTqJI4ywZkl3uD9cSQGpWZIGDV8tW p20znOkft40kCcg6kz4WmHm9nTz8XFAYVuncxo6912ks/12dFYsrlmmCXg5T7/Tisp Z8EoIQFR3la1ADN7mwXuVdKRQxkk0jcCWxivPQLx7ZyHI+IYgb/zJ2jhyo2ezOrT9k KuIG3EmaxQEuJyl248KCyip3zs7n2MiM2QF/d0zQ1NjvQUOzl9AJIGYzikLZwLkGfy sLJ0ARgw7ZCll8/MxK9wekfuAO7se8hM7Cexyyq1Vom33NVT+R8x99c9uyV6/rydQT xdJemCpc1ueBw== Date: Mon, 30 Aug 2021 13:40:44 +0300 From: Mike Rapoport To: Chen Wandun , Andrew Morton Cc: catalin.marinas@arm.com, will@kernel.org, ardb@kernel.org, nsaenz@kernel.org, anshuman.khandual@arm.com, geert+renesas@glider.be, rafael.j.wysocki@intel.com, robh@kernel.org, kirill.shtuemov@linux.intel.com, sfr@canb.auug.org.au, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, wangkefeng.wang@huawei.com, weiyongjun1@huawei.com, guohanjun@huawei.com Subject: Re: [PATCH] arm64: kdump: Skip kmemleak scan reserved memory for kdump Message-ID: References: <20210827092246.3565437-1-chenwandun@huawei.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20210827092246.3565437-1-chenwandun@huawei.com> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Aug 27, 2021 at 05:22:46PM +0800, Chen Wandun wrote: > Trying to boot with kdump + kmemleak, command will result in a crash: > "echo scan > /sys/kernel/debug/kmemleak" > > crashkernel reserved: 0x0000000007c00000 - 0x0000000027c00000 (512 MB) > Kernel command line: BOOT_IMAGE=(hd1,gpt2)/vmlinuz-5.14.0-rc5-next-20210809+ root=/dev/mapper/ao-root ro rd.lvm.lv=ao/root rd.lvm.lv=ao/swap crashkernel=512M > Unable to handle kernel paging request at virtual address ffff000007c00000 > Mem abort info: > ESR = 0x96000007 > EC = 0x25: DABT (current EL), IL = 32 bits > SET = 0, FnV = 0 > EA = 0, S1PTW = 0 > FSC = 0x07: level 3 translation fault > Data abort info: > ISV = 0, ISS = 0x00000007 > CM = 0, WnR = 0 > swapper pgtable: 64k pages, 48-bit VAs, pgdp=00002024f0d80000 > [ffff000007c00000] pgd=1800205ffffd0003, p4d=1800205ffffd0003, pud=1800205ffffd0003, pmd=1800205ffffc0003, pte=0068000007c00f06 > Internal error: Oops: 96000007 [#1] SMP > pstate: 804000c9 (Nzcv daIF +PAN -UAO -TCO -DIT -SSBS BTYPE=--) > pc : scan_block+0x98/0x230 > lr : scan_block+0x94/0x230 > sp : ffff80008d6cfb70 > x29: ffff80008d6cfb70 x28: 0000000000000000 x27: 0000000000000000 > x26: 00000000000000c0 x25: 0000000000000001 x24: 0000000000000000 > x23: ffffa88a6b18b398 x22: ffff000007c00ff9 x21: ffffa88a6ac7fc40 > x20: ffffa88a6af6a830 x19: ffff000007c00000 x18: 0000000000000000 > x17: 0000000000000000 x16: 0000000000000000 x15: ffffffffffffffff > x14: ffffffff00000000 x13: ffffffffffffffff x12: 0000000000000020 > x11: 0000000000000000 x10: 0000000001080000 x9 : ffffa88a6951c77c > x8 : ffffa88a6a893988 x7 : ffff203ff6cfb3c0 x6 : ffffa88a6a52b3c0 > x5 : ffff203ff6cfb3c0 x4 : 0000000000000000 x3 : 0000000000000000 > x2 : 0000000000000001 x1 : ffff20226cb56a40 x0 : 0000000000000000 > Call trace: > scan_block+0x98/0x230 > scan_gray_list+0x120/0x270 > kmemleak_scan+0x3a0/0x648 > kmemleak_write+0x3ac/0x4c8 > full_proxy_write+0x6c/0xa0 > vfs_write+0xc8/0x2b8 > ksys_write+0x70/0xf8 > __arm64_sys_write+0x24/0x30 > invoke_syscall+0x4c/0x110 > el0_svc_common+0x9c/0x190 > do_el0_svc+0x30/0x98 > el0_svc+0x28/0xd8 > el0t_64_sync_handler+0x90/0xb8 > el0t_64_sync+0x180/0x184 > > The reserved memory for kdump will be looked up by kmemleak, this area > will be set invalid when kdump service is bring up. That will result in > crash when kmemleak scan this area. > > Fixes: 461ef12c4375 ("memblock: make memblock_find_in_range method private") The commit id will change because patches in mmotm tree do not have stable commit ids... > Signed-off-by: Chen Wandun Reviewed-by: Mike Rapoport Andrew, can you please pick it up? > --- > arch/arm64/mm/init.c | 2 ++ > 1 file changed, 2 insertions(+) > > diff --git a/arch/arm64/mm/init.c b/arch/arm64/mm/init.c > index b16be52233c6..dc0c44622bfd 100644 > --- a/arch/arm64/mm/init.c > +++ b/arch/arm64/mm/init.c > @@ -30,6 +30,7 @@ > #include > #include > #include > +#include > > #include > #include > @@ -101,6 +102,7 @@ static void __init reserve_crashkernel(void) > pr_info("crashkernel reserved: 0x%016llx - 0x%016llx (%lld MB)\n", > crash_base, crash_base + crash_size, crash_size >> 20); > > + kmemleak_ignore_phys(crash_base); > crashk_res.start = crash_base; > crashk_res.end = crash_base + crash_size - 1; > } > -- > 2.18.0.huawei.25 > -- Sincerely yours, Mike.