Received: by 2002:a05:6a10:22f:0:0:0:0 with SMTP id 15csp3474248pxk; Mon, 21 Sep 2020 14:55:14 -0700 (PDT) X-Google-Smtp-Source: ABdhPJw/uDeFvKfWsppV+99Q0s4LPZ5ANoSpcxXiuYsq3s5A7pxg78UsJmGEoAyLhz8w86lgD7pa X-Received: by 2002:a50:f1d1:: with SMTP id y17mr924403edl.231.1600725314248; Mon, 21 Sep 2020 14:55:14 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1600725314; cv=none; d=google.com; s=arc-20160816; b=bkk6S54xjjS0Ec9qOR15pPp1QeerNDQsL6ChDMaP9C1xBvj1DiTRqZ3boSVszcT3iH GH7vnG2jh5VcAligvtHyn123AC/Rc0B19Jgi5pH+XvLBjgSOhYET6GQ8ORmFu2WJdIY7 oGYSrktmm0O2KcMrIehKy502T0t4nw3qfROrnKQR5SYWdpEBCEgUv3+vCzcT4GSMqMXJ KzczDLhuaQl+QZe9/kl7kN67iF5tjvuMwqLc5qx2Cz+ir6AY49NUlwGtJ6ICSt0RwOAX dsPZ4sVteyBalNAnYTwtWyUqQbmbxCSr1XwMFrzTwl6WnE1QOgBgws6k/h+gFxl7G1gT MY3A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:user-agent:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date; bh=d1dRL+zx2DBM4pt1rU68a1cpGRa3Cqt9cCWZQ5R+A5g=; b=yaDmoVKddI3IZQn3OyseaNH/s/1HVmFqIeY1XvtiCteJx1lrw+LmoHl2sEMu7rg9IF dOaCqM/7/kPAnmkCjcVYJCNe1GJUoJSG5NFSiRp+f1HycoE2A5woKDEAVDH2KoJ4MJHb vARpw4NIpFaUN8yNa6ciYmLNxIQeOdhwbeG0/bJGE0/XRn70Zpq4/vZhwnJ0KrnLoyRt UPLFlZdEtgsM3qAd1ubNH50dRNlHsJKFSD7UxjDqSn05AQUgTs2q/dk7BMu0DV01ToX5 8+alZnJNwPMqgQL3/L/buFnaDmZ1ZHNcNGAbnU0Jz/vKQLyoaJTc+7u25FnTF+UyIpus 6VBA== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id rh17si9153097ejb.128.2020.09.21.14.54.50; Mon, 21 Sep 2020 14:55:14 -0700 (PDT) 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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728346AbgIUVxK (ORCPT + 99 others); Mon, 21 Sep 2020 17:53:10 -0400 Received: from elvis.franken.de ([193.175.24.41]:49923 "EHLO elvis.franken.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726574AbgIUVxK (ORCPT ); Mon, 21 Sep 2020 17:53:10 -0400 Received: from uucp (helo=alpha) by elvis.franken.de with local-bsmtp (Exim 3.36 #1) id 1kKSuS-0001Rx-0B; Mon, 21 Sep 2020 22:59:40 +0200 Received: by alpha.franken.de (Postfix, from userid 1000) id A0D27C0FE4; Mon, 21 Sep 2020 22:41:03 +0200 (CEST) Date: Mon, 21 Sep 2020 22:41:03 +0200 From: Thomas Bogendoerfer To: Youling Tang Cc: linux-mips@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] MIPS: kexec: Add crashkernel=YM handling Message-ID: <20200921204103.GK29322@alpha.franken.de> References: <1600480546-10448-1-git-send-email-tangyouling@loongson.cn> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1600480546-10448-1-git-send-email-tangyouling@loongson.cn> User-Agent: Mutt/1.5.23 (2014-03-12) Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sat, Sep 19, 2020 at 09:55:46AM +0800, Youling Tang wrote: > When the kernel crashkernel parameter is specified with just a size, > we are supposed to allocate a region from RAM to store the crashkernel. > However, MIPS merely reserves physical address zero with no checking > that there is even RAM there. > > Fix this by lifting similar code from x86, importing it to MIPS with the > MIPS specific parameters added. In the absence of any platform specific > information, we allocate the crashkernel region from the first 512MB of > physical memory (limited to CKSEG0 or KSEG0 address range). > > When X is not specified, crash_base defaults to 0 (crashkernel=YM@XM). > > E.g. without this patch: > > The environment as follows: > [ 0.000000] MIPS: machine is loongson,loongson64c-4core-ls7a > ... > [ 0.000000] Kernel command line: root=/dev/sda2 crashkernel=96M ... > > The warning as follows: > [ 0.000000] Invalid memory region reserved for crash kernel > > And the iomem as follows: > 00200000-0effffff : System RAM > 00200000-00b47f87 : Kernel code > 00b47f88-00dfffff : Kernel data > 00e60000-01f73c7f : Kernel bss > 1a000000-1bffffff : pci@1a000000 > ... > > With this patch: > > After increasing crash_base <= 0 handling. > > And the iomem as follows: > 00200000-0effffff : System RAM > 00200000-00b47f87 : Kernel code > 00b47f88-00dfffff : Kernel data > 00e60000-01f73c7f : Kernel bss > 04000000-09ffffff : Crash kernel > 1a000000-1bffffff : pci@1a000000 > ... > > Signed-off-by: Youling Tang > --- > arch/mips/kernel/setup.c | 24 +++++++++++++++++++++--- > 1 file changed, 21 insertions(+), 3 deletions(-) applied to mips-next. Thomas. -- Crap can work. Given enough thrust pigs will fly, but it's not necessarily a good idea. [ RFC1925, 2.3 ]