Received: by 2002:a05:6a10:16a7:0:0:0:0 with SMTP id gp39csp179999pxb; Thu, 12 Nov 2020 00:27:13 -0800 (PST) X-Google-Smtp-Source: ABdhPJznKT/RUof03MLv8eS1sqWIJX4ycUIKTh99RRcfmyUulkdfb+hDdcsWoVI7qPuUMH/jJkbl X-Received: by 2002:a17:906:e254:: with SMTP id gq20mr29674829ejb.520.1605169633314; Thu, 12 Nov 2020 00:27:13 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1605169633; cv=none; d=google.com; s=arc-20160816; b=v0EFd2beLnE8rTx/CbhTZdeC5TQOoYmI1xfQSdpmlv2oN3CgHvWZdmw/TpXKTe5eDZ PEN4m8PL0CYof58NE7aZ4JokkNL8xsfw7A+MX3+f1J9jQUG5NR166FL9k3Jecx9gdi2q O7KJZ4yOjJrrh0idSyUiO0C2frLC7G2du4doRH9ppw/bRcYbVy2BDiFgllPlEuzS9c5W 349BhkpIsNDM1uiTlWbRUDWgiP2tjW3OyxPVhdpgs5A2sbAlkb6PWUa87zsxX/nbko9B DXkPrCI37V4bKYihxsYtqMR8xjDHcX0s8e+InDNqtZN6JfIvvtaOiDBFqvC1vhhjWRps nlzw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=5vjOrd1cZw3Io9R9HZu9fKXnkgYkYiO5LsWjy+Qd6Ec=; b=ecxFuEKtUhxMo6LedL5jTyvJa2SgyAQdicDxTeEtcmG0u4DgjcVonEfvmvCjerWIoZ taKDF178RqTNkj27pf4GUCJ2KfLpfK2v0RmmI6LjpAKUKqjIPuxolrx6wOk8NJFUvXx+ 3Ef41OhIMmIrrRkdSeIHkc1DO8iLASWerAuUWnc+e2WHM6pFyXQULcirMFy65ZfaDIWJ SRFl7inxJx4CugBCSx6ySWaFZV3aPH3rW8ez8ZkZMsh91u6+kdZ4KdO6sqEbESiYnLii KG458WcDahlphJeLFWy1G2KDX3IuT+iGKBc/xBOISXusRXOmYjcmpRoRDzr0mbsY9l2L ep+A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=Q1nGDHIg; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id di3si3180954edb.554.2020.11.12.00.26.49; Thu, 12 Nov 2020 00:27:13 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=Q1nGDHIg; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726028AbgKLIZU (ORCPT + 99 others); Thu, 12 Nov 2020 03:25:20 -0500 Received: from mail.kernel.org ([198.145.29.99]:50166 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725884AbgKLIZU (ORCPT ); Thu, 12 Nov 2020 03:25:20 -0500 Received: from kernel.org (unknown [77.125.7.142]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 2214F20825; Thu, 12 Nov 2020 08:25:12 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1605169519; bh=uWlq5g2efEJEyEf0HFhZWgsDo31n3Eku7MoV4h7mxvU=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=Q1nGDHIgUsRkPUQwR6MOSN6vGzERQBecgGM4PIsPLrnHLE2t3Hsua/Bj1MXi5Z5tv Co+Pf2lmCdcadAJKLpPH++5OwrXd8/IYOWaj0K3EpLrHSplmHZZbEGzz5iinasPzHz 4PRpumS2d+e1+B4IgTcLfg4thRgQV7UXAYtH9FPc= Date: Thu, 12 Nov 2020 10:25:09 +0200 From: Mike Rapoport To: Baoquan He Cc: chenzhou , tglx@linutronix.de, mingo@redhat.com, dyoung@redhat.com, catalin.marinas@arm.com, will@kernel.org, corbet@lwn.net, John.P.donnelly@oracle.com, bhsharma@redhat.com, prabhakar.pkin@gmail.com, wangkefeng.wang@huawei.com, arnd@arndb.de, linux-doc@vger.kernel.org, xiexiuqi@huawei.com, kexec@lists.infradead.org, linux-kernel@vger.kernel.org, robh+dt@kernel.org, horms@verge.net.au, james.morse@arm.com, linux-arm-kernel@lists.infradead.org, huawei.libin@huawei.com, guohanjun@huawei.com, nsaenzjulienne@suse.de Subject: Re: [PATCH v13 6/8] arm64: kdump: reimplement crashkernel=X Message-ID: <20201112082509.GL4758@kernel.org> References: <20201031074437.168008-1-chenzhou10@huawei.com> <20201031074437.168008-7-chenzhou10@huawei.com> <20201111015926.GD24747@MiWiFi-R3L-srv> <23389389-2855-50fd-25b7-4f7d4246bf0c@huawei.com> <20201111135448.GF8486@MiWiFi-R3L-srv> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20201111135448.GF8486@MiWiFi-R3L-srv> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Nov 11, 2020 at 09:54:48PM +0800, Baoquan He wrote: > On 11/11/20 at 09:27pm, chenzhou wrote: > > Hi Baoquan, > ... > > >> #ifdef CONFIG_CRASH_DUMP > > >> static int __init early_init_dt_scan_elfcorehdr(unsigned long node, > > >> diff --git a/arch/arm64/mm/mmu.c b/arch/arm64/mm/mmu.c > > >> index 1c0f3e02f731..c55cee290bbb 100644 > > >> --- a/arch/arm64/mm/mmu.c > > >> +++ b/arch/arm64/mm/mmu.c > > >> @@ -488,6 +488,10 @@ static void __init map_mem(pgd_t *pgdp) > > >> */ > > >> memblock_mark_nomap(kernel_start, kernel_end - kernel_start); > > >> #ifdef CONFIG_KEXEC_CORE > > >> + if (crashk_low_res.end) > > >> + memblock_mark_nomap(crashk_low_res.start, > > >> + resource_size(&crashk_low_res)); > > >> + > > >> if (crashk_res.end) > > >> memblock_mark_nomap(crashk_res.start, > > >> resource_size(&crashk_res)); > > >> diff --git a/kernel/crash_core.c b/kernel/crash_core.c > > >> index d39892bdb9ae..cdef7d8c91a6 100644 > > >> --- a/kernel/crash_core.c > > >> +++ b/kernel/crash_core.c > > >> @@ -321,7 +321,7 @@ int __init parse_crashkernel_low(char *cmdline, > > >> > > >> int __init reserve_crashkernel_low(void) > > >> { > > >> -#ifdef CONFIG_X86_64 > > >> +#if defined(CONFIG_X86_64) || defined(CONFIG_ARM64) > > > Not very sure if a CONFIG_64BIT checking is better. > > If doing like this, there may be some compiling errors for other 64-bit kernel, such as mips. > > > > > >> unsigned long long base, low_base = 0, low_size = 0; > > >> unsigned long low_mem_limit; > > >> int ret; > > >> @@ -362,12 +362,14 @@ int __init reserve_crashkernel_low(void) > > >> > > >> crashk_low_res.start = low_base; > > >> crashk_low_res.end = low_base + low_size - 1; > > >> +#ifdef CONFIG_X86_64 > > >> insert_resource(&iomem_resource, &crashk_low_res); > > >> +#endif > > >> #endif > > >> return 0; > > >> } > > >> > > >> -#ifdef CONFIG_X86 > > >> +#if defined(CONFIG_X86) || defined(CONFIG_ARM64) > > > Should we make this weak default so that we can remove the ARCH config? > > The same as above, some arch may not support kdump, in that case, compiling errors occur. > > OK, not sure if other people have better idea, oterwise, we can leave with it. > Thanks for telling. I think it would be better to have CONFIG_ARCH_WANT_RESERVE_CRASH_KERNEL in arch/Kconfig and select this by X86 and ARM64. Since reserve_crashkernel() implementations are quite similart on other architectures as well, we can have more users of this later. -- Sincerely yours, Mike.