All of lore.kernel.org
 help / color / mirror / Atom feed
* + crash-remove-dependency-of-fa_dump-on-crash_dump.patch added to mm-unstable branch
@ 2024-01-23  0:44 Andrew Morton
  2024-01-23  5:59 ` SeongJae Park
  0 siblings, 1 reply; 4+ messages in thread
From: Andrew Morton @ 2024-01-23  0:44 UTC (permalink / raw)
  To: mm-commits, viro, piliu, hbathini, ebiederm, bhe, akpm


The patch titled
     Subject: crash: remove dependency of FA_DUMP on CRASH_DUMP
has been added to the -mm mm-unstable branch.  Its filename is
     crash-remove-dependency-of-fa_dump-on-crash_dump.patch

This patch will shortly appear at
     https://git.kernel.org/pub/scm/linux/kernel/git/akpm/25-new.git/tree/patches/crash-remove-dependency-of-fa_dump-on-crash_dump.patch

This patch will later appear in the mm-unstable branch at
    git://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm

Before you just go and hit "reply", please:
   a) Consider who else should be cc'ed
   b) Prefer to cc a suitable mailing list as well
   c) Ideally: find the original patch on the mailing list and do a
      reply-to-all to that, adding suitable additional cc's

*** Remember to use Documentation/process/submit-checklist.rst when testing your code ***

The -mm tree is included into linux-next via the mm-everything
branch at git://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm
and is updated there every 2-3 working days

------------------------------------------------------
From: Baoquan He <bhe@redhat.com>
Subject: crash: remove dependency of FA_DUMP on CRASH_DUMP
Date: Fri, 19 Jan 2024 22:52:30 +0800

In kdump kernel, /proc/vmcore is an elf file mapping the crashed kernel's
old memory content. Its elf header is constructed in 1st kernel and passed
to kdump kernel via elfcorehdr_addr. Config CRASH_DUMP enables the code
of 1st kernel's old memory accessing in different architectures.

Currently, config FA_DUMP has dependency on CRASH_DUMP because fadump
needs access global variable 'elfcorehdr_addr' to judge if it's in
kdump kernel within function is_kdump_kernel(). In the current
kernel/crash_dump.c, variable 'elfcorehdr_addr' is defined, and function
setup_elfcorehdr() used to parse kernel parameter to fetch the passed
value of elfcorehdr_addr. Only for accessing elfcorehdr_addr, FA_DUMP
really doesn't have to depends on CRASH_DUMP.

To remove the dependency of FA_DUMP on CRASH_DUMP to avoid confusion,
rename kernel/crash_dump.c to kernel/elfcorehdr.c, and build it when
CONFIG_VMCORE_INFO is ebabled. With this, FA_DUMP doesn't need to depend
on CRASH_DUMP.

Link: https://lkml.kernel.org/r/20240119145241.769622-4-bhe@redhat.com
Signed-off-by: Baoquan He <bhe@redhat.com>
Cc: Al Viro <viro@zeniv.linux.org.uk>
Cc: Eric W. Biederman <ebiederm@xmission.com>
Cc: Hari Bathini <hbathini@linux.ibm.com>
Cc: Pingfan Liu <piliu@redhat.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
---

 arch/powerpc/Kconfig    |    1 -
 kernel/Makefile         |    3 +--
 kernel/kexec_internal.h |    2 ++
 3 files changed, 3 insertions(+), 3 deletions(-)

--- a/arch/powerpc/Kconfig~crash-remove-dependency-of-fa_dump-on-crash_dump
+++ a/arch/powerpc/Kconfig
@@ -692,7 +692,6 @@ config FA_DUMP
 	depends on PPC64 && (PPC_RTAS || PPC_POWERNV)
 	select VMCORE_INFO
 	select CRASH_RESERVE
-	select CRASH_DUMP
 	help
 	  A robust mechanism to get reliable kernel crash dump with
 	  assistance from firmware. This approach does not use kexec,
--- a/kernel/kexec_internal.h~crash-remove-dependency-of-fa_dump-on-crash_dump
+++ a/kernel/kexec_internal.h
@@ -4,6 +4,8 @@
 
 #include <linux/kexec.h>
 
+struct kexec_segment;
+
 struct kimage *do_kimage_alloc_init(void);
 int sanity_check_segment_list(struct kimage *image);
 void kimage_free_page_list(struct list_head *list);
--- a/kernel/Makefile~crash-remove-dependency-of-fa_dump-on-crash_dump
+++ a/kernel/Makefile
@@ -68,7 +68,7 @@ obj-$(CONFIG_MODULE_SIG_FORMAT) += modul
 obj-$(CONFIG_KALLSYMS) += kallsyms.o
 obj-$(CONFIG_KALLSYMS_SELFTEST) += kallsyms_selftest.o
 obj-$(CONFIG_BSD_PROCESS_ACCT) += acct.o
-obj-$(CONFIG_VMCORE_INFO) += vmcore_info.o
+obj-$(CONFIG_VMCORE_INFO) += vmcore_info.o elfcorehdr.o
 obj-$(CONFIG_CRASH_RESERVE) += crash_reserve.o
 obj-$(CONFIG_KEXEC_CORE) += kexec_core.o crash_core.o
 obj-$(CONFIG_KEXEC) += kexec.o
@@ -121,7 +121,6 @@ obj-$(CONFIG_PERF_EVENTS) += events/
 
 obj-$(CONFIG_USER_RETURN_NOTIFIER) += user-return-notifier.o
 obj-$(CONFIG_PADATA) += padata.o
-obj-$(CONFIG_CRASH_DUMP) += crash_dump.o
 obj-$(CONFIG_JUMP_LABEL) += jump_label.o
 obj-$(CONFIG_CONTEXT_TRACKING) += context_tracking.o
 obj-$(CONFIG_TORTURE_TEST) += torture.o
_

Patches currently in -mm which might be from bhe@redhat.com are

mm-vmalloc-remove-vmap_area_list.patch
kexec-split-crashkernel-reservation-code-out-from-crash_corec.patch
crash-split-vmcoreinfo-exporting-code-out-from-crash_corec.patch
crash-remove-dependency-of-fa_dump-on-crash_dump.patch
crash-split-crash-dumping-code-out-from-kexec_corec.patch
crash-clean-up-kdump-related-config-items.patch
x86-crash-wrap-crash-dumping-code-into-crash-related-ifdefs.patch
arm64-crash-wrap-crash-dumping-code-into-crash-related-ifdefs.patch
ppc-crash-enforce-kexec-and-kexec_file-to-select-crash_dump.patch
s390-crash-wrap-crash-dumping-code-into-crash-related-ifdefs.patch
sh-crash-wrap-crash-dumping-code-into-crash-related-ifdefs.patch
arm-crash-wrap-crash-dumping-code-into-crash-related-ifdefs.patch
mips-crash-wrap-crash-dumping-code-into-crash-related-ifdefs.patch
riscv-crash-wrap-crash-dumping-code-into-crash-related-ifdefs.patch
loongarch-crash-wrap-crash-dumping-code-into-crash-related-ifdefs.patch
panic-suppress-gnu_printf-warning.patch


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: + crash-remove-dependency-of-fa_dump-on-crash_dump.patch added to mm-unstable branch
  2024-01-23  0:44 + crash-remove-dependency-of-fa_dump-on-crash_dump.patch added to mm-unstable branch Andrew Morton
@ 2024-01-23  5:59 ` SeongJae Park
  2024-01-23  7:28   ` Baoquan He
  0 siblings, 1 reply; 4+ messages in thread
From: SeongJae Park @ 2024-01-23  5:59 UTC (permalink / raw)
  To: Andrew Morton; +Cc: mm-commits, viro, piliu, hbathini, ebiederm, bhe

Hi Andrew,

On Mon, 22 Jan 2024 16:44:00 -0800 Andrew Morton <akpm@linux-foundation.org> wrote:

> 
> The patch titled
>      Subject: crash: remove dependency of FA_DUMP on CRASH_DUMP
> has been added to the -mm mm-unstable branch.  Its filename is
>      crash-remove-dependency-of-fa_dump-on-crash_dump.patch
[...]
> 
> ------------------------------------------------------
> From: Baoquan He <bhe@redhat.com>
> Subject: crash: remove dependency of FA_DUMP on CRASH_DUMP
> Date: Fri, 19 Jan 2024 22:52:30 +0800
> 
[...]
> To remove the dependency of FA_DUMP on CRASH_DUMP to avoid confusion,
> rename kernel/crash_dump.c to kernel/elfcorehdr.c,
[...]
> 
> Link: https://lkml.kernel.org/r/20240119145241.769622-4-bhe@redhat.com

I confirmed the original patch is making the above mentioned file renaming.

> Signed-off-by: Baoquan He <bhe@redhat.com>
> Cc: Al Viro <viro@zeniv.linux.org.uk>
> Cc: Eric W. Biederman <ebiederm@xmission.com>
> Cc: Hari Bathini <hbathini@linux.ibm.com>
> Cc: Pingfan Liu <piliu@redhat.com>
> Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
> ---
> 
>  arch/powerpc/Kconfig    |    1 -
>  kernel/Makefile         |    3 +--
>  kernel/kexec_internal.h |    2 ++
>  3 files changed, 3 insertions(+), 3 deletions(-)

However, seems the renaming change has mistakenly not took here.  Apparently
for the reason, I'm getting below build warning on mm-unstable tree after this
patch.

    make[4]: *** No rule to make target 'kernel/elfcorehdr.o', needed by 'kernel/built-in.a'.  Stop.

I confirmed the build error is disappeared after I manually rename the source
file.


Thanks,
SJ

[...]

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: + crash-remove-dependency-of-fa_dump-on-crash_dump.patch added to mm-unstable branch
  2024-01-23  5:59 ` SeongJae Park
@ 2024-01-23  7:28   ` Baoquan He
  0 siblings, 0 replies; 4+ messages in thread
From: Baoquan He @ 2024-01-23  7:28 UTC (permalink / raw)
  To: SeongJae Park; +Cc: Andrew Morton, mm-commits, viro, piliu, hbathini, ebiederm

On 01/22/24 at 09:59pm, SeongJae Park wrote:
> Hi Andrew,
> 
> On Mon, 22 Jan 2024 16:44:00 -0800 Andrew Morton <akpm@linux-foundation.org> wrote:
> 
> > 
> > The patch titled
> >      Subject: crash: remove dependency of FA_DUMP on CRASH_DUMP
> > has been added to the -mm mm-unstable branch.  Its filename is
> >      crash-remove-dependency-of-fa_dump-on-crash_dump.patch
> [...]
> > 
> > ------------------------------------------------------
> > From: Baoquan He <bhe@redhat.com>
> > Subject: crash: remove dependency of FA_DUMP on CRASH_DUMP
> > Date: Fri, 19 Jan 2024 22:52:30 +0800
> > 
> [...]
> > To remove the dependency of FA_DUMP on CRASH_DUMP to avoid confusion,
> > rename kernel/crash_dump.c to kernel/elfcorehdr.c,
> [...]
> > 
> > Link: https://lkml.kernel.org/r/20240119145241.769622-4-bhe@redhat.com
> 
> I confirmed the original patch is making the above mentioned file renaming.
> 
> > Signed-off-by: Baoquan He <bhe@redhat.com>
> > Cc: Al Viro <viro@zeniv.linux.org.uk>
> > Cc: Eric W. Biederman <ebiederm@xmission.com>
> > Cc: Hari Bathini <hbathini@linux.ibm.com>
> > Cc: Pingfan Liu <piliu@redhat.com>
> > Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
> > ---
> > 
> >  arch/powerpc/Kconfig    |    1 -
> >  kernel/Makefile         |    3 +--
> >  kernel/kexec_internal.h |    2 ++
> >  3 files changed, 3 insertions(+), 3 deletions(-)
> 
> However, seems the renaming change has mistakenly not took here.  Apparently
> for the reason, I'm getting below build warning on mm-unstable tree after this
> patch.
> 
>     make[4]: *** No rule to make target 'kernel/elfcorehdr.o', needed by 'kernel/built-in.a'.  Stop.
> 
> I confirmed the build error is disappeared after I manually rename the source
> file.

Thanks, Andrew mentioned this issue earlier. I will send v3 including
a fix.


^ permalink raw reply	[flat|nested] 4+ messages in thread

* + crash-remove-dependency-of-fa_dump-on-crash_dump.patch added to mm-unstable branch
@ 2024-01-24 10:16 Andrew Morton
  0 siblings, 0 replies; 4+ messages in thread
From: Andrew Morton @ 2024-01-24 10:16 UTC (permalink / raw)
  To: mm-commits, viro, piliu, hbathini, ebiederm, bhe, akpm


The patch titled
     Subject: crash: remove dependency of FA_DUMP on CRASH_DUMP
has been added to the -mm mm-unstable branch.  Its filename is
     crash-remove-dependency-of-fa_dump-on-crash_dump.patch

This patch will shortly appear at
     https://git.kernel.org/pub/scm/linux/kernel/git/akpm/25-new.git/tree/patches/crash-remove-dependency-of-fa_dump-on-crash_dump.patch

This patch will later appear in the mm-unstable branch at
    git://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm

Before you just go and hit "reply", please:
   a) Consider who else should be cc'ed
   b) Prefer to cc a suitable mailing list as well
   c) Ideally: find the original patch on the mailing list and do a
      reply-to-all to that, adding suitable additional cc's

*** Remember to use Documentation/process/submit-checklist.rst when testing your code ***

The -mm tree is included into linux-next via the mm-everything
branch at git://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm
and is updated there every 2-3 working days

------------------------------------------------------
From: Baoquan He <bhe@redhat.com>
Subject: crash: remove dependency of FA_DUMP on CRASH_DUMP
Date: Wed, 24 Jan 2024 13:12:43 +0800

In kdump kernel, /proc/vmcore is an elf file mapping the crashed kernel's
old memory content. Its elf header is constructed in 1st kernel and passed
to kdump kernel via elfcorehdr_addr. Config CRASH_DUMP enables the code
of 1st kernel's old memory accessing in different architectures.

Currently, config FA_DUMP has dependency on CRASH_DUMP because fadump
needs access global variable 'elfcorehdr_addr' to judge if it's in
kdump kernel within function is_kdump_kernel(). In the current
kernel/crash_dump.c, variable 'elfcorehdr_addr' is defined, and function
setup_elfcorehdr() used to parse kernel parameter to fetch the passed
value of elfcorehdr_addr. Only for accessing elfcorehdr_addr, FA_DUMP
really doesn't have to depends on CRASH_DUMP.

To remove the dependency of FA_DUMP on CRASH_DUMP to avoid confusion,
rename kernel/crash_dump.c to kernel/elfcorehdr.c, and build it when
CONFIG_VMCORE_INFO is ebabled. With this, FA_DUMP doesn't need to depend
on CRASH_DUMP.

Link: https://lkml.kernel.org/r/20240124051254.67105-4-bhe@redhat.com
Signed-off-by: Baoquan He <bhe@redhat.com>
Cc: Al Viro <viro@zeniv.linux.org.uk>
Cc: Eric W. Biederman <ebiederm@xmission.com>
Cc: Hari Bathini <hbathini@linux.ibm.com>
Cc: Pingfan Liu <piliu@redhat.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
---

 arch/powerpc/Kconfig    |    1 -
 kernel/Makefile         |    3 +--
 kernel/kexec_internal.h |    2 ++
 3 files changed, 3 insertions(+), 3 deletions(-)

--- a/arch/powerpc/Kconfig~crash-remove-dependency-of-fa_dump-on-crash_dump
+++ a/arch/powerpc/Kconfig
@@ -692,7 +692,6 @@ config FA_DUMP
 	depends on PPC64 && (PPC_RTAS || PPC_POWERNV)
 	select VMCORE_INFO
 	select CRASH_RESERVE
-	select CRASH_DUMP
 	help
 	  A robust mechanism to get reliable kernel crash dump with
 	  assistance from firmware. This approach does not use kexec,
--- a/kernel/kexec_internal.h~crash-remove-dependency-of-fa_dump-on-crash_dump
+++ a/kernel/kexec_internal.h
@@ -4,6 +4,8 @@
 
 #include <linux/kexec.h>
 
+struct kexec_segment;
+
 struct kimage *do_kimage_alloc_init(void);
 int sanity_check_segment_list(struct kimage *image);
 void kimage_free_page_list(struct list_head *list);
--- a/kernel/Makefile~crash-remove-dependency-of-fa_dump-on-crash_dump
+++ a/kernel/Makefile
@@ -68,7 +68,7 @@ obj-$(CONFIG_MODULE_SIG_FORMAT) += modul
 obj-$(CONFIG_KALLSYMS) += kallsyms.o
 obj-$(CONFIG_KALLSYMS_SELFTEST) += kallsyms_selftest.o
 obj-$(CONFIG_BSD_PROCESS_ACCT) += acct.o
-obj-$(CONFIG_VMCORE_INFO) += vmcore_info.o
+obj-$(CONFIG_VMCORE_INFO) += vmcore_info.o elfcorehdr.o
 obj-$(CONFIG_CRASH_RESERVE) += crash_reserve.o
 obj-$(CONFIG_KEXEC_CORE) += kexec_core.o crash_core.o
 obj-$(CONFIG_KEXEC) += kexec.o
@@ -121,7 +121,6 @@ obj-$(CONFIG_PERF_EVENTS) += events/
 
 obj-$(CONFIG_USER_RETURN_NOTIFIER) += user-return-notifier.o
 obj-$(CONFIG_PADATA) += padata.o
-obj-$(CONFIG_CRASH_DUMP) += crash_dump.o
 obj-$(CONFIG_JUMP_LABEL) += jump_label.o
 obj-$(CONFIG_CONTEXT_TRACKING) += context_tracking.o
 obj-$(CONFIG_TORTURE_TEST) += torture.o
_

Patches currently in -mm which might be from bhe@redhat.com are

mm-vmalloc-remove-vmap_area_list.patch
kexec-split-crashkernel-reservation-code-out-from-crash_corec.patch
crash-split-vmcoreinfo-exporting-code-out-from-crash_corec.patch
crash-remove-dependency-of-fa_dump-on-crash_dump.patch
crash-split-crash-dumping-code-out-from-kexec_corec.patch
crash-clean-up-kdump-related-config-items.patch
x86-crash-wrap-crash-dumping-code-into-crash-related-ifdefs.patch
arm64-crash-wrap-crash-dumping-code-into-crash-related-ifdefs.patch
ppc-crash-enforce-kexec-and-kexec_file-to-select-crash_dump.patch
s390-crash-wrap-crash-dumping-code-into-crash-related-ifdefs.patch
sh-crash-wrap-crash-dumping-code-into-crash-related-ifdefs.patch
mips-crash-wrap-crash-dumping-code-into-crash-related-ifdefs.patch
riscv-crash-wrap-crash-dumping-code-into-crash-related-ifdefs.patch
arm-crash-wrap-crash-dumping-code-into-crash-related-ifdefs.patch
loongarch-crash-wrap-crash-dumping-code-into-crash-related-ifdefs.patch
panic-suppress-gnu_printf-warning.patch


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2024-01-24 10:16 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-01-23  0:44 + crash-remove-dependency-of-fa_dump-on-crash_dump.patch added to mm-unstable branch Andrew Morton
2024-01-23  5:59 ` SeongJae Park
2024-01-23  7:28   ` Baoquan He
  -- strict thread matches above, loose matches on Subject: below --
2024-01-24 10:16 Andrew Morton

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.