Skip to contentSkip to conversation

kernel/Kconfig.kexec: drop select of KEXEC for CRASH_DUMP

PATCH Superseded Baoquan He 5 participants 16 messages Nov 23, 2023 – Nov 27, 2023

Subsystems (5)

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore

Baoquan He

author
#0 lore raw

cover kernel/Kconfig.kexec: drop select of KEXEC for CRASH_DUMP

Ignat reported a potential config regression was introduced by commit 89cde455915f ("kexec: consolidate kexec and crash options into kernel/Kconfig.kexec"). Please click below link for more details:

https://lore.kernel.org/all/CALrw=nHpRQQaQTP_jZfREgrQEMpS8jBF8JQCv4ygqXycE-StaA@mail.gmail.com/T/#u

The patch 1 fix the regression by removing incorrect CONFIG_KEXEC ifdeffery scope adding in arm's <asm/kexec.h>, then dropping the select of KEXEC for CRASH_DUMP. This is tested and passed a cross comiping of arm.

Patch 2 is to fix a build failure when I tested patch 1 on x86_64, the wrong CONFIG_KEXEC iddeffery is replaced with CONFIG_KEXEC_CORE. Test passed on x86_64.

Patch 3 is to fix an unnecessary 'select KEXEC' in s390 ARCH. Removing the select won't impact anything. Test passed on a ibm-z system.

Baoquan He (3):
kernel/Kconfig.kexec: drop select of KEXEC for CRASH_DUMP drivers/base/cpu: crash data showing should depends on KEXEC_CORE s390/Kconfig: drop select of KEXEC

 arch/arm/include/asm/kexec.h | 4 ----
 arch/s390/Kconfig            | 1 -
 drivers/base/cpu.c           | 6 +++---
 kernel/Kconfig.kexec         | 1 -
 4 files changed, 3 insertions(+), 9 deletions(-)
Signature · 1 line
2.41.0
author
#1 lore raw

PATCH 1/3 kernel/Kconfig.kexec: drop select of KEXEC for CRASH_DUMP

Ignat Korchagin complained that a potential config regression was introduced by commit 89cde455915f ("kexec: consolidate kexec and crash options into kernel/Kconfig.kexec"). Before the commit, CONFIG_CRASH_DUMP has no dependency on CONFIG_KEXEC. After the commit, CRASH_DUMP selects KEXEC. That enforces system to have CONFIG_KEXEC=y as long as CONFIG_CRASH_DUMP=Y which people may not want.

In Ignat's case, he sets CONFIG_CRASH_DUMP=y, CONFIG_KEXEC_FILE=y and CONFIG_KEXEC=n because kexec_load interface could have security issue if kernel/initrd has no chance to be signed and verified.

CRASH_DUMP has select of KEXEC because Eric, author of above commit, met a LKP report of build failure when posting patch of earlier version. Please see below link to get detail of the LKP report:

    https://lore.kernel.org/all/[email protected]/T/#u

In fact, that LKP report is triggered because arm's <asm/kexec.h> is wrapped in CONFIG_KEXEC ifdeffery scope. That is wrong. CONFIG_KEXEC controls the enabling/disabling of kexec_load interface, but not kexec feature. Removing the wrongly added CONFIG_KEXEC ifdeffery scope in <asm/kexec.h> of arm allows us to drop the select KEXEC for CRASH_DUMP.

---
 arch/arm/include/asm/kexec.h | 4 ----
 kernel/Kconfig.kexec         | 1 -
 2 files changed, 5 deletions(-)
arch/arm/include/asm/kexec.h +0 -4
index e62832dcba76..a8287e7ab9d4 100644
@@ -2,8 +2,6 @@
 #ifndef _ARM_KEXEC_H
 #define _ARM_KEXEC_H
 
-#ifdef CONFIG_KEXEC
-
 /* Maximum physical address we can use pages from */
 #define KEXEC_SOURCE_MEMORY_LIMIT (-1UL)
 /* Maximum address we can reach in physical address mode */
@@ -82,6 +80,4 @@ static inline struct page *boot_pfn_to_page(unsigned long boot_pfn)
 
 #endif /* __ASSEMBLY__ */
 
-#endif /* CONFIG_KEXEC */
-
 #endif /* _ARM_KEXEC_H */
kernel/Kconfig.kexec +0 -1
index 7aff28ded2f4..1cc3b1c595d7 100644
@@ -97,7 +97,6 @@ config CRASH_DUMP
 	depends on ARCH_SUPPORTS_KEXEC
 	select CRASH_CORE
 	select KEXEC_CORE
-	select KEXEC
 	help
 	  Generate crash dump after being started by kexec.
 	  This should be normally only set in special crash dump kernels
Signature · 1 line
2.41.0
#2 lore raw
Quoted 16 lines · Baoquan He

Ignat Korchagin complained that a potential config regression was introduced by commit 89cde455915f ("kexec: consolidate kexec and crash options into kernel/Kconfig.kexec"). Before the commit, CONFIG_CRASH_DUMP has no dependency on CONFIG_KEXEC. After the commit, CRASH_DUMP selects KEXEC. That enforces system to have CONFIG_KEXEC=y as long as CONFIG_CRASH_DUMP=Y which people may not want.

In Ignat's case, he sets CONFIG_CRASH_DUMP=y, CONFIG_KEXEC_FILE=y and CONFIG_KEXEC=n because kexec_load interface could have security issue if kernel/initrd has no chance to be signed and verified.

CRASH_DUMP has select of KEXEC because Eric, author of above commit, met a LKP report of build failure when posting patch of earlier version. Please see below link to get detail of the LKP report:

Quoted 7 lines
    https://lore.kernel.org/all/[email protected]/T/#u

In fact, that LKP report is triggered because arm's <asm/kexec.h> is wrapped in CONFIG_KEXEC ifdeffery scope. That is wrong. CONFIG_KEXEC controls the enabling/disabling of kexec_load interface, but not kexec feature. Removing the wrongly added CONFIG_KEXEC ifdeffery scope in <asm/kexec.h> of arm allows us to drop the select KEXEC for CRASH_DUMP.

Hm... With the patch, when cross compiling for arm and CONFIG_KEXEC_CORE=y
# CONFIG_KEXEC is not set
CONFIG_CRASH_DUMP=y

I get the following linker error at the end:

  CALL    scripts/checksyscalls.sh
  UPD     include/generated/utsversion.h
  CC      init/version-timestamp.o
  LD      .tmp_vmlinux.kallsyms1

arm-linux-gnueabi-ld: kernel/kexec_core.o: in function `kimage_free':
kexec_core.c:(.text+0xf5c): undefined reference to `machine_kexec_cleanup'
arm-linux-gnueabi-ld: kernel/kexec_core.o: in function `__crash_kexec':
kexec_core.c:(.text+0x15bc): undefined reference to `machine_crash_shutdown'
arm-linux-gnueabi-ld: kexec_core.c:(.text+0x15c4): undefined reference to `machine_kexec'
arm-linux-gnueabi-ld: kernel/kexec_core.o: in function `kernel_kexec':
kexec_core.c:(.text+0x1a04): undefined reference to `machine_kexec' make[2]: *** [scripts/Makefile.vmlinux:37: vmlinux] Error 1 make[1]: *** [/home/ignat/git/linux-upstream/Makefile:1154: vmlinux] Error 2
make: *** [Makefile:234: __sub-make] Error 2

Quoted 41 lines
---
 arch/arm/include/asm/kexec.h | 4 ----
 kernel/Kconfig.kexec         | 1 -
 2 files changed, 5 deletions(-)
arch/arm/include/asm/kexec.h +0 -4
index e62832dcba76..a8287e7ab9d4 100644
@@ -2,8 +2,6 @@
 #ifndef _ARM_KEXEC_H
 #define _ARM_KEXEC_H
 
-#ifdef CONFIG_KEXEC
-
 /* Maximum physical address we can use pages from */
 #define KEXEC_SOURCE_MEMORY_LIMIT (-1UL)
 /* Maximum address we can reach in physical address mode */
@@ -82,6 +80,4 @@ static inline struct page *boot_pfn_to_page(unsigned long boot_pfn)
 
 #endif /* __ASSEMBLY__ */
 
-#endif /* CONFIG_KEXEC */
-
 #endif /* _ARM_KEXEC_H */
kernel/Kconfig.kexec +0 -2
index 7aff28ded2f4..1cc3b1c595d7 100644
@@ -97,7 +97,6 @@ config CRASH_DUMP
        depends on ARCH_SUPPORTS_KEXEC
        select CRASH_CORE
        select KEXEC_CORE
-       select KEXEC
        help
          Generate crash dump after being started by kexec.
          This should be normally only set in special crash dump kernels
--

2.41.0

author
#3 lore raw
Quoted 36 lines · Ignat Korchagin
Quoted 16 lines · Baoquan He

Ignat Korchagin complained that a potential config regression was introduced by commit 89cde455915f ("kexec: consolidate kexec and crash options into kernel/Kconfig.kexec"). Before the commit, CONFIG_CRASH_DUMP has no dependency on CONFIG_KEXEC. After the commit, CRASH_DUMP selects KEXEC. That enforces system to have CONFIG_KEXEC=y as long as CONFIG_CRASH_DUMP=Y which people may not want.

In Ignat's case, he sets CONFIG_CRASH_DUMP=y, CONFIG_KEXEC_FILE=y and CONFIG_KEXEC=n because kexec_load interface could have security issue if kernel/initrd has no chance to be signed and verified.

CRASH_DUMP has select of KEXEC because Eric, author of above commit, met a LKP report of build failure when posting patch of earlier version. Please see below link to get detail of the LKP report:

Quoted 7 lines
    https://lore.kernel.org/all/[email protected]/T/#u

In fact, that LKP report is triggered because arm's <asm/kexec.h> is wrapped in CONFIG_KEXEC ifdeffery scope. That is wrong. CONFIG_KEXEC controls the enabling/disabling of kexec_load interface, but not kexec feature. Removing the wrongly added CONFIG_KEXEC ifdeffery scope in <asm/kexec.h> of arm allows us to drop the select KEXEC for CRASH_DUMP.

Hm... With the patch, when cross compiling for arm and CONFIG_KEXEC_CORE=y
# CONFIG_KEXEC is not set
CONFIG_CRASH_DUMP=y

I get the following linker error at the end:

  CALL    scripts/checksyscalls.sh
  UPD     include/generated/utsversion.h
  CC      init/version-timestamp.o
  LD      .tmp_vmlinux.kallsyms1
Quoted 11 lines

arm-linux-gnueabi-ld: kernel/kexec_core.o: in function `kimage_free':
kexec_core.c:(.text+0xf5c): undefined reference to `machine_kexec_cleanup'
arm-linux-gnueabi-ld: kernel/kexec_core.o: in function `__crash_kexec':
kexec_core.c:(.text+0x15bc): undefined reference to `machine_crash_shutdown'
arm-linux-gnueabi-ld: kexec_core.c:(.text+0x15c4): undefined reference to `machine_kexec'
arm-linux-gnueabi-ld: kernel/kexec_core.o: in function `kernel_kexec':
kexec_core.c:(.text+0x1a04): undefined reference to `machine_kexec' make[2]: *** [scripts/Makefile.vmlinux:37: vmlinux] Error 1 make[1]: *** [/home/ignat/git/linux-upstream/Makefile:1154: vmlinux] Error 2
make: *** [Makefile:234: __sub-make] Error 2

