From: Simon Horman <horms@verge.net.au>
To: Andrew Morton <akpm@linux-foundation.org>
Cc: Muli Ben-Yehuda <muli@il.ibm.com>,
Tony Luck <tony.luck@intel.com>,
linux-ia64@vger.kernel.org, Chandru <chandru@in.ibm.com>,
kexec@lists.infradead.org, linux-kernel@vger.kernel.org,
Terry Loftin <terry.loftin@hp.com>,
"Eric W. Biederman" <ebiederm@xmission.com>,
Ingo Molnar <mingo@elte.hu>,
Linus Torvalds <torvalds@linux-foundation.org>,
Vivek Goyal <vgoyal@redhat.com>
Subject: Re: [patch] crashdump: fix undefined reference to `elfcorehdr_addr'
Date: Mon, 28 Jul 2008 11:51:19 +1000 [thread overview]
Message-ID: <20080728015117.GA12055@verge.net.au> (raw)
In-Reply-To: <20080727234529.GM6175@verge.net.au>
[ Updated Vivek's email address to his vgoyal@redhat.com in CC list
Added Terry Loftin, Tony Luck, Erik Biedermann and linux-ia64 to CC list ]
On Mon, Jul 28, 2008 at 09:45:31AM +1000, Simon Horman wrote:
> > > diff --git a/include/linux/crash_dump.h b/include/linux/crash_dump.h
> > > index 6cd39a9..025e4f5 100644
> > > --- a/include/linux/crash_dump.h
> > > +++ b/include/linux/crash_dump.h
> > > @@ -8,7 +8,13 @@
> > > #include <linux/proc_fs.h>
> > >
> > > #define ELFCORE_ADDR_MAX (-1ULL)
> > > +
> > > +#ifdef CONFIG_PROC_VMCORE
> > > extern unsigned long long elfcorehdr_addr;
> > > +#else
> > > +static const unsigned long long elfcorehdr_addr = ELFCORE_ADDR_MAX;
> > > +#endif
> > > +
> > > extern ssize_t copy_oldmem_page(unsigned long, char *, size_t,
> > > unsigned long, int);
> > > extern const struct file_operations proc_vmcore_operations;
> >
> > spose that'll fix it. But it seems odd that is_kdump_kernel() will
> > return false if CONFIG_PROC_VMCORE=n, CONFIG_CRASH_DUMP=y. I mean,
> > it's still a crashdump kernel, is it not?
>
> Perhaps is_kdump_kernel() ought to be renamed kernel_has_vmcore().
>
> To my mind, is_kdump_kernel() should really look something like this:
>
> #ifdef CONFIG_CRASH_DUMP
> static inline int is_kdump_kernel(void) { return 1; }
> #else
> static inline int is_kdump_kernel(void) { return 0; }
> #endif
>
> But that can probably just be handled by any relevant code
> using CONFIG_CRASH_DUMP as necessary.
Hi,
I started looking into a simple fix to change the name of
the is_kdump_kernel() to kernel_has_vmcore(), which is what
the code in its current incarnatation does.
This also lead to cleaning the usage of elfcorehdr_addr,
which is in the folloing messy state after recent changes.
#ifdef CONFIG_PROC_VMCORE
* Declared non-static include/linux/crash_dump.h
* Initialised in fs/proc/vmcore.c
#else
* Declared and initialised as static in include/linux/crash_dump.h
* Only used by is_kdump_kernel() which is a static function
also in include/linux/crash_dump.h
#endif
Howerver, in the course of doing this I came to thinking that actually
this code won't solve the problem at hand in the case where
CONFIG_CRASH_DUMP is defined but CONFIG_PROC_VMCORE is not.
Or in other words, what happens if the calgary initialisation code
runs in a kdump kernel that does not have CONFIG_PROC_VMCORE ?
A similar problem appears to exist in
arch/ia64/hp/common/sba_iommu.c:sba_init(), which currently doesn't
compile if CONFIG_CRASH_DUMP is set but CONFIG_PROC_VMCORE is not. The
compilation issue could be solved by using kernel_has_vmcore() (as per
the patch below) instead of checking elfcorehdr_addr directly, but does
it actually lead to working code?
There has long been a strong aversion to providing the second
kernel with flags like im_in_kexec or im_in_kdump, as its felt
that this kind of problem is better handled by making sure that the
hardware is in a sensible state before leaving the first-kernel.
But this is arguably more reasonable in the kexec case than the
kdump case.
If there really is a need for kdump kernels to know that they are
booting a kdumping system, then I propose one of the following:
1) Always parse the elfcorehdr kernel command line option
and set elfcorehdr_addr accordingly - currently this is only
done if CONFIG_PROC_VMCORE is set.
This is nice as it won't need any modifications to kexec-tools
nor any command line bloat.
A minor difficulty is working out where to initialise elfcorehdr_addr.
Sometimes in include/linux/crash_dump.h and sometimes in
fs/proc/vmcore.c seems horrible to me.
Another problem is that would be alive and well in
code that really only uses it to check if kdump was activated or not
- a minor naming issue.
2) Add a new kernel command line option, perhaps in_kdump
This is bloat to get around elfcorehdr_addr initialisation and
naming awkwardness above.
3) Make select CONFIG_PROC_VMCORE when CONFIG_CRASH_DUMP is selected,
or perhaps even just remove CONFIG_PROC_VMCORE and only use
CONFIG_CRASH_DUMP instead. The effect would be the same either way.
Pro: One less thing to be confused about
Con: Bloat for people who want kdump without vmcore.
I wonder what usage case that is.
--
Horms
Index: linux-2.6/arch/x86/kernel/pci-calgary_64.c
===================================================================
--- linux-2.6.orig/arch/x86/kernel/pci-calgary_64.c 2008-07-28 10:10:31.000000000 +1000
+++ linux-2.6/arch/x86/kernel/pci-calgary_64.c 2008-07-28 10:14:24.000000000 +1000
@@ -801,7 +801,7 @@ static int __init calgary_setup_tar(stru
tbl = pci_iommu(dev->bus);
tbl->it_base = (unsigned long)bus_info[dev->bus->number].tce_space;
- if (is_kdump_kernel())
+ if (kernel_has_vmcore())
calgary_init_bitmap_from_tce_table(tbl);
else
tce_free(tbl, 0, tbl->it_size);
@@ -1184,7 +1184,7 @@ static int __init calgary_init(void)
return ret;
/* Purely for kdump kernel case */
- if (is_kdump_kernel())
+ if (kernel_has_vmcore())
get_tce_space_from_tar();
do {
@@ -1438,7 +1438,7 @@ void __init detect_calgary(void)
return;
}
- specified_table_size = determine_tce_table_size((is_kdump_kernel() ?
+ specified_table_size = determine_tce_table_size((kernel_has_vmcore() ?
saved_max_pfn : max_pfn) * PAGE_SIZE);
for (bus = 0; bus < MAX_PHB_BUS_NUM; bus++) {
@@ -1461,7 +1461,7 @@ void __init detect_calgary(void)
* If it is kdump kernel, find and use tce tables
* from first kernel, else allocate tce tables here
*/
- if (!is_kdump_kernel()) {
+ if (!kernel_has_vmcore()) {
tbl = alloc_tce_table();
if (!tbl)
goto cleanup;
Index: linux-2.6/fs/proc/vmcore.c
===================================================================
--- linux-2.6.orig/fs/proc/vmcore.c 2008-07-28 09:51:30.000000000 +1000
+++ linux-2.6/fs/proc/vmcore.c 2008-07-28 09:51:53.000000000 +1000
@@ -32,8 +32,7 @@ static size_t elfcorebuf_sz;
/* Total size of vmcore file. */
static u64 vmcore_size;
-/* Stores the physical address of elf header of crash image. */
-unsigned long long elfcorehdr_addr = ELFCORE_ADDR_MAX;
+unsigned long long elfcorehdr_addr;
struct proc_dir_entry *proc_vmcore = NULL;
Index: linux-2.6/include/linux/crash_dump.h
===================================================================
--- linux-2.6.orig/include/linux/crash_dump.h 2008-07-28 09:46:29.000000000 +1000
+++ linux-2.6/include/linux/crash_dump.h 2008-07-28 10:43:03.000000000 +1000
@@ -11,8 +11,13 @@
#ifdef CONFIG_PROC_VMCORE
extern unsigned long long elfcorehdr_addr;
+
+static inline int kernel_has_vmcore(void)
+{
+ return (elfcorehdr_addr != ELFCORE_ADDR_MAX) ? 1 : 0;
+}
#else
-static const unsigned long long elfcorehdr_addr = ELFCORE_ADDR_MAX;
+static inline int kernel_has_vmcore(void) { return 0; }
#endif
extern ssize_t copy_oldmem_page(unsigned long, char *, size_t,
@@ -28,12 +33,6 @@ extern struct proc_dir_entry *proc_vmcor
#define vmcore_elf_check_arch(x) (elf_check_arch(x) || vmcore_elf_check_arch_cross(x))
-static inline int is_kdump_kernel(void)
-{
- return (elfcorehdr_addr != ELFCORE_ADDR_MAX) ? 1 : 0;
-}
-#else /* !CONFIG_CRASH_DUMP */
-static inline int is_kdump_kernel(void) { return 0; }
#endif /* CONFIG_CRASH_DUMP */
extern unsigned long saved_max_pfn;
_______________________________________________
kexec mailing list
kexec@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/kexec
WARNING: multiple messages have this Message-ID (diff)
From: Simon Horman <horms@verge.net.au>
To: Andrew Morton <akpm@linux-foundation.org>
Cc: Muli Ben-Yehuda <muli@il.ibm.com>, Chandru <chandru@in.ibm.com>,
kexec@lists.infradead.org, linux-kernel@vger.kernel.org,
Vivek Goyal <vgoyal@redhat.com>, Ingo Molnar <mingo@elte.hu>,
Linus Torvalds <torvalds@linux-foundation.org>,
Terry Loftin <terry.loftin@hp.com>,
Tony Luck <tony.luck@intel.com>,
"Eric W. Biederman" <ebiederm@xmission.com>,
linux-ia64@vger.kernel.org
Subject: Re: [patch] crashdump: fix undefined reference to `elfcorehdr_addr'
Date: Mon, 28 Jul 2008 01:51:19 +0000 [thread overview]
Message-ID: <20080728015117.GA12055@verge.net.au> (raw)
In-Reply-To: <20080727234529.GM6175@verge.net.au>
[ Updated Vivek's email address to his vgoyal@redhat.com in CC list
Added Terry Loftin, Tony Luck, Erik Biedermann and linux-ia64 to CC list ]
On Mon, Jul 28, 2008 at 09:45:31AM +1000, Simon Horman wrote:
> > > diff --git a/include/linux/crash_dump.h b/include/linux/crash_dump.h
> > > index 6cd39a9..025e4f5 100644
> > > --- a/include/linux/crash_dump.h
> > > +++ b/include/linux/crash_dump.h
> > > @@ -8,7 +8,13 @@
> > > #include <linux/proc_fs.h>
> > >
> > > #define ELFCORE_ADDR_MAX (-1ULL)
> > > +
> > > +#ifdef CONFIG_PROC_VMCORE
> > > extern unsigned long long elfcorehdr_addr;
> > > +#else
> > > +static const unsigned long long elfcorehdr_addr = ELFCORE_ADDR_MAX;
> > > +#endif
> > > +
> > > extern ssize_t copy_oldmem_page(unsigned long, char *, size_t,
> > > unsigned long, int);
> > > extern const struct file_operations proc_vmcore_operations;
> >
> > spose that'll fix it. But it seems odd that is_kdump_kernel() will
> > return false if CONFIG_PROC_VMCORE=n, CONFIG_CRASH_DUMP=y. I mean,
> > it's still a crashdump kernel, is it not?
>
> Perhaps is_kdump_kernel() ought to be renamed kernel_has_vmcore().
>
> To my mind, is_kdump_kernel() should really look something like this:
>
> #ifdef CONFIG_CRASH_DUMP
> static inline int is_kdump_kernel(void) { return 1; }
> #else
> static inline int is_kdump_kernel(void) { return 0; }
> #endif
>
> But that can probably just be handled by any relevant code
> using CONFIG_CRASH_DUMP as necessary.
Hi,
I started looking into a simple fix to change the name of
the is_kdump_kernel() to kernel_has_vmcore(), which is what
the code in its current incarnatation does.
This also lead to cleaning the usage of elfcorehdr_addr,
which is in the folloing messy state after recent changes.
#ifdef CONFIG_PROC_VMCORE
* Declared non-static include/linux/crash_dump.h
* Initialised in fs/proc/vmcore.c
#else
* Declared and initialised as static in include/linux/crash_dump.h
* Only used by is_kdump_kernel() which is a static function
also in include/linux/crash_dump.h
#endif
Howerver, in the course of doing this I came to thinking that actually
this code won't solve the problem at hand in the case where
CONFIG_CRASH_DUMP is defined but CONFIG_PROC_VMCORE is not.
Or in other words, what happens if the calgary initialisation code
runs in a kdump kernel that does not have CONFIG_PROC_VMCORE ?
A similar problem appears to exist in
arch/ia64/hp/common/sba_iommu.c:sba_init(), which currently doesn't
compile if CONFIG_CRASH_DUMP is set but CONFIG_PROC_VMCORE is not. The
compilation issue could be solved by using kernel_has_vmcore() (as per
the patch below) instead of checking elfcorehdr_addr directly, but does
it actually lead to working code?
There has long been a strong aversion to providing the second
kernel with flags like im_in_kexec or im_in_kdump, as its felt
that this kind of problem is better handled by making sure that the
hardware is in a sensible state before leaving the first-kernel.
But this is arguably more reasonable in the kexec case than the
kdump case.
If there really is a need for kdump kernels to know that they are
booting a kdumping system, then I propose one of the following:
1) Always parse the elfcorehdr kernel command line option
and set elfcorehdr_addr accordingly - currently this is only
done if CONFIG_PROC_VMCORE is set.
This is nice as it won't need any modifications to kexec-tools
nor any command line bloat.
A minor difficulty is working out where to initialise elfcorehdr_addr.
Sometimes in include/linux/crash_dump.h and sometimes in
fs/proc/vmcore.c seems horrible to me.
Another problem is that would be alive and well in
code that really only uses it to check if kdump was activated or not
- a minor naming issue.
2) Add a new kernel command line option, perhaps in_kdump
This is bloat to get around elfcorehdr_addr initialisation and
naming awkwardness above.
3) Make select CONFIG_PROC_VMCORE when CONFIG_CRASH_DUMP is selected,
or perhaps even just remove CONFIG_PROC_VMCORE and only use
CONFIG_CRASH_DUMP instead. The effect would be the same either way.
Pro: One less thing to be confused about
Con: Bloat for people who want kdump without vmcore.
I wonder what usage case that is.
--
Horms
Index: linux-2.6/arch/x86/kernel/pci-calgary_64.c
=================================--- linux-2.6.orig/arch/x86/kernel/pci-calgary_64.c 2008-07-28 10:10:31.000000000 +1000
+++ linux-2.6/arch/x86/kernel/pci-calgary_64.c 2008-07-28 10:14:24.000000000 +1000
@@ -801,7 +801,7 @@ static int __init calgary_setup_tar(stru
tbl = pci_iommu(dev->bus);
tbl->it_base = (unsigned long)bus_info[dev->bus->number].tce_space;
- if (is_kdump_kernel())
+ if (kernel_has_vmcore())
calgary_init_bitmap_from_tce_table(tbl);
else
tce_free(tbl, 0, tbl->it_size);
@@ -1184,7 +1184,7 @@ static int __init calgary_init(void)
return ret;
/* Purely for kdump kernel case */
- if (is_kdump_kernel())
+ if (kernel_has_vmcore())
get_tce_space_from_tar();
do {
@@ -1438,7 +1438,7 @@ void __init detect_calgary(void)
return;
}
- specified_table_size = determine_tce_table_size((is_kdump_kernel() ?
+ specified_table_size = determine_tce_table_size((kernel_has_vmcore() ?
saved_max_pfn : max_pfn) * PAGE_SIZE);
for (bus = 0; bus < MAX_PHB_BUS_NUM; bus++) {
@@ -1461,7 +1461,7 @@ void __init detect_calgary(void)
* If it is kdump kernel, find and use tce tables
* from first kernel, else allocate tce tables here
*/
- if (!is_kdump_kernel()) {
+ if (!kernel_has_vmcore()) {
tbl = alloc_tce_table();
if (!tbl)
goto cleanup;
Index: linux-2.6/fs/proc/vmcore.c
=================================--- linux-2.6.orig/fs/proc/vmcore.c 2008-07-28 09:51:30.000000000 +1000
+++ linux-2.6/fs/proc/vmcore.c 2008-07-28 09:51:53.000000000 +1000
@@ -32,8 +32,7 @@ static size_t elfcorebuf_sz;
/* Total size of vmcore file. */
static u64 vmcore_size;
-/* Stores the physical address of elf header of crash image. */
-unsigned long long elfcorehdr_addr = ELFCORE_ADDR_MAX;
+unsigned long long elfcorehdr_addr;
struct proc_dir_entry *proc_vmcore = NULL;
Index: linux-2.6/include/linux/crash_dump.h
=================================--- linux-2.6.orig/include/linux/crash_dump.h 2008-07-28 09:46:29.000000000 +1000
+++ linux-2.6/include/linux/crash_dump.h 2008-07-28 10:43:03.000000000 +1000
@@ -11,8 +11,13 @@
#ifdef CONFIG_PROC_VMCORE
extern unsigned long long elfcorehdr_addr;
+
+static inline int kernel_has_vmcore(void)
+{
+ return (elfcorehdr_addr != ELFCORE_ADDR_MAX) ? 1 : 0;
+}
#else
-static const unsigned long long elfcorehdr_addr = ELFCORE_ADDR_MAX;
+static inline int kernel_has_vmcore(void) { return 0; }
#endif
extern ssize_t copy_oldmem_page(unsigned long, char *, size_t,
@@ -28,12 +33,6 @@ extern struct proc_dir_entry *proc_vmcor
#define vmcore_elf_check_arch(x) (elf_check_arch(x) || vmcore_elf_check_arch_cross(x))
-static inline int is_kdump_kernel(void)
-{
- return (elfcorehdr_addr != ELFCORE_ADDR_MAX) ? 1 : 0;
-}
-#else /* !CONFIG_CRASH_DUMP */
-static inline int is_kdump_kernel(void) { return 0; }
#endif /* CONFIG_CRASH_DUMP */
extern unsigned long saved_max_pfn;
WARNING: multiple messages have this Message-ID (diff)
From: Simon Horman <horms@verge.net.au>
To: Andrew Morton <akpm@linux-foundation.org>
Cc: Muli Ben-Yehuda <muli@il.ibm.com>, Chandru <chandru@in.ibm.com>,
kexec@lists.infradead.org, linux-kernel@vger.kernel.org,
Vivek Goyal <vgoyal@redhat.com>, Ingo Molnar <mingo@elte.hu>,
Linus Torvalds <torvalds@linux-foundation.org>,
Terry Loftin <terry.loftin@hp.com>,
Tony Luck <tony.luck@intel.com>,
"Eric W. Biederman" <ebiederm@xmission.com>,
linux-ia64@vger.kernel.org
Subject: Re: [patch] crashdump: fix undefined reference to `elfcorehdr_addr'
Date: Mon, 28 Jul 2008 11:51:19 +1000 [thread overview]
Message-ID: <20080728015117.GA12055@verge.net.au> (raw)
In-Reply-To: <20080727234529.GM6175@verge.net.au>
[ Updated Vivek's email address to his vgoyal@redhat.com in CC list
Added Terry Loftin, Tony Luck, Erik Biedermann and linux-ia64 to CC list ]
On Mon, Jul 28, 2008 at 09:45:31AM +1000, Simon Horman wrote:
> > > diff --git a/include/linux/crash_dump.h b/include/linux/crash_dump.h
> > > index 6cd39a9..025e4f5 100644
> > > --- a/include/linux/crash_dump.h
> > > +++ b/include/linux/crash_dump.h
> > > @@ -8,7 +8,13 @@
> > > #include <linux/proc_fs.h>
> > >
> > > #define ELFCORE_ADDR_MAX (-1ULL)
> > > +
> > > +#ifdef CONFIG_PROC_VMCORE
> > > extern unsigned long long elfcorehdr_addr;
> > > +#else
> > > +static const unsigned long long elfcorehdr_addr = ELFCORE_ADDR_MAX;
> > > +#endif
> > > +
> > > extern ssize_t copy_oldmem_page(unsigned long, char *, size_t,
> > > unsigned long, int);
> > > extern const struct file_operations proc_vmcore_operations;
> >
> > spose that'll fix it. But it seems odd that is_kdump_kernel() will
> > return false if CONFIG_PROC_VMCORE=n, CONFIG_CRASH_DUMP=y. I mean,
> > it's still a crashdump kernel, is it not?
>
> Perhaps is_kdump_kernel() ought to be renamed kernel_has_vmcore().
>
> To my mind, is_kdump_kernel() should really look something like this:
>
> #ifdef CONFIG_CRASH_DUMP
> static inline int is_kdump_kernel(void) { return 1; }
> #else
> static inline int is_kdump_kernel(void) { return 0; }
> #endif
>
> But that can probably just be handled by any relevant code
> using CONFIG_CRASH_DUMP as necessary.
Hi,
I started looking into a simple fix to change the name of
the is_kdump_kernel() to kernel_has_vmcore(), which is what
the code in its current incarnatation does.
This also lead to cleaning the usage of elfcorehdr_addr,
which is in the folloing messy state after recent changes.
#ifdef CONFIG_PROC_VMCORE
* Declared non-static include/linux/crash_dump.h
* Initialised in fs/proc/vmcore.c
#else
* Declared and initialised as static in include/linux/crash_dump.h
* Only used by is_kdump_kernel() which is a static function
also in include/linux/crash_dump.h
#endif
Howerver, in the course of doing this I came to thinking that actually
this code won't solve the problem at hand in the case where
CONFIG_CRASH_DUMP is defined but CONFIG_PROC_VMCORE is not.
Or in other words, what happens if the calgary initialisation code
runs in a kdump kernel that does not have CONFIG_PROC_VMCORE ?
A similar problem appears to exist in
arch/ia64/hp/common/sba_iommu.c:sba_init(), which currently doesn't
compile if CONFIG_CRASH_DUMP is set but CONFIG_PROC_VMCORE is not. The
compilation issue could be solved by using kernel_has_vmcore() (as per
the patch below) instead of checking elfcorehdr_addr directly, but does
it actually lead to working code?
There has long been a strong aversion to providing the second
kernel with flags like im_in_kexec or im_in_kdump, as its felt
that this kind of problem is better handled by making sure that the
hardware is in a sensible state before leaving the first-kernel.
But this is arguably more reasonable in the kexec case than the
kdump case.
If there really is a need for kdump kernels to know that they are
booting a kdumping system, then I propose one of the following:
1) Always parse the elfcorehdr kernel command line option
and set elfcorehdr_addr accordingly - currently this is only
done if CONFIG_PROC_VMCORE is set.
This is nice as it won't need any modifications to kexec-tools
nor any command line bloat.
A minor difficulty is working out where to initialise elfcorehdr_addr.
Sometimes in include/linux/crash_dump.h and sometimes in
fs/proc/vmcore.c seems horrible to me.
Another problem is that would be alive and well in
code that really only uses it to check if kdump was activated or not
- a minor naming issue.
2) Add a new kernel command line option, perhaps in_kdump
This is bloat to get around elfcorehdr_addr initialisation and
naming awkwardness above.
3) Make select CONFIG_PROC_VMCORE when CONFIG_CRASH_DUMP is selected,
or perhaps even just remove CONFIG_PROC_VMCORE and only use
CONFIG_CRASH_DUMP instead. The effect would be the same either way.
Pro: One less thing to be confused about
Con: Bloat for people who want kdump without vmcore.
I wonder what usage case that is.
--
Horms
Index: linux-2.6/arch/x86/kernel/pci-calgary_64.c
===================================================================
--- linux-2.6.orig/arch/x86/kernel/pci-calgary_64.c 2008-07-28 10:10:31.000000000 +1000
+++ linux-2.6/arch/x86/kernel/pci-calgary_64.c 2008-07-28 10:14:24.000000000 +1000
@@ -801,7 +801,7 @@ static int __init calgary_setup_tar(stru
tbl = pci_iommu(dev->bus);
tbl->it_base = (unsigned long)bus_info[dev->bus->number].tce_space;
- if (is_kdump_kernel())
+ if (kernel_has_vmcore())
calgary_init_bitmap_from_tce_table(tbl);
else
tce_free(tbl, 0, tbl->it_size);
@@ -1184,7 +1184,7 @@ static int __init calgary_init(void)
return ret;
/* Purely for kdump kernel case */
- if (is_kdump_kernel())
+ if (kernel_has_vmcore())
get_tce_space_from_tar();
do {
@@ -1438,7 +1438,7 @@ void __init detect_calgary(void)
return;
}
- specified_table_size = determine_tce_table_size((is_kdump_kernel() ?
+ specified_table_size = determine_tce_table_size((kernel_has_vmcore() ?
saved_max_pfn : max_pfn) * PAGE_SIZE);
for (bus = 0; bus < MAX_PHB_BUS_NUM; bus++) {
@@ -1461,7 +1461,7 @@ void __init detect_calgary(void)
* If it is kdump kernel, find and use tce tables
* from first kernel, else allocate tce tables here
*/
- if (!is_kdump_kernel()) {
+ if (!kernel_has_vmcore()) {
tbl = alloc_tce_table();
if (!tbl)
goto cleanup;
Index: linux-2.6/fs/proc/vmcore.c
===================================================================
--- linux-2.6.orig/fs/proc/vmcore.c 2008-07-28 09:51:30.000000000 +1000
+++ linux-2.6/fs/proc/vmcore.c 2008-07-28 09:51:53.000000000 +1000
@@ -32,8 +32,7 @@ static size_t elfcorebuf_sz;
/* Total size of vmcore file. */
static u64 vmcore_size;
-/* Stores the physical address of elf header of crash image. */
-unsigned long long elfcorehdr_addr = ELFCORE_ADDR_MAX;
+unsigned long long elfcorehdr_addr;
struct proc_dir_entry *proc_vmcore = NULL;
Index: linux-2.6/include/linux/crash_dump.h
===================================================================
--- linux-2.6.orig/include/linux/crash_dump.h 2008-07-28 09:46:29.000000000 +1000
+++ linux-2.6/include/linux/crash_dump.h 2008-07-28 10:43:03.000000000 +1000
@@ -11,8 +11,13 @@
#ifdef CONFIG_PROC_VMCORE
extern unsigned long long elfcorehdr_addr;
+
+static inline int kernel_has_vmcore(void)
+{
+ return (elfcorehdr_addr != ELFCORE_ADDR_MAX) ? 1 : 0;
+}
#else
-static const unsigned long long elfcorehdr_addr = ELFCORE_ADDR_MAX;
+static inline int kernel_has_vmcore(void) { return 0; }
#endif
extern ssize_t copy_oldmem_page(unsigned long, char *, size_t,
@@ -28,12 +33,6 @@ extern struct proc_dir_entry *proc_vmcor
#define vmcore_elf_check_arch(x) (elf_check_arch(x) || vmcore_elf_check_arch_cross(x))
-static inline int is_kdump_kernel(void)
-{
- return (elfcorehdr_addr != ELFCORE_ADDR_MAX) ? 1 : 0;
-}
-#else /* !CONFIG_CRASH_DUMP */
-static inline int is_kdump_kernel(void) { return 0; }
#endif /* CONFIG_CRASH_DUMP */
extern unsigned long saved_max_pfn;
next prev parent reply other threads:[~2008-07-28 1:51 UTC|newest]
Thread overview: 94+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-07-26 9:25 [patch] crashdump: fix undefined reference to `elfcorehdr_addr' Ingo Molnar
2008-07-26 10:10 ` Andrew Morton
2008-07-26 10:10 ` Andrew Morton
2008-07-27 23:45 ` Simon Horman
2008-07-27 23:45 ` Simon Horman
2008-07-28 1:51 ` Simon Horman [this message]
2008-07-28 1:51 ` Simon Horman
2008-07-28 1:51 ` Simon Horman
2008-07-28 2:45 ` Simon Horman
2008-07-28 2:45 ` Simon Horman
2008-07-28 2:45 ` Simon Horman
2008-07-28 3:40 ` Simon Horman
2008-07-28 3:40 ` Simon Horman
2008-07-28 3:40 ` Simon Horman
2008-07-28 12:48 ` Ingo Molnar
2008-07-28 12:48 ` Ingo Molnar
2008-07-28 12:48 ` Ingo Molnar
2008-07-29 0:35 ` Simon Horman
2008-07-29 0:35 ` Simon Horman
2008-07-29 0:35 ` Simon Horman
2008-07-28 21:10 ` [PATCH 1/5] Move elfcorehdr_addr out of vmcore.c (Was: Re: [patch] crashdump: fix undefined reference to `elfcorehdr_addr') Vivek Goyal
2008-07-28 21:10 ` Vivek Goyal
2008-07-28 21:10 ` Vivek Goyal
2008-07-28 21:10 ` [PATCH 1/5] Move elfcorehdr_addr out of vmcore.c (Was: Re: [patch] Vivek Goyal
2008-07-28 21:11 ` [PATCH 2/5] x86: Define elfcorehdr_addr in arch dependent section Vivek Goyal
2008-07-28 21:11 ` Vivek Goyal
2008-07-28 21:11 ` Vivek Goyal
2008-07-28 21:11 ` Vivek Goyal
2008-07-28 21:13 ` [PATCH 3/5] ia64: " Vivek Goyal
2008-07-28 21:13 ` Vivek Goyal
2008-07-28 21:13 ` Vivek Goyal
2008-07-28 21:13 ` Vivek Goyal
2008-07-28 21:14 ` [PATCH 4/5] powerpc: " Vivek Goyal
2008-07-28 21:14 ` Vivek Goyal
2008-07-28 21:14 ` Vivek Goyal
2008-07-28 21:14 ` [PATCH 4/5] powerpc: Define elfcorehdr_addr in arch dependent Vivek Goyal
2008-07-28 21:15 ` [PATCH 5/5] sh: Define elfcorehdr_addr in arch dependent section Vivek Goyal
2008-07-28 21:15 ` Vivek Goyal
2008-07-28 21:15 ` Vivek Goyal
2008-07-28 21:15 ` Vivek Goyal
2008-07-29 14:18 ` Paul Mundt
2008-07-29 14:18 ` Paul Mundt
2008-07-29 14:18 ` Paul Mundt
2008-07-29 14:18 ` Paul Mundt
2008-07-29 4:42 ` [PATCH 3/5] ia64: " Simon Horman
2008-07-29 4:42 ` Simon Horman
2008-07-29 4:42 ` Simon Horman
2008-07-29 4:42 ` [PATCH 3/5] ia64: Define elfcorehdr_addr in arch dependent Simon Horman
2008-07-29 13:53 ` [PATCH 3/5] ia64: Define elfcorehdr_addr in arch dependent section Vivek Goyal
2008-07-29 13:53 ` Vivek Goyal
2008-07-29 13:53 ` Vivek Goyal
2008-07-29 13:53 ` [PATCH 3/5] ia64: Define elfcorehdr_addr in arch dependent Vivek Goyal
2008-07-31 15:29 ` [PATCH 2/5] x86: Define elfcorehdr_addr in arch dependent section Ingo Molnar
2008-07-31 15:29 ` Ingo Molnar
2008-07-31 15:29 ` Ingo Molnar
2008-07-31 15:29 ` [PATCH 2/5] x86: Define elfcorehdr_addr in arch dependent Ingo Molnar
2008-07-28 22:37 ` [PATCH 1/5] Move elfcorehdr_addr out of vmcore.c (Was: Re: [patch] crashdump: fix undefined reference to `elfcorehdr_addr') Eric W. Biederman
2008-07-28 22:37 ` Eric W. Biederman
2008-07-28 22:37 ` Eric W. Biederman
2008-07-28 22:37 ` [PATCH 1/5] Move elfcorehdr_addr out of vmcore.c (Was: Re: [patch] crashdump: fix undefined refe Eric W. Biederman
2008-07-28 22:47 ` [PATCH 1/5] Move elfcorehdr_addr out of vmcore.c (Was: Re: [patch] crashdump: fix undefined reference to `elfcorehdr_addr') Eric W. Biederman
2008-07-28 22:47 ` Eric W. Biederman
2008-07-28 22:47 ` Eric W. Biederman
2008-07-28 22:47 ` [PATCH 1/5] Move elfcorehdr_addr out of vmcore.c (Was: Re: [patch] crashdump: fix undefined refe Eric W. Biederman
2008-07-29 1:22 ` [PATCH 1/5] Move elfcorehdr_addr out of vmcore.c (Was: Re: [patch] crashdump: fix undefined reference to `elfcorehdr_addr') Simon Horman
2008-07-29 1:22 ` Simon Horman
2008-07-29 1:22 ` Simon Horman
2008-07-29 1:22 ` [PATCH 1/5] Move elfcorehdr_addr out of vmcore.c (Was: Simon Horman
2008-07-29 2:28 ` [PATCH 1/5] Move elfcorehdr_addr out of vmcore.c (Was: Re: [patch] crashdump: fix undefined reference to `elfcorehdr_addr') Vivek Goyal
2008-07-29 2:28 ` Vivek Goyal
2008-07-29 2:28 ` Vivek Goyal
2008-07-29 2:28 ` [PATCH 1/5] Move elfcorehdr_addr out of vmcore.c (Was: Vivek Goyal
2008-07-29 3:26 ` [PATCH 1/5] Move elfcorehdr_addr out of vmcore.c (Was: Re: [patch] crashdump: fix undefined reference to `elfcorehdr_addr') Simon Horman
2008-07-29 3:26 ` Simon Horman
2008-07-29 3:26 ` Simon Horman
2008-07-29 3:26 ` [PATCH 1/5] Move elfcorehdr_addr out of vmcore.c (Was: Simon Horman
2008-07-28 5:39 ` [patch] crashdump: fix undefined reference to `elfcorehdr_addr' Eric W. Biederman
2008-07-28 5:39 ` Eric W. Biederman
2008-07-28 5:39 ` Eric W. Biederman
2008-07-28 6:24 ` Muli Ben-Yehuda
2008-07-28 6:24 ` Muli Ben-Yehuda
2008-07-28 6:24 ` Muli Ben-Yehuda
2008-07-28 13:44 ` Vivek Goyal
2008-07-28 13:44 ` Vivek Goyal
2008-07-28 13:44 ` Vivek Goyal
2008-07-28 19:12 ` Eric W. Biederman
2008-07-28 19:12 ` Eric W. Biederman
2008-07-28 19:12 ` Eric W. Biederman
2008-07-28 13:31 ` Vivek Goyal
2008-07-28 13:31 ` Vivek Goyal
2008-07-28 13:31 ` Vivek Goyal
2008-07-29 0:33 ` Simon Horman
2008-07-29 0:33 ` Simon Horman
2008-07-29 0:33 ` Simon Horman
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20080728015117.GA12055@verge.net.au \
--to=horms@verge.net.au \
--cc=akpm@linux-foundation.org \
--cc=chandru@in.ibm.com \
--cc=ebiederm@xmission.com \
--cc=kexec@lists.infradead.org \
--cc=linux-ia64@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@elte.hu \
--cc=muli@il.ibm.com \
--cc=terry.loftin@hp.com \
--cc=tony.luck@intel.com \
--cc=torvalds@linux-foundation.org \
--cc=vgoyal@redhat.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.