Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S261422AbVASJML (ORCPT ); Wed, 19 Jan 2005 04:12:11 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S261649AbVASICc (ORCPT ); Wed, 19 Jan 2005 03:02:32 -0500 Received: from ebiederm.dsl.xmission.com ([166.70.28.69]:53695 "EHLO ebiederm.dsl.xmission.com") by vger.kernel.org with ESMTP id S261636AbVASHdn (ORCPT ); Wed, 19 Jan 2005 02:33:43 -0500 From: "Eric W. Biederman" To: Andrew Morton Cc: , Subject: [PATCH 17/29] x86-crashkernel Date: Wed, 19 Jan 2005 0:31:37 -0700 Message-ID: X-Mailer: patch-bomb.pl@ebiederm.dsl.xmission.com In-Reply-To: References: Sender: linux-kernel-owner@vger.kernel.org X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 4369 Lines: 132 This is the x86 implementation of the crashkernel option. It reserves a window of memory very early in the bootup process, so we never use it for anything but the kernel to switch to when the running kernel panics. In addition to reserving this memory a resource structure is registered so looking at /proc/iomem it is clear what happened to that memory. ISSUES: Is it possible to implement this in a architecture generic way? What should be done with architectures that always use an iommu and thus don't report their RAM memory resources in /proc/iomem? Signed-off-by: Eric Biederman --- kernel/efi.c | 4 ++++ kernel/setup.c | 30 ++++++++++++++++++++++++++++++ mm/discontig.c | 6 ++++++ 3 files changed, 40 insertions(+) diff -uNr linux-2.6.11-rc1-mm1-nokexec-x86-kexec/arch/i386/kernel/efi.c linux-2.6.11-rc1-mm1-nokexec-x86-crashkernel/arch/i386/kernel/efi.c --- linux-2.6.11-rc1-mm1-nokexec-x86-kexec/arch/i386/kernel/efi.c Fri Jan 14 04:32:22 2005 +++ linux-2.6.11-rc1-mm1-nokexec-x86-crashkernel/arch/i386/kernel/efi.c Tue Jan 18 22:58:33 2005 @@ -30,6 +30,7 @@ #include #include #include +#include #include #include @@ -596,6 +597,9 @@ if (md->type == EFI_CONVENTIONAL_MEMORY) { request_resource(res, code_resource); request_resource(res, data_resource); +#ifdef CONFIG_KEXEC + request_resource(res, &crashk_res); +#endif } } } diff -uNr linux-2.6.11-rc1-mm1-nokexec-x86-kexec/arch/i386/kernel/setup.c linux-2.6.11-rc1-mm1-nokexec-x86-crashkernel/arch/i386/kernel/setup.c --- linux-2.6.11-rc1-mm1-nokexec-x86-kexec/arch/i386/kernel/setup.c Tue Jan 18 23:11:43 2005 +++ linux-2.6.11-rc1-mm1-nokexec-x86-crashkernel/arch/i386/kernel/setup.c Tue Jan 18 22:58:33 2005 @@ -40,6 +40,7 @@ #include #include #include +#include #include