From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from cantor2.suse.de ([195.135.220.15]:35655 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756633Ab3AHQr1 (ORCPT ); Tue, 8 Jan 2013 11:47:27 -0500 From: Thomas Renninger To: Yinghai Lu Subject: [PATCH] Only reset e820 once, even with multiple memmap=exactmap params Date: Tue, 8 Jan 2013 17:47:17 +0100 Cc: MUNEDA Takahiro , Takao Indoh , linux-pci@vger.kernel.org, x86@kernel.org, linux-kernel@vger.kernel.org, andi@firstfloor.org, tokunaga.keiich@jp.fujitsu.com, kexec@lists.infradead.org, hbabu@us.ibm.com, mingo@redhat.com, ddutile@redhat.com, vgoyal@redhat.com, ishii.hironobu@jp.fujitsu.com, hpa@zytor.com, bhelgaas@google.com, tglx@linutronix.de, khalid@gonehiking.org References: <20121127004144.3604.61708.sendpatchset@tindoh.g01.fujitsu.local> <3649945.08HKjS0y0c@hammer82.arch.suse.de> In-Reply-To: MIME-Version: 1.0 Content-Type: Text/Plain; charset="iso-8859-1" Message-Id: <201301081747.17853.trenn@suse.de> Sender: linux-pci-owner@vger.kernel.org List-ID: On Tuesday, January 08, 2013 04:04:56 AM Yinghai Lu wrote: > On Mon, Jan 7, 2013 at 4:42 PM, Thomas Renninger wrote: > > memmap=256M$3584M > > may need to change to: > > memmap=256M\$\$3584M The problem is (beside the special char $) that memmap=exactmap boot param resets all e820 maps every time the parameter is processed. And: /sbin/kexec -p xy --append="..." --initrd yx seem to magically add (append): memmap=exactmap memmap=640K@0K memmap=392556K@115328K elfcorehdr=507884K memmap=252K#3099760K therefore all memmap= I try to pass are voided out by: memmap=exactmap which is always added by kexec after my params. I could come around with attached patch and passing: /sbin/kexec -p xy --append='... memmap=exactmap memmap=256M$3584M' --initrd yx Now mmconfig is working in kdump kernel. This would mean mmconfig is broken by design in kexec? Only way to fix this I can think of is to export mmconfig area through /sys (../kernel/debug/mmconfig?, possibly already in X$Y format?) in the productive kernel and make kexec add it like the other memmap= params automatically. I'll attach the output in a separate mail. Thomas --- x86 e820: Do not reset e820 map twice, even if memmap=exactmap is passed as boot param several times This is needed to be able to explicitly pass (debug) e820 modifications through kexec via memmap=. Otherwise those get voided by kexec appending memmap=exactmap always after the user defined boot parameters. Signed-off-by: Thomas Renninger linux-2.6_t/arch/x86/kernel/e820.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) Index: git/linux-2.6_t/arch/x86/kernel/e820.c =================================================================== --- git.orig/linux-2.6_t/arch/x86/kernel/e820.c +++ git/linux-2.6_t/arch/x86/kernel/e820.c @@ -845,7 +845,9 @@ static int __init parse_memmap_opt(char if (!strncmp(p, "exactmap", 8)) { #ifdef CONFIG_CRASH_DUMP - /* + /* memmap=exactmap passed twice, do not reset tables again */ + if (saved_max_pfn) + return 0; /* * If we are doing a crash dump, we still need to know * the real mem size before original memory map is * reset.