From patchwork Tue Jan 8 16:47:17 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Thomas Renninger X-Patchwork-Id: 1946811 X-Patchwork-Delegate: bhelgaas@google.com Return-Path: X-Original-To: patchwork-linux-pci@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork2.kernel.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by patchwork2.kernel.org (Postfix) with ESMTP id 76536DF23A for ; Tue, 8 Jan 2013 16:47:29 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756672Ab3AHQr2 (ORCPT ); Tue, 8 Jan 2013 11:47:28 -0500 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 Received: from relay2.suse.de (unknown [195.135.220.254]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mx2.suse.de (Postfix) with ESMTP id 99E41A39D2; Tue, 8 Jan 2013 17:47:25 +0100 (CET) From: Thomas Renninger Organization: SUSE Products GmbH To: Yinghai Lu Subject: [PATCH] Only reset e820 once, even with multiple memmap=exactmap params Date: Tue, 8 Jan 2013 17:47:17 +0100 User-Agent: KMail/1.13.6 (Linux/2.6.37.6-24-desktop; KDE/4.6.0; x86_64; ; ) 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 Message-Id: <201301081747.17853.trenn@suse.de> Sender: linux-pci-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pci@vger.kernel.org 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(-) -- To unsubscribe from this list: send the line "unsubscribe linux-pci" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html 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.