Oops, I forgot this part. This should fix the link error.

arch/arm/kernel/Makefile +1 -1
index d53f56d6f840..771264d4726a 100644
@@ -59,7 +59,7 @@ obj-$(CONFIG_FUNCTION_TRACER)	+= entry-ftrace.o
 obj-$(CONFIG_DYNAMIC_FTRACE)	+= ftrace.o insn.o patch.o
 obj-$(CONFIG_FUNCTION_GRAPH_TRACER)	+= ftrace.o insn.o patch.o
 obj-$(CONFIG_JUMP_LABEL)	+= jump_label.o insn.o patch.o
-obj-$(CONFIG_KEXEC)		+= machine_kexec.o relocate_kernel.o
+obj-$(CONFIG_KEXEC_CORE)	+= machine_kexec.o relocate_kernel.o
 # Main staffs in KPROBES are in arch/arm/probes/ .
 obj-$(CONFIG_KPROBES)		+= patch.o insn.o
 obj-$(CONFIG_OABI_COMPAT)	+= sys_oabi-compat.o
author
#4 lore raw

PATCH 2/3 drivers/base/cpu: crash data showing should depends on KEXEC_CORE

In reply to Baoquan He

When below kernel config items are set, compiling error are triggered.

CONFIG_CRASH_CORE=y
CONFIG_KEXEC_CORE=y
CONFIG_CRASH_DUMP=y
CONFIG_CRASH_HOTPLUG=y

------------------------------------------------------
drivers/base/cpu.c: In function ‘crash_hotplug_show’:
drivers/base/cpu.c:309:40: error: implicit declaration of function ‘crash_hotplug_cpu_support’; did you mean ‘crash_hotplug_show’? [-Werror=implicit-function-declaration]

  309 |         return sysfs_emit(buf, "%d\n", crash_hotplug_cpu_support());
      |                                        ^~~~~~~~~~~~~~~~~~~~~~~~~
      |                                        crash_hotplug_show

cc1: some warnings being treated as errors
------------------------------------------------------

