[patch] crashdump: fix undefined reference to `elfcorehdr_addr' - Kernel

This is a discussion on [patch] crashdump: fix undefined reference to `elfcorehdr_addr' - Kernel ; On Mon, Jul 28, 2008 at 02:48:56PM +0200, Ingo Molnar wrote: > > * Simon Horman wrote: > > > On Mon, Jul 28, 2008 at 12:45:28PM +1000, Simon Horman wrote: > > > The rfc patch I made to ...

+ Reply to Thread
Page 2 of 2 FirstFirst 1 2
Results 21 to 28 of 28

Thread: [patch] crashdump: fix undefined reference to `elfcorehdr_addr'

  1. Re: [patch] crashdump: fix undefined reference to `elfcorehdr_addr'

    On Mon, Jul 28, 2008 at 02:48:56PM +0200, Ingo Molnar wrote:
    >
    > * Simon Horman wrote:
    >
    > > On Mon, Jul 28, 2008 at 12:45:28PM +1000, Simon Horman wrote:
    > > > The rfc patch I made to rename is_kdump_kernel to kernel_has_vmcore,
    > > > which I appended to my previous post should have looked more like the
    > > > following. Although, as I noted in my previous post, its more a starting
    > > > point for discussion than a solution to the problem at hand.

    > >
    > > Sorry, one more time. I forgot to quilt refresh.

    >
    > doesnt apply cleanly to latest -git:
    >
    > Hunk #1 FAILED at 2070.
    > 1 out of 1 hunk FAILED -- saving rejects to file arch/ia64/hp/common/sba_iommu.c.rej
    >
    > due to a crossing change i guess. Also, i guess this should go via -mm
    > as it touches fs/proc/vmcore.c and include/linux/crash_dump.h. The x86
    > bits look good to me.
    >
    > Acked-by: Ingo Molnar


    Sorry about the messiness there. Vivek has a different patch
    set that renders most of this irrelevant. I'll fix up the
    arch/ia64/hp/common/sba_iommu.c portion to match his changes
    so that he can include it in his sereis / it can be included
    after his series.

    --
    Horms

    --
    To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
    the body of a message to majordomo@vger.kernel.org
    More majordomo info at http://vger.kernel.org/majordomo-info.html
    Please read the FAQ at http://www.tux.org/lkml/

  2. Re: [PATCH 1/5] Move elfcorehdr_addr out of vmcore.c (Was: Re: [patch] crashdump: fix undefined reference to `elfcorehdr_addr')

    On Mon, Jul 28, 2008 at 03:47:41PM -0700, Eric W. Biederman wrote:
    > Vivek Goyal writes:
    >
    > > Hi All,
    > >
    > > How does following series of patches look like. I have moved
    > > elfcorehdr_addr out of vmcore.c and pushed it to arch dependent section
    > > of crash dump to make sure that it can be worked with even when
    > > CONFIG_PROC_VMCORE is disabled and CONFIG_CRASH_DUMP is enabled.
    > >
    > > I tested it on x86_64. Compile tested it on i386 and ppc64. ia64 and
    > > sh versions are completely untested.

    >
    > Given the current state of the code:
    > Acked-by: "Eric W. Biederman"
    >
    > To process a kernel crash dump we pass the kernel elfcorehdr option,
    > so testing to see if it was passed seems reasonable.
    >
    > In general I think this method of handling the problems with kdump is
    > too brittle to live, but in the case of iommus we certainly need to do
    > something different, and unfortunately iommus were not common on x86
    > when the original code was merged so we have not handled them well.


    Agreed, however these patches look like they really ought to be merged
    into a single patch for the sake of bisect. As things stand, applying
    the first patch will break the build on each architecture with an
    architecture specific until the latter is applied.

    --
    Horms

    --
    To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
    the body of a message to majordomo@vger.kernel.org
    More majordomo info at http://vger.kernel.org/majordomo-info.html
    Please read the FAQ at http://www.tux.org/lkml/

  3. Re: [PATCH 1/5] Move elfcorehdr_addr out of vmcore.c (Was: Re: [patch] crashdump: fix undefined reference to `elfcorehdr_addr')

    On Tue, Jul 29, 2008 at 11:22:48AM +1000, Simon Horman wrote:
    > On Mon, Jul 28, 2008 at 03:47:41PM -0700, Eric W. Biederman wrote:
    > > Vivek Goyal writes:
    > >
    > > > Hi All,
    > > >
    > > > How does following series of patches look like. I have moved
    > > > elfcorehdr_addr out of vmcore.c and pushed it to arch dependent section
    > > > of crash dump to make sure that it can be worked with even when
    > > > CONFIG_PROC_VMCORE is disabled and CONFIG_CRASH_DUMP is enabled.
    > > >
    > > > I tested it on x86_64. Compile tested it on i386 and ppc64. ia64 and
    > > > sh versions are completely untested.

    > >
    > > Given the current state of the code:
    > > Acked-by: "Eric W. Biederman"
    > >
    > > To process a kernel crash dump we pass the kernel elfcorehdr option,
    > > so testing to see if it was passed seems reasonable.
    > >
    > > In general I think this method of handling the problems with kdump is
    > > too brittle to live, but in the case of iommus we certainly need to do
    > > something different, and unfortunately iommus were not common on x86
    > > when the original code was merged so we have not handled them well.

    >
    > Agreed, however these patches look like they really ought to be merged
    > into a single patch for the sake of bisect. As things stand, applying
    > the first patch will break the build on each architecture with an
    > architecture specific until the latter is applied.


    That's a good point. I was not very sure because changes were in
    different arches and I broke the patch. At the same time changes are
    really miniscule in each arch.

    So, for the sake of not breaking compilation for git-bisect, I will
    generate a single patch tomorrow. (Until and unless somebody has an
    objection).

    Thanks
    Vivek

    >
    > --
    > Horms

    --
    To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
    the body of a message to majordomo@vger.kernel.org
    More majordomo info at http://vger.kernel.org/majordomo-info.html
    Please read the FAQ at http://www.tux.org/lkml/

  4. Re: [PATCH 1/5] Move elfcorehdr_addr out of vmcore.c (Was: Re: [patch] crashdump: fix undefined reference to `elfcorehdr_addr')

    On Mon, Jul 28, 2008 at 10:28:22PM -0400, Vivek Goyal wrote:
    > On Tue, Jul 29, 2008 at 11:22:48AM +1000, Simon Horman wrote:
    > > On Mon, Jul 28, 2008 at 03:47:41PM -0700, Eric W. Biederman wrote:
    > > > Vivek Goyal writes:
    > > >
    > > > > Hi All,
    > > > >
    > > > > How does following series of patches look like. I have moved
    > > > > elfcorehdr_addr out of vmcore.c and pushed it to arch dependent section
    > > > > of crash dump to make sure that it can be worked with even when
    > > > > CONFIG_PROC_VMCORE is disabled and CONFIG_CRASH_DUMP is enabled.
    > > > >
    > > > > I tested it on x86_64. Compile tested it on i386 and ppc64. ia64 and
    > > > > sh versions are completely untested.
    > > >
    > > > Given the current state of the code:
    > > > Acked-by: "Eric W. Biederman"
    > > >
    > > > To process a kernel crash dump we pass the kernel elfcorehdr option,
    > > > so testing to see if it was passed seems reasonable.
    > > >
    > > > In general I think this method of handling the problems with kdump is
    > > > too brittle to live, but in the case of iommus we certainly need to do
    > > > something different, and unfortunately iommus were not common on x86
    > > > when the original code was merged so we have not handled them well.

    > >
    > > Agreed, however these patches look like they really ought to be merged
    > > into a single patch for the sake of bisect. As things stand, applying
    > > the first patch will break the build on each architecture with an
    > > architecture specific until the latter is applied.

    >
    > That's a good point. I was not very sure because changes were in
    > different arches and I broke the patch. At the same time changes are
    > really miniscule in each arch.


    I guessed that was why you split them up. But really the
    per-arch change is very small.

    > So, for the sake of not breaking compilation for git-bisect, I will
    > generate a single patch tomorrow. (Until and unless somebody has an
    > objection).


    For combiled patch:

    Acked-by: Simon Horman

    --
    Horms

    --
    To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
    the body of a message to majordomo@vger.kernel.org
    More majordomo info at http://vger.kernel.org/majordomo-info.html
    Please read the FAQ at http://www.tux.org/lkml/

  5. Re: [PATCH 3/5] ia64: Define elfcorehdr_addr in arch dependent section

    On Mon, Jul 28, 2008 at 05:13:14PM -0400, Vivek Goyal wrote:
    >
    > o Move elfcorehdr_addr definition in arch dependent crash dump file. This is
    > equivalent to defining elfcorehdr_addr under CONFIG_CRASH_DUMP instead of
    > CONFIG_PROC_VMCORE. This is needed by is_kdump_kernel() which can be
    > used irrespective of the fact whether CONFIG_PROC_VMCORE is enabled or
    > not.
    >
    > Signed-off-by: Vivek Goyal
    > ---
    >
    > arch/ia64/kernel/setup.c | 9 ++++++++-
    > 1 file changed, 8 insertions(+), 1 deletion(-)
    >
    > diff -puN arch/ia64/kernel/setup.c~fix-elfcorehdr_addr-parsing-ia64 arch/ia64/kernel/setup.c
    > --- linux-2.6.27-pre-rc1/arch/ia64/kernel/setup.c~fix-elfcorehdr_addr-parsing-ia64 2008-07-28 12:16:40.000000000 -0400
    > +++ linux-2.6.27-pre-rc1-root/arch/ia64/kernel/setup.c 2008-07-28 12:16:40.000000000 -0400
    > @@ -478,7 +478,12 @@ static __init int setup_nomca(char *s)
    > }
    > early_param("nomca", setup_nomca);
    >
    > -#ifdef CONFIG_PROC_VMCORE
    > +/*
    > + * 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
    > + * ifdef it under CONFIG_CRASH_DUMP and not CONFIG_PROC_VMCORE.
    > + */
    > +#ifdef CONFIG_CRASH_DUMP
    > /* elfcorehdr= specifies the location of elf core header
    > * stored by the crashed kernel.
    > */
    > @@ -491,7 +496,9 @@ static int __init parse_elfcorehdr(char
    > return 0;
    > }
    > early_param("elfcorehdr", parse_elfcorehdr);
    > +#endif
    >
    > +#ifdef CONFIG_PROC_VMCORE
    > int __init reserve_elfcorehdr(unsigned long *start, unsigned long *end)
    > {
    > unsigned long length;
    > _


    Hi Vivek,

    I think that you also need the following in arch/ia64/kernel/crash_dump.c.
    With this change your code compiles on ia64.

    Signed-off-by: Simon Horman


    Index: linux-2.6/arch/ia64/kernel/crash_dump.c
    ================================================== =================
    --- linux-2.6.orig/arch/ia64/kernel/crash_dump.c 2008-07-29 14:06:57.000000000 +1000
    +++ linux-2.6/arch/ia64/kernel/crash_dump.c 2008-07-29 14:09:55.000000000 +1000
    @@ -8,10 +8,14 @@

    #include
    #include
    +#include

    #include
    #include

    +/* Stores the physical address of elf header of crash image. */
    +unsigned long long elfcorehdr_addr = ELFCORE_ADDR_MAX;
    +
    /**
    * copy_oldmem_page - copy one page from "oldmem"
    * @pfn: page frame number to be copied

    --
    To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
    the body of a message to majordomo@vger.kernel.org
    More majordomo info at http://vger.kernel.org/majordomo-info.html
    Please read the FAQ at http://www.tux.org/lkml/

  6. Re: [PATCH 3/5] ia64: Define elfcorehdr_addr in arch dependent section

    On Tue, Jul 29, 2008 at 02:42:43PM +1000, Simon Horman wrote:
    > On Mon, Jul 28, 2008 at 05:13:14PM -0400, Vivek Goyal wrote:
    > >
    > > o Move elfcorehdr_addr definition in arch dependent crash dump file. This is
    > > equivalent to defining elfcorehdr_addr under CONFIG_CRASH_DUMP instead of
    > > CONFIG_PROC_VMCORE. This is needed by is_kdump_kernel() which can be
    > > used irrespective of the fact whether CONFIG_PROC_VMCORE is enabled or
    > > not.
    > >
    > > Signed-off-by: Vivek Goyal
    > > ---
    > >
    > > arch/ia64/kernel/setup.c | 9 ++++++++-
    > > 1 file changed, 8 insertions(+), 1 deletion(-)
    > >
    > > diff -puN arch/ia64/kernel/setup.c~fix-elfcorehdr_addr-parsing-ia64 arch/ia64/kernel/setup.c
    > > --- linux-2.6.27-pre-rc1/arch/ia64/kernel/setup.c~fix-elfcorehdr_addr-parsing-ia64 2008-07-28 12:16:40.000000000 -0400
    > > +++ linux-2.6.27-pre-rc1-root/arch/ia64/kernel/setup.c 2008-07-28 12:16:40.000000000 -0400
    > > @@ -478,7 +478,12 @@ static __init int setup_nomca(char *s)
    > > }
    > > early_param("nomca", setup_nomca);
    > >
    > > -#ifdef CONFIG_PROC_VMCORE
    > > +/*
    > > + * 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
    > > + * ifdef it under CONFIG_CRASH_DUMP and not CONFIG_PROC_VMCORE.
    > > + */
    > > +#ifdef CONFIG_CRASH_DUMP
    > > /* elfcorehdr= specifies the location of elf core header
    > > * stored by the crashed kernel.
    > > */
    > > @@ -491,7 +496,9 @@ static int __init parse_elfcorehdr(char
    > > return 0;
    > > }
    > > early_param("elfcorehdr", parse_elfcorehdr);
    > > +#endif
    > >
    > > +#ifdef CONFIG_PROC_VMCORE
    > > int __init reserve_elfcorehdr(unsigned long *start, unsigned long *end)
    > > {
    > > unsigned long length;
    > > _

    >
    > Hi Vivek,
    >
    > I think that you also need the following in arch/ia64/kernel/crash_dump.c.
    > With this change your code compiles on ia64.
    >
    > Signed-off-by: Simon Horman
    >
    >


    Thanks Simon. I had done these changes locally but somehow forgot to
    include the changes in patches.

    I will include these changes in my next posting of consolidated single
    patch.

    Thanks
    Vivek
    --
    To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
    the body of a message to majordomo@vger.kernel.org
    More majordomo info at http://vger.kernel.org/majordomo-info.html
    Please read the FAQ at http://www.tux.org/lkml/

  7. Re: [PATCH 5/5] sh: Define elfcorehdr_addr in arch dependent section

    On Mon, Jul 28, 2008 at 05:15:14PM -0400, Vivek Goyal wrote:
    > o Move elfcorehdr_addr definition in arch dependent crash dump file. This is
    > equivalent to defining elfcorehdr_addr under CONFIG_CRASH_DUMP instead of
    > CONFIG_PROC_VMCORE. This is needed by is_kdump_kernel() which can be
    > used irrespective of the fact whether CONFIG_PROC_VMCORE is enabled or
    > not.
    >
    > o I don't see sh setup code parsing the command line for elfcorehdr_addr. I
    > am wondering how does vmcore interface work on sh. Anyway, I am atleast
    > defining elfcoredhr_addr so that compilation is not broken on sh.
    >

    Hmm, you are correct, it seems like it was either lost in a merge
    somewhere or I simply neglected to check it in it when I was testing this
    stuff initially. Thanks for noticing!

    > Signed-off-by: Vivek Goyal


    Acked-by: Paul Mundt
    --
    To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
    the body of a message to majordomo@vger.kernel.org
    More majordomo info at http://vger.kernel.org/majordomo-info.html
    Please read the FAQ at http://www.tux.org/lkml/

  8. Re: [PATCH 2/5] x86: Define elfcorehdr_addr in arch dependent section


    * Vivek Goyal wrote:

    > o Move elfcorehdr_addr definition in arch dependent crash dump file. This is
    > equivalent to defining elfcorehdr_addr under CONFIG_CRASH_DUMP instead of
    > CONFIG_PROC_VMCORE. This is needed by is_kdump_kernel() which can be
    > used irrespective of the fact whether CONFIG_PROC_VMCORE is enabled or
    > not.
    >
    > Signed-off-by: Vivek Goyal
    > ---
    >
    > arch/x86/kernel/crash_dump_32.c | 3 +++
    > arch/x86/kernel/crash_dump_64.c | 3 +++
    > arch/x86/kernel/setup.c | 8 +++++++-
    > 3 files changed, 13 insertions(+), 1 deletion(-)


    the x86 bits look fine to me.

    Acked-by: Ingo Molnar

    Ingo
    --
    To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
    the body of a message to majordomo@vger.kernel.org
    More majordomo info at http://vger.kernel.org/majordomo-info.html
    Please read the FAQ at http://www.tux.org/lkml/

+ Reply to Thread
Page 2 of 2 FirstFirst 1 2