Skip to contentSkip to conversation

x86/purgatory: Fix Makefile bug

PATCH Applied Philipp Rudo 2 participants 6 messages Jul 4, 2018 – Jul 6, 2018

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

cover x86/purgatory: Fix Makefile bug

Hi everybody,

when i moved the purgatories sha256 implementation to common code, i forgot to add FORCE to the new Makefile target. This patch fixes it.

Note: There is an equivalent bug in the s390 purgatory. The fix for that will go upstream via Martin.

Thanks
Philipp

Philipp Rudo (1):
x86/purgatory: Add missing FORCE to Makefile target

 arch/x86/purgatory/Makefile | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
Signature · 7 lines
2.16.4


_______________________________________________
kexec mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/kexec
#1 lore raw

PATCH 1/1 x86/purgatory: Add missing FORCE to Makefile target

Without FORCE make does not detect changes only made to the command line options. So object files might not be re-built even when they should be. Fix this by adding FORCE where it is missing.

Fixes df6f2801f511 ("kernel/kexec_file.c: move purgatories sha256 to common code")
Cc <[email protected]> # 4.17
---
 arch/x86/purgatory/Makefile | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
arch/x86/purgatory/Makefile +1 -1
index 2e9ee023e6bc..81a8e33115ad 100644
@@ -6,7 +6,7 @@ purgatory-y := purgatory.o stack.o setup-x86_$(BITS).o sha256.o entry64.o string
 targets += $(purgatory-y)
 PURGATORY_OBJS = $(addprefix $(obj)/,$(purgatory-y))
 
-$(obj)/sha256.o: $(srctree)/lib/sha256.c
+$(obj)/sha256.o: $(srctree)/lib/sha256.c FORCE
 	$(call if_changed_rule,cc_o_c)
 
 LDFLAGS_purgatory.ro := -e purgatory_start -r --no-undefined -nostdlib -z nodefaultlib
Signature · 7 lines
2.16.4


_______________________________________________
kexec mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/kexec
#2 lore raw
In reply to Philipp Rudo
Quoted 4 lines · Philipp Rudo

Hi everybody,

when i moved the purgatories sha256 implementation to common code, i forgot to add FORCE to the new Makefile target. This patch fixes it.

Hi Philipp,

Do you have the exact steps of how to reproduce your problem?

Quoted 4 lines

Note: There is an equivalent bug in the s390 purgatory. The fix for that will go upstream via Martin.

Quoted 12 lines

Thanks
Philipp

Philipp Rudo (1):
x86/purgatory: Add missing FORCE to Makefile target

 arch/x86/purgatory/Makefile | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
Signature · 1 line
2.16.4

Thanks
Dave

_______________________________________________
kexec mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/kexec

#3 lore raw

Hi Dave,

Quoted 9 lines · On Thu, 5 Jul 2018 14:46:20 +0800 Dave Young <[email protected]> wrote:
Quoted 4 lines · Philipp Rudo

Hi everybody,

when i moved the purgatories sha256 implementation to common code, i forgot to add FORCE to the new Makefile target. This patch fixes it.

Hi Philipp,

Do you have the exact steps of how to reproduce your problem?

I only tested it on s390, but on x86 it should work the same way.

- Build the kernel without the fix
- Add some flag to the purgatories KBUILD_CFLAGS,I used -fno-asynchronous-unwind-tables
- Re-build the kernel

When you look at make's output you see that sha256.o is not re-build in the last step. Also readelf -S still shows the .eh_frame section for sha256.o.

With the fix sha256.o is re-build in the last step.

Hope that helps.

Thanks
Philipp

Quoted 13 lines
Quoted 13 lines

Note: There is an equivalent bug in the s390 purgatory. The fix for that will go upstream via Martin.

Thanks
Philipp

Philipp Rudo (1):
x86/purgatory: Add missing FORCE to Makefile target

 arch/x86/purgatory/Makefile | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
Quoted 7 lines
Quoted 3 lines
Signature · 1 line
2.16.4

Thanks
Dave

_______________________________________________
kexec mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/kexec

Acked-by
#4 lore raw

Hi Philipp,

Quoted 22 lines · Philipp Rudo

Hi Dave,

Quoted 9 lines · On Thu, 5 Jul 2018 14:46:20 +0800 Dave Young <[email protected]> wrote:
Quoted 4 lines · Philipp Rudo

Hi everybody,

when i moved the purgatories sha256 implementation to common code, i forgot to add FORCE to the new Makefile target. This patch fixes it.

Hi Philipp,

Do you have the exact steps of how to reproduce your problem?

I only tested it on s390, but on x86 it should work the same way.

- Build the kernel without the fix
- Add some flag to the purgatories KBUILD_CFLAGS,I used -fno-asynchronous-unwind-tables
- Re-build the kernel

Quoted 6 lines

When you look at make's output you see that sha256.o is not re-build in the last step. Also readelf -S still shows the .eh_frame section for sha256.o.

With the fix sha256.o is re-build in the last step.

Hope that helps.

Thanks for explanation.

For the patch:

Thanks
Dave

_______________________________________________
kexec mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/kexec

#5 lore raw

Hi Andrew,

can you send this fix to Linus like the original patch?

Can you also tell me if the bug is severe enough to go to stable? For productive systems the bug shouldn't cause any problem because they are usually build from scratch. For developers however, it can cause quite a pain while debugging.

@Dave: Thanks for looking into this.

Thanks
Philipp

Quoted 32 lines · On Fri, 6 Jul 2018 16:30:29 +0800 Dave Young <[email protected]> wrote:

Hi Philipp,

Quoted 22 lines · Philipp Rudo

Hi Dave,

Quoted 9 lines · On Thu, 5 Jul 2018 14:46:20 +0800 Dave Young <[email protected]> wrote:
Quoted 4 lines · Philipp Rudo

Hi everybody,

when i moved the purgatories sha256 implementation to common code, i forgot to add FORCE to the new Makefile target. This patch fixes it.

Hi Philipp,

Do you have the exact steps of how to reproduce your problem?

I only tested it on s390, but on x86 it should work the same way.

- Build the kernel without the fix
- Add some flag to the purgatories KBUILD_CFLAGS,I used -fno-asynchronous-unwind-tables
- Re-build the kernel

Quoted 6 lines

When you look at make's output you see that sha256.o is not re-build in the last step. Also readelf -S still shows the .eh_frame section for sha256.o.

With the fix sha256.o is re-build in the last step.

Hope that helps.

Quoted 8 lines

Thanks for explanation.

For the patch:

Thanks
Dave

_______________________________________________
kexec mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/kexec