forked from torvalds/linux
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
crash_dump: export is_kdump_kernel to modules, consolidate elfcorehdr…
…_addr, setup_elfcorehdr and saved_max_pfn The Xen PV drivers in a crashed HVM guest can not connect to the dom0 backend drivers because both frontend and backend drivers are still in connected state. To run the connection reset function only in case of a crashdump, the is_kdump_kernel() function needs to be available for the PV driver modules. Consolidate elfcorehdr_addr, setup_elfcorehdr and saved_max_pfn into kernel/crash_dump.c Also export elfcorehdr_addr to make is_kdump_kernel() usable for modules. Leave 'elfcorehdr' as early_param(). This changes powerpc from __setup() to early_param(). It adds an address range check from x86 also on ia64 and powerpc. [[email protected]: additional #includes] [[email protected]: remove elfcorehdr_addr export] [[email protected]: fix for Tejun's mm/nobootmem.c changes] Signed-off-by: Olaf Hering <[email protected]> Cc: Russell King <[email protected]> Cc: "Luck, Tony" <[email protected]> Cc: Benjamin Herrenschmidt <[email protected]> Cc: Paul Mundt <[email protected]> Cc: Ingo Molnar <[email protected]> Cc: Thomas Gleixner <[email protected]> Cc: "H. Peter Anvin" <[email protected]> Cc: Johannes Weiner <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
- Loading branch information
1 parent
8547727
commit 93a7205
Showing
16 changed files
with
37 additions
and
135 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -107,6 +107,7 @@ obj-$(CONFIG_PERF_EVENTS) += perf_event.o | |
obj-$(CONFIG_HAVE_HW_BREAKPOINT) += hw_breakpoint.o | ||
obj-$(CONFIG_USER_RETURN_NOTIFIER) += user-return-notifier.o | ||
obj-$(CONFIG_PADATA) += padata.o | ||
obj-$(CONFIG_CRASH_DUMP) += crash_dump.o | ||
|
||
ifneq ($(CONFIG_SCHED_OMIT_FRAME_POINTER),y) | ||
# According to Alan Modra <[email protected]>, the -fno-omit-frame-pointer is | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
#include <linux/kernel.h> | ||
#include <linux/crash_dump.h> | ||
#include <linux/init.h> | ||
#include <linux/errno.h> | ||
#include <linux/module.h> | ||
|
||
/* | ||
* If we have booted due to a crash, max_pfn will be a very low value. We need | ||
* to know the amount of memory that the previous kernel used. | ||
*/ | ||
unsigned long saved_max_pfn; | ||
|
||
/* | ||
* stores the physical address of elf header of crash image | ||
* | ||
* Note: elfcorehdr_addr is not just limited to vmcore. It is also used by | ||
* is_kdump_kernel() to determine if we are booting after a panic. Hence put | ||
* it under CONFIG_CRASH_DUMP and not CONFIG_PROC_VMCORE. | ||
*/ | ||
unsigned long long elfcorehdr_addr = ELFCORE_ADDR_MAX; | ||
|
||
/* | ||
* elfcorehdr= specifies the location of elf core header stored by the crashed | ||
* kernel. This option will be passed by kexec loader to the capture kernel. | ||
*/ | ||
static int __init setup_elfcorehdr(char *arg) | ||
{ | ||
char *end; | ||
if (!arg) | ||
return -EINVAL; | ||
elfcorehdr_addr = memparse(arg, &end); | ||
return end > arg ? 0 : -EINVAL; | ||
} | ||
early_param("elfcorehdr", setup_elfcorehdr); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters