Skip to contentSkip to conversation

riscv, kexec: fix the ifdeffery for AFLAGS_kexec_relocate.o

PATCH Applied Baoquan He 2 participants 3 messages Dec 1, 2023 – Jan 20, 2024

Subsystems (3)
lore
Share & tools
lore

Baoquan He

author
#0 lore raw

PATCH 1/1 riscv, kexec: fix the ifdeffery for AFLAGS_kexec_relocate.o

This was introduced in commit fba8a8674f68 ("RISC-V: Add kexec support").

It should work on CONFIG_KEXEC_CORE, but not CONFIG_KEXEC only, since we could set CONFIG_KEXEC_FILE=y and CONFIG_KEXEC=N, or only set CONFIG_CRASH_DUMP=y and disable both CONFIG_KEXEC and CONFIG_KEXEC_FILE. In these cases, the AFLAGS won't take effect with the current ifdeffery for AFLAGS_kexec_relocate.o.

So fix it now.

---
 arch/riscv/kernel/Makefile | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
arch/riscv/kernel/Makefile +1 -1
index fee22a3d1b53..82940b6a79a2 100644
@@ -11,7 +11,7 @@ endif
 CFLAGS_syscall_table.o	+= $(call cc-option,-Wno-override-init,)
 CFLAGS_compat_syscall_table.o += $(call cc-option,-Wno-override-init,)
 
-ifdef CONFIG_KEXEC
+ifdef CONFIG_KEXEC_CORE
 AFLAGS_kexec_relocate.o := -mcmodel=medany $(call cc-option,-mno-relax)
 endif
 
Signature · 1 line
2.41.0
author
#1 lore raw

CC Andrew.

Quoted 9 lines · Baoquan He

This was introduced in commit fba8a8674f68 ("RISC-V: Add kexec support").

It should work on CONFIG_KEXEC_CORE, but not CONFIG_KEXEC only, since we could set CONFIG_KEXEC_FILE=y and CONFIG_KEXEC=N, or only set CONFIG_CRASH_DUMP=y and disable both CONFIG_KEXEC and CONFIG_KEXEC_FILE. In these cases, the AFLAGS won't take effect with the current ifdeffery for AFLAGS_kexec_relocate.o.

Quoted 6 lines

So fix it now.

---
 arch/riscv/kernel/Makefile | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Hi RISC-V people,

I didn't test this, while believe this need be fixed. Please help check if this is necessary.

Thanks
Baoquan

Quoted 17 lines
arch/riscv/kernel/Makefile +1 -1
index fee22a3d1b53..82940b6a79a2 100644
@@ -11,7 +11,7 @@ endif
 CFLAGS_syscall_table.o	+= $(call cc-option,-Wno-override-init,)
 CFLAGS_compat_syscall_table.o += $(call cc-option,-Wno-override-init,)
 
-ifdef CONFIG_KEXEC
+ifdef CONFIG_KEXEC_CORE
 AFLAGS_kexec_relocate.o := -mcmodel=medany $(call cc-option,-mno-relax)
 endif
 
Signature · 1 line
2.41.0
#2 lore raw
In reply to Baoquan He
This patch was applied to riscv/linux.git (fixes) by Andrew Morton <[email protected]>:

Hello:

This patch was applied to riscv/linux.git (fixes)
by Andrew Morton <[email protected]>:

Quoted 10 lines · On Fri, 1 Dec 2023 14:25:38 +0800 you wrote:

This was introduced in commit fba8a8674f68 ("RISC-V: Add kexec support").

It should work on CONFIG_KEXEC_CORE, but not CONFIG_KEXEC only, since we could set CONFIG_KEXEC_FILE=y and CONFIG_KEXEC=N, or only set CONFIG_CRASH_DUMP=y and disable both CONFIG_KEXEC and CONFIG_KEXEC_FILE. In these cases, the AFLAGS won't take effect with the current ifdeffery for AFLAGS_kexec_relocate.o.

[...]

Here is the summary with links:
- riscv, kexec: fix the ifdeffery for AFLAGS_kexec_relocate.o

    https://git.kernel.org/riscv/c/d53a154cdc54

You are awesome, thank you!

Signature · 2 lines
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html