Skip to contentSkip to conversation

x86/boot: Fix build dependenices for reloc.c

PATCH In review Andrew Cooper 4 participants 7 messages Jul 30, 2019 – Jul 31, 2019

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 x86/boot: Fix build dependenices for reloc.c

c/s 201f852eaf added start_info.h and kconfig.h to reloc.c, but only updated start_info.h in RELOC_DEPS.

This causes reloc.c to not be regenerated when Kconfig changes. It is most noticeable when enabling CONFIG_PVH and finding the resulting binary crash early with:

(d9) (XEN)
(d9) (XEN) **************************************** (d9) (XEN) Panic on CPU 0:
(d9) (XEN) Magic value is wrong: c2c2c2c2
(d9) (XEN) **************************************** (d9) (XEN)
(d9) (XEN) Reboot in five seconds...
(XEN) d9v0 Triple fault - invoking HVM shutdown action 1

---
CC: Jan Beulich <[email protected]>
CC: Wei Liu <[email protected]>
CC: Roger Pau Monné <[email protected]>
CC: Paul Durrant <[email protected]>

---
 xen/arch/x86/boot/Makefile | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)
xen/arch/x86/boot/Makefile +4 -1
index e10388282f..9b31bfcbfb 100644
@@ -4,7 +4,10 @@ DEFS_H_DEPS = defs.h $(BASEDIR)/include/xen/stdbool.h
 
 CMDLINE_DEPS = $(DEFS_H_DEPS) video.h
 
-RELOC_DEPS = $(DEFS_H_DEPS) $(BASEDIR)/include/xen/multiboot.h \
+RELOC_DEPS = $(DEFS_H_DEPS) \
+	     $(BASEDIR)/include/generated/autoconf.h \
+	     $(BASEDIR)/include/xen/kconfig.h \
+	     $(BASEDIR)/include/xen/multiboot.h \
 	     $(BASEDIR)/include/xen/multiboot2.h \
 	     $(BASEDIR)/include/public/arch-x86/hvm/start_info.h
 
Signature · 7 lines
2.11.0


_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xenproject.org/mailman/listinfo/xen-devel
Reviewed-by on v1 1/1
#1 lore raw
Quoted 16 lines · Andrew Cooper

c/s 201f852eaf added start_info.h and kconfig.h to reloc.c, but only updated start_info.h in RELOC_DEPS.

This causes reloc.c to not be regenerated when Kconfig changes. It is most noticeable when enabling CONFIG_PVH and finding the resulting binary crash early with:

(d9) (XEN)
(d9) (XEN) **************************************** (d9) (XEN) Panic on CPU 0:
(d9) (XEN) Magic value is wrong: c2c2c2c2
(d9) (XEN) **************************************** (d9) (XEN)
(d9) (XEN) Reboot in five seconds...
(XEN) d9v0 Triple fault - invoking HVM shutdown action 1

Quoted 2 lines

Note sure if it's worth spelling out that multiboot.h dependency was also missing.

Thanks, Roger.

_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xenproject.org/mailman/listinfo/xen-devel

#2 lore raw
Quoted 17 lines · Roger Pau Monné
Quoted 16 lines · Andrew Cooper

c/s 201f852eaf added start_info.h and kconfig.h to reloc.c, but only updated start_info.h in RELOC_DEPS.

This causes reloc.c to not be regenerated when Kconfig changes. It is most noticeable when enabling CONFIG_PVH and finding the resulting binary crash early with:

(d9) (XEN)
(d9) (XEN) **************************************** (d9) (XEN) Panic on CPU 0:
(d9) (XEN) Magic value is wrong: c2c2c2c2
(d9) (XEN) **************************************** (d9) (XEN)
(d9) (XEN) Reboot in five seconds...
(XEN) d9v0 Triple fault - invoking HVM shutdown action 1

Quoted 3 lines
Quoted 2 lines

:) I can use that tag if you'd like.

Quoted 3 lines

Note sure if it's worth spelling out that multiboot.h dependency was also missing.

The delta to multiboot.h was a consequence of reformatting.  It was present before.

~Andrew

_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xenproject.org/mailman/listinfo/xen-devel

Reviewed-by
#3 lore raw
Quoted 18 lines · Andrew Cooper
Quoted 17 lines · Roger Pau Monné
Quoted 16 lines · Andrew Cooper

c/s 201f852eaf added start_info.h and kconfig.h to reloc.c, but only updated start_info.h in RELOC_DEPS.

This causes reloc.c to not be regenerated when Kconfig changes. It is most noticeable when enabling CONFIG_PVH and finding the resulting binary crash early with:

(d9) (XEN)
(d9) (XEN) **************************************** (d9) (XEN) Panic on CPU 0:
(d9) (XEN) Magic value is wrong: c2c2c2c2
(d9) (XEN) **************************************** (d9) (XEN)
(d9) (XEN) Reboot in five seconds...
(XEN) d9v0 Triple fault - invoking HVM shutdown action 1

Quoted 5 lines
Quoted 3 lines
Quoted 2 lines

:) I can use that tag if you'd like.

Ouch, I think it doesn't really matter because the dots are actually stripped, so it all ends up at rogerpau@. In any case:

Quoted 6 lines
Quoted 3 lines

Note sure if it's worth spelling out that multiboot.h dependency was also missing.

The delta to multiboot.h was a consequence of reformatting.  It was present before.

Arg, yes, didn't pay enough attention.

Thanks, Roger.

_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xenproject.org/mailman/listinfo/xen-devel

#4 lore raw
In reply to Andrew Cooper
Quoted 8 lines · Andrew Cooper

c/s 201f852eaf added start_info.h and kconfig.h to reloc.c, but only updated start_info.h in RELOC_DEPS.

This causes reloc.c to not be regenerated when Kconfig changes. It is most noticeable when enabling CONFIG_PVH and finding the resulting binary crash early with:

Quoted 9 lines

(d9) (XEN)
(d9) (XEN) **************************************** (d9) (XEN) Panic on CPU 0:
(d9) (XEN) Magic value is wrong: c2c2c2c2
(d9) (XEN) **************************************** (d9) (XEN)
(d9) (XEN) Reboot in five seconds...
(XEN) d9v0 Triple fault - invoking HVM shutdown action 1

Nice. I saw this before but never got around fixing it. Thanks for tracking it down. :-)

Wei.

_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xenproject.org/mailman/listinfo/xen-devel

#5 lore raw
Quoted 17 lines · Wei Liu
Quoted 7 lines · Andrew Cooper

c/s 201f852eaf added start_info.h and kconfig.h to reloc.c, but only updated start_info.h in RELOC_DEPS.

This causes reloc.c to not be regenerated when Kconfig changes. It is most noticeable when enabling CONFIG_PVH and finding the resulting binary crash early with:

Quoted 9 lines

(d9) (XEN)
(d9) (XEN) **************************************** (d9) (XEN) Panic on CPU 0:
(d9) (XEN) Magic value is wrong: c2c2c2c2
(d9) (XEN) **************************************** (d9) (XEN)
(d9) (XEN) Reboot in five seconds...
(XEN) d9v0 Triple fault - invoking HVM shutdown action 1

Quoted 2 lines

Nice. I saw this before but never got around fixing it. Thanks for tracking it down. :-)

It has been bugging me for ages, and yet still took Paul stumbling over it to wonder "how hard would this to be to figure out properly?".  The answer is 10s to identify the likely cause, and far longer than that to debug the dependency tracking part.

This bit of the build system is nasty.  David Woodhouse had an idea of how to drop it all, so with any luck, it isn't going to survive long.

~Andrew

_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xenproject.org/mailman/listinfo/xen-devel

Acked-by on v1 1/1
#6 lore raw
In reply to Andrew Cooper
Quoted 16 lines · Andrew Cooper

c/s 201f852eaf added start_info.h and kconfig.h to reloc.c, but only updated start_info.h in RELOC_DEPS.

This causes reloc.c to not be regenerated when Kconfig changes. It is most noticeable when enabling CONFIG_PVH and finding the resulting binary crash early with:

   (d9) (XEN)
   (d9) (XEN) ****************************************
   (d9) (XEN) Panic on CPU 0:
   (d9) (XEN) Magic value is wrong: c2c2c2c2
   (d9) (XEN) ****************************************
   (d9) (XEN)
   (d9) (XEN) Reboot in five seconds...
   (XEN) d9v0 Triple fault - invoking HVM shutdown action 1
Quoted 2 lines

_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xenproject.org/mailman/listinfo/xen-devel