CONFIG_KEXEC is used to enable kexec_load interface, the crash_notes/crash_notes_size/crash_hotplug showing depends on CONFIG_KEXEC is incorrect. It should depend on KEXEC_CORE instead.

Fix it now.

---
 drivers/base/cpu.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
drivers/base/cpu.c +3 -3
index 9ea22e165acd..548491de818e 100644
@@ -144,7 +144,7 @@ static DEVICE_ATTR(release, S_IWUSR, NULL, cpu_release_store);
 #endif /* CONFIG_ARCH_CPU_PROBE_RELEASE */
 #endif /* CONFIG_HOTPLUG_CPU */
 
-#ifdef CONFIG_KEXEC
+#ifdef CONFIG_KEXEC_CORE
 #include <linux/kexec.h>
 
 static ssize_t crash_notes_show(struct device *dev,
@@ -189,14 +189,14 @@ static const struct attribute_group crash_note_cpu_attr_group = {
 #endif
 
 static const struct attribute_group *common_cpu_attr_groups[] = {
-#ifdef CONFIG_KEXEC
+#ifdef CONFIG_KEXEC_CORE
 	&crash_note_cpu_attr_group,
 #endif
 	NULL
 };
 
 static const struct attribute_group *hotplugable_cpu_attr_groups[] = {
-#ifdef CONFIG_KEXEC
+#ifdef CONFIG_KEXEC_CORE
 	&crash_note_cpu_attr_group,
 #endif
 	NULL
Signature · 1 line
2.41.0
#5 lore raw

Re: [PATCH 2/3] drivers/base/cpu: crash data showing should depends on KEXEC_CORE

Quoted 14 lines · Baoquan He

When below kernel config items are set, compiling error are triggered.

CONFIG_CRASH_CORE=y
CONFIG_KEXEC_CORE=y
CONFIG_CRASH_DUMP=y
CONFIG_CRASH_HOTPLUG=y

------------------------------------------------------
drivers/base/cpu.c: In function ‘crash_hotplug_show’:
drivers/base/cpu.c:309:40: error: implicit declaration of function ‘crash_hotplug_cpu_support’; did you mean ‘crash_hotplug_show’? [-Werror=implicit-function-declaration]

  309 |         return sysfs_emit(buf, "%d\n", crash_hotplug_cpu_support());
      |                                        ^~~~~~~~~~~~~~~~~~~~~~~~~
      |                                        crash_hotplug_show
Quoted 8 lines

cc1: some warnings being treated as errors
------------------------------------------------------

CONFIG_KEXEC is used to enable kexec_load interface, the crash_notes/crash_notes_size/crash_hotplug showing depends on CONFIG_KEXEC is incorrect. It should depend on KEXEC_CORE instead.

Fix it now.

Can we add Fixes/CC stable, so it gets eventually backported into 6.6?

Quoted 38 lines
---
 drivers/base/cpu.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
drivers/base/cpu.c +3 -4
index 9ea22e165acd..548491de818e 100644
@@ -144,7 +144,7 @@ static DEVICE_ATTR(release, S_IWUSR, NULL, cpu_release_store);
 #endif /* CONFIG_ARCH_CPU_PROBE_RELEASE */
 #endif /* CONFIG_HOTPLUG_CPU */
 
-#ifdef CONFIG_KEXEC
+#ifdef CONFIG_KEXEC_CORE
 #include <linux/kexec.h>
 
 static ssize_t crash_notes_show(struct device *dev,
@@ -189,14 +189,14 @@ static const struct attribute_group crash_note_cpu_attr_group = {
 #endif
 
 static const struct attribute_group *common_cpu_attr_groups[] = {
-#ifdef CONFIG_KEXEC
+#ifdef CONFIG_KEXEC_CORE
        &crash_note_cpu_attr_group,
 #endif
        NULL
 };
 
 static const struct attribute_group *hotplugable_cpu_attr_groups[] = {
-#ifdef CONFIG_KEXEC
+#ifdef CONFIG_KEXEC_CORE
        &crash_note_cpu_attr_group,
 #endif
        NULL
--

2.41.0

author
#6 lore raw

Re: [PATCH 2/3] drivers/base/cpu: crash data showing should depends on KEXEC_CORE

Quoted 18 lines · Ignat Korchagin
Quoted 17 lines · Baoquan He

When below kernel config items are set, compiling error are triggered.

CONFIG_CRASH_CORE=y
CONFIG_KEXEC_CORE=y
CONFIG_CRASH_DUMP=y
CONFIG_CRASH_HOTPLUG=y

------------------------------------------------------
drivers/base/cpu.c: In function ‘crash_hotplug_show’:
drivers/base/cpu.c:309:40: error: implicit declaration of function ‘crash_hotplug_cpu_support’; did you mean ‘crash_hotplug_show’? [-Werror=implicit-function-declaration]

  309 |         return sysfs_emit(buf, "%d\n", crash_hotplug_cpu_support());
      |                                        ^~~~~~~~~~~~~~~~~~~~~~~~~
      |                                        crash_hotplug_show

cc1: some warnings being treated as errors
------------------------------------------------------

Quoted 7 lines
Quoted 5 lines

CONFIG_KEXEC is used to enable kexec_load interface, the crash_notes/crash_notes_size/crash_hotplug showing depends on CONFIG_KEXEC is incorrect. It should depend on KEXEC_CORE instead.

Fix it now.

Can we add Fixes/CC stable, so it gets eventually backported into 6.6?

Makes sense. Will add it in v2 since I need respin to add the missing stuff in patch 1. Thanks.

Quoted 40 lines
Quoted 39 lines
---
 drivers/base/cpu.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
drivers/base/cpu.c +3 -4
index 9ea22e165acd..548491de818e 100644
@@ -144,7 +144,7 @@ static DEVICE_ATTR(release, S_IWUSR, NULL, cpu_release_store);
 #endif /* CONFIG_ARCH_CPU_PROBE_RELEASE */
 #endif /* CONFIG_HOTPLUG_CPU */
 
-#ifdef CONFIG_KEXEC
+#ifdef CONFIG_KEXEC_CORE
 #include <linux/kexec.h>
 
 static ssize_t crash_notes_show(struct device *dev,
@@ -189,14 +189,14 @@ static const struct attribute_group crash_note_cpu_attr_group = {
 #endif
 
 static const struct attribute_group *common_cpu_attr_groups[] = {
-#ifdef CONFIG_KEXEC
+#ifdef CONFIG_KEXEC_CORE
        &crash_note_cpu_attr_group,
 #endif
        NULL
 };
 
 static const struct attribute_group *hotplugable_cpu_attr_groups[] = {
-#ifdef CONFIG_KEXEC
+#ifdef CONFIG_KEXEC_CORE
        &crash_note_cpu_attr_group,
 #endif
        NULL
--

2.41.0

#7 lore raw

Re: [PATCH 2/3] drivers/base/cpu: crash data showing should depends on KEXEC_CORE

Quoted 10 lines · On Thu, 23 Nov 2023 19:15:43 +0800 Baoquan He <[email protected]> wrote:
Quoted 7 lines
Quoted 5 lines

CONFIG_KEXEC is used to enable kexec_load interface, the crash_notes/crash_notes_size/crash_hotplug showing depends on CONFIG_KEXEC is incorrect. It should depend on KEXEC_CORE instead.

Fix it now.

Can we add Fixes/CC stable, so it gets eventually backported into 6.6?

Makes sense. Will add it in v2 since I need respin to add the missing stuff in patch 1. Thanks.

Please avoid mixing cc:stable patches and this-merge-window fixes in the same series as next-merge-window material. Because I'll just have to separate them out anyway, causing what-I-merged to unnecessarily differ from what-you-sent.

author
#8 lore raw

Re: [PATCH 2/3] drivers/base/cpu: crash data showing should depends on KEXEC_CORE

Quoted 10 lines · Andrew Morton
Quoted 8 lines · On Thu, 23 Nov 2023 19:15:43 +0800 Baoquan He <[email protected]> wrote:
Quoted 7 lines
Quoted 5 lines

CONFIG_KEXEC is used to enable kexec_load interface, the crash_notes/crash_notes_size/crash_hotplug showing depends on CONFIG_KEXEC is incorrect. It should depend on KEXEC_CORE instead.

Fix it now.

Can we add Fixes/CC stable, so it gets eventually backported into 6.6?

Quoted 7 lines
Quoted 2 lines

Makes sense. Will add it in v2 since I need respin to add the missing stuff in patch 1. Thanks.

Please avoid mixing cc:stable patches and this-merge-window fixes in the same series as next-merge-window material. Because I'll just have to separate them out anyway, causing what-I-merged to unnecessarily differ from what-you-sent.

Got it, will send them separately because the issue that this patch is fixing has been there for very long time. Thanks for noticing.

#9 lore raw

Re: [PATCH 2/3] drivers/base/cpu: crash data showing should depends on KEXEC_CORE

In reply to Baoquan He
Quoted 13 lines · Baoquan He

When below kernel config items are set, compiling error are triggered.

CONFIG_CRASH_CORE=y
CONFIG_KEXEC_CORE=y
CONFIG_CRASH_DUMP=y
CONFIG_CRASH_HOTPLUG=y

------------------------------------------------------
drivers/base/cpu.c: In function ‘crash_hotplug_show’:
drivers/base/cpu.c:309:40: error: implicit declaration of function ‘crash_hotplug_cpu_support’; did you mean ‘crash_hotplug_show’? [-Werror=implicit-function-declaration]

  309 |         return sysfs_emit(buf, "%d\n", crash_hotplug_cpu_support());
      |                                        ^~~~~~~~~~~~~~~~~~~~~~~~~
      |                                        crash_hotplug_show
Quoted 8 lines

cc1: some warnings being treated as errors
------------------------------------------------------

CONFIG_KEXEC is used to enable kexec_load interface, the crash_notes/crash_notes_size/crash_hotplug showing depends on CONFIG_KEXEC is incorrect. It should depend on KEXEC_CORE instead.

Fix it now.

If this error introduced with the prevous patch?
If so, the patches need to be swapped I guess.

Quoted 1 line
author
#10 lore raw

Re: [PATCH 2/3] drivers/base/cpu: crash data showing should depends on KEXEC_CORE

Quoted 17 lines · Alexander Gordeev
Quoted 16 lines · Baoquan He

When below kernel config items are set, compiling error are triggered.

CONFIG_CRASH_CORE=y
CONFIG_KEXEC_CORE=y
CONFIG_CRASH_DUMP=y
CONFIG_CRASH_HOTPLUG=y

------------------------------------------------------
drivers/base/cpu.c: In function ‘crash_hotplug_show’:
drivers/base/cpu.c:309:40: error: implicit declaration of function ‘crash_hotplug_cpu_support’; did you mean ‘crash_hotplug_show’? [-Werror=implicit-function-declaration]

  309 |         return sysfs_emit(buf, "%d\n", crash_hotplug_cpu_support());
      |                                        ^~~~~~~~~~~~~~~~~~~~~~~~~
      |                                        crash_hotplug_show

cc1: some warnings being treated as errors
------------------------------------------------------

Quoted 8 lines
Quoted 5 lines

CONFIG_KEXEC is used to enable kexec_load interface, the crash_notes/crash_notes_size/crash_hotplug showing depends on CONFIG_KEXEC is incorrect. It should depend on KEXEC_CORE instead.

Fix it now.

If this error introduced with the prevous patch?
If so, the patches need to be swapped I guess.

From the phenomenon, yes. In fact it's the patch 1 which exposes the wrong ifdeffery. I can shift the order in v2. Thanks.

Quoted 3 lines
Quoted 2 lines
author
#11 lore raw

PATCH 3/3 s390/Kconfig: drop select of KEXEC

In reply to Baoquan He

No proof is found to require that S390 architecture has to select KEXEC. At least from my testing at below, dropping select of KEXEC won't impact anything.

===testing 1===
CONFIG_CRASH_CORE=y
CONFIG_KEXEC_CORE=y
CONFIG_CRASH_DUMP=y
===

===testing 2===
CONFIG_CRASH_CORE=y
CONFIG_KEXEC_CORE=y
CONFIG_KEXEC_FILE=y
CONFIG_CRASH_DUMP=y
===

So drop the select of KEXEC now.

---
 arch/s390/Kconfig | 1 -
 1 file changed, 1 deletion(-)
arch/s390/Kconfig +0 -1
index 3bec98d20283..1aec2e692dca 100644
@@ -217,7 +217,6 @@ config S390
 	select HAVE_VIRT_CPU_ACCOUNTING_IDLE
 	select IOMMU_HELPER		if PCI
 	select IOMMU_SUPPORT		if PCI
-	select KEXEC
 	select MMU_GATHER_MERGE_VMAS
 	select MMU_GATHER_NO_GATHER
 	select MMU_GATHER_RCU_TABLE_FREE
Signature · 1 line
2.41.0
#12 lore raw

Re: [PATCH 3/3] s390/Kconfig: drop select of KEXEC

On Thu, Nov 23, 2023 at 03:36:52PM +0800, Baoquan He wrote:

Hi Baoquan,

Quoted 3 lines

No proof is found to require that S390 architecture has to select KEXEC. At least from my testing at below, dropping select of KEXEC won't impact anything.

It does impact the outcome of defconfigs.
Namely, CONFIG_KEXEC is not set with this patch.

Quoted 6 lines

===testing 1===
CONFIG_CRASH_CORE=y
CONFIG_KEXEC_CORE=y
CONFIG_CRASH_DUMP=y
===

Quoted 6 lines

===testing 2===
CONFIG_CRASH_CORE=y
CONFIG_KEXEC_CORE=y
CONFIG_KEXEC_FILE=y
CONFIG_CRASH_DUMP=y
===

Unfortunately, I do not quite realize what these testings were and what is the difference between the two.

Quoted 1 line

So drop the select of KEXEC now.

I suggest dropping this patch. Once the previous two are upstream we would remove 'select KEXEC' from Kconfig together with defconfig updates.

Quoted 11 lines
---
 arch/s390/Kconfig | 1 -
 1 file changed, 1 deletion(-)
arch/s390/Kconfig +0 -0
index 3bec98d20283..1aec2e692dca 100644

arch/s390/Kconfig config S390 · line 222

Quoted 7 lines
arch/s390/Kconfig +0 -1
@@ -217,7 +217,6 @@ config S390
 	select HAVE_VIRT_CPU_ACCOUNTING_IDLE
 	select IOMMU_HELPER		if PCI
 	select IOMMU_SUPPORT		if PCI
-	select KEXEC
 	select MMU_GATHER_MERGE_VMAS
 	select MMU_GATHER_NO_GATHER
 	select MMU_GATHER_RCU_TABLE_FREE

Thanks!

author
#13 lore raw

Re: [PATCH 3/3] s390/Kconfig: drop select of KEXEC

Quoted 10 lines · Alexander Gordeev

On Thu, Nov 23, 2023 at 03:36:52PM +0800, Baoquan He wrote:

Hi Baoquan,

Quoted 3 lines

No proof is found to require that S390 architecture has to select KEXEC. At least from my testing at below, dropping select of KEXEC won't impact anything.

It does impact the outcome of defconfigs.
Namely, CONFIG_KEXEC is not set with this patch.

Right, CONFIG_KEXEC won't be set defaultly with this patch applied.

Quoted 14 lines
Quoted 7 lines

===testing 1===
CONFIG_CRASH_CORE=y
CONFIG_KEXEC_CORE=y
CONFIG_CRASH_DUMP=y
===

Quoted 6 lines

===testing 2===
CONFIG_CRASH_CORE=y
CONFIG_KEXEC_CORE=y
CONFIG_KEXEC_FILE=y
CONFIG_CRASH_DUMP=y
===

Quoted 2 lines

Unfortunately, I do not quite realize what these testings were and what is the difference between the two.

Both these two testings have CONFIG_KEXEC=n, and building all passed. I wound't present their difference, but two cases where no CONFIG_KEXEC is set and no dependency on CONFIG_KEXEC is seen.

Quoted 6 lines
Quoted 2 lines

So drop the select of KEXEC now.

I suggest dropping this patch. Once the previous two are upstream we would remove 'select KEXEC' from Kconfig together with defconfig updates.

I see your concern, will drop this one in v2. Thanks for checking these.

Quoted 22 lines
Quoted 12 lines
---
 arch/s390/Kconfig | 1 -
 1 file changed, 1 deletion(-)
arch/s390/Kconfig +0 -0
index 3bec98d20283..1aec2e692dca 100644

arch/s390/Kconfig config S390 · line 222

Quoted 7 lines
arch/s390/Kconfig +0 -1
@@ -217,7 +217,6 @@ config S390
 	select HAVE_VIRT_CPU_ACCOUNTING_IDLE
 	select IOMMU_HELPER		if PCI
 	select IOMMU_SUPPORT		if PCI
-	select KEXEC
 	select MMU_GATHER_MERGE_VMAS
 	select MMU_GATHER_NO_GATHER
 	select MMU_GATHER_RCU_TABLE_FREE

Thanks!

#14 lore raw
In reply to Baoquan He
Quoted 11 lines · Baoquan He

Ignat reported a potential config regression was introduced by commit 89cde455915f ("kexec: consolidate kexec and crash options into kernel/Kconfig.kexec"). Please click below link for more details:

https://lore.kernel.org/all/CALrw=nHpRQQaQTP_jZfREgrQEMpS8jBF8JQCv4ygqXycE-StaA@mail.gmail.com/T/#u

The patch 1 fix the regression by removing incorrect CONFIG_KEXEC ifdeffery scope adding in arm's <asm/kexec.h>, then dropping the select of KEXEC for CRASH_DUMP. This is tested and passed a cross comiping of arm.

Quoted 6 lines

Patch 2 is to fix a build failure when I tested patch 1 on x86_64, the wrong CONFIG_KEXEC iddeffery is replaced with CONFIG_KEXEC_CORE. Test passed on x86_64.

Patch 3 is to fix an unnecessary 'select KEXEC' in s390 ARCH. Removing the select won't impact anything. Test passed on a ibm-z system.

I apologize for my delay in responding, I did not have a computer with me during my holiday travel.

I was able to re-run my Kconfig test script with this patch series (now that I'm running this on private resources, it takes half a day 8( ). The script only performs comparisons of the .config before (LHSB) and after (RHSB) the patch series; it does NOT do any building. At any rate, what that revealed was only differences in s390. That means that all other arches do not have any unintended side effects. The differences with patch3 applied look like:

FAIL: allnoconfig arch/s390/configs/kasan.config
LHSB {'CONFIG_CRASH_CORE': 'y', 'CONFIG_KEXEC_CORE': 'y', 'CONFIG_KEXEC': 'y'} RHSB {'CONFIG_KEXEC': 'n'}

The 'allnoconfig' and 'olddefconfig' targets failed for all s390 defconfigs. The LHSB is the pre-patch values, and the RHSB is the post-patch values. So this states that CRASH_CORE and KEXEC_CORE were set previously, but now they are not. KEXEC obviously is being turned off intentionally.

Hope this helps some.

Regards,

eric

Quoted 11 lines

Baoquan He (3):
kernel/Kconfig.kexec: drop select of KEXEC for CRASH_DUMP drivers/base/cpu: crash data showing should depends on KEXEC_CORE s390/Kconfig: drop select of KEXEC

  arch/arm/include/asm/kexec.h | 4 ----
  arch/s390/Kconfig            | 1 -
  drivers/base/cpu.c           | 6 +++---
  kernel/Kconfig.kexec         | 1 -
  4 files changed, 3 insertions(+), 9 deletions(-)
author
#15 lore raw
Quoted 35 lines · Eric DeVolder
Quoted 11 lines · Baoquan He

Ignat reported a potential config regression was introduced by commit 89cde455915f ("kexec: consolidate kexec and crash options into kernel/Kconfig.kexec"). Please click below link for more details:

https://lore.kernel.org/all/CALrw=nHpRQQaQTP_jZfREgrQEMpS8jBF8JQCv4ygqXycE-StaA@mail.gmail.com/T/#u

The patch 1 fix the regression by removing incorrect CONFIG_KEXEC ifdeffery scope adding in arm's <asm/kexec.h>, then dropping the select of KEXEC for CRASH_DUMP. This is tested and passed a cross comiping of arm.

Quoted 6 lines

Patch 2 is to fix a build failure when I tested patch 1 on x86_64, the wrong CONFIG_KEXEC iddeffery is replaced with CONFIG_KEXEC_CORE. Test passed on x86_64.

Patch 3 is to fix an unnecessary 'select KEXEC' in s390 ARCH. Removing the select won't impact anything. Test passed on a ibm-z system.

I apologize for my delay in responding, I did not have a computer with me during my holiday travel.

I was able to re-run my Kconfig test script with this patch series (now that I'm running this on private resources, it takes half a day 8( ). The script only performs comparisons of the .config before (LHSB) and after (RHSB) the patch series; it does NOT do any building. At any rate, what that revealed was only differences in s390. That means that all other arches do not have any unintended side effects. The differences with patch3 applied look like:

FAIL: allnoconfig arch/s390/configs/kasan.config
LHSB {'CONFIG_CRASH_CORE': 'y', 'CONFIG_KEXEC_CORE': 'y', 'CONFIG_KEXEC':
'y'}
RHSB {'CONFIG_KEXEC': 'n'}

Quoted 6 lines

The 'allnoconfig' and 'olddefconfig' targets failed for all s390 defconfigs. The LHSB is the pre-patch values, and the RHSB is the post-patch values. So this states that CRASH_CORE and KEXEC_CORE were set previously, but now they are not. KEXEC obviously is being turned off intentionally.

Hope this helps some.

Thanks, Eric. Alexander has pointed out this in patch 3 reviewing comment. I misunderstood the select KEXEC in s390 arch where they intend to do. As I replied to Alexander, I will drop patch 3.

Quoted 14 lines
Quoted 13 lines

Baoquan He (3):
kernel/Kconfig.kexec: drop select of KEXEC for CRASH_DUMP drivers/base/cpu: crash data showing should depends on KEXEC_CORE s390/Kconfig: drop select of KEXEC

  arch/arm/include/asm/kexec.h | 4 ----
  arch/s390/Kconfig            | 1 -
  drivers/base/cpu.c           | 6 +++---
  kernel/Kconfig.kexec         | 1 -
  4 files changed, 3 insertions(+), 9 deletions(-)