diff mbox series

x86/boot: Fix build dependenices for reloc.c

Message ID 20190730170754.31389-1-andrew.cooper3@citrix.com (mailing list archive)
State New, archived
Headers show
Series x86/boot: Fix build dependenices for reloc.c | expand

Commit Message

Andrew Cooper July 30, 2019, 5:07 p.m. UTC
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

Reported-by: Paul Durrant <paul.durrant@citrix.com>
Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
---
CC: Jan Beulich <JBeulich@suse.com>
CC: Wei Liu <wl@xen.org>
CC: Roger Pau Monné <roger.pau@citrix.com>
CC: Paul Durrant <paul.durrant@citrix.com>
---
 xen/arch/x86/boot/Makefile | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

Comments

Roger Pau Monné July 31, 2019, 8:47 a.m. UTC | #1
On Tue, Jul 30, 2019 at 06:07:54PM +0100, Andrew Cooper wrote:
> 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
> 
> Reported-by: Paul Durrant <paul.durrant@citrix.com>
> Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>

Reviewed-by: Roger Pau Monné <roge.rpau@citrix.com>

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

Thanks, Roger.
Andrew Cooper July 31, 2019, 9:57 a.m. UTC | #2
On 31/07/2019 09:47, Roger Pau Monné wrote:
> On Tue, Jul 30, 2019 at 06:07:54PM +0100, Andrew Cooper wrote:
>> 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
>>
>> Reported-by: Paul Durrant <paul.durrant@citrix.com>
>> Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
> Reviewed-by: Roger Pau Monné <roge.rpau@citrix.com>

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

>
> 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
Wei Liu July 31, 2019, 10:38 a.m. UTC | #3
On Tue, 30 Jul 2019 at 18:08, Andrew Cooper <andrew.cooper3@citrix.com> wrote:
>
> 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
>

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

Wei.
Andrew Cooper July 31, 2019, 10:53 a.m. UTC | #4
On 31/07/2019 11:38, Wei Liu wrote:
> On Tue, 30 Jul 2019 at 18:08, Andrew Cooper <andrew.cooper3@citrix.com> wrote:
>> 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
>>
> 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
Roger Pau Monné July 31, 2019, 10:57 a.m. UTC | #5
On Wed, Jul 31, 2019 at 10:57:36AM +0100, Andrew Cooper wrote:
> On 31/07/2019 09:47, Roger Pau Monné wrote:
> > On Tue, Jul 30, 2019 at 06:07:54PM +0100, Andrew Cooper wrote:
> >> 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
> >>
> >> Reported-by: Paul Durrant <paul.durrant@citrix.com>
> >> Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
> > Reviewed-by: Roger Pau Monné <roge.rpau@citrix.com>
> 
> :) 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:

Reviewed-by: Roger Pau Monné <roger.pau@citrix.com>

> >
> > 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.
Jan Beulich July 31, 2019, 11 a.m. UTC | #6
On 30.07.2019 19:07, Andrew Cooper wrote:
> 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
> 
> Reported-by: Paul Durrant <paul.durrant@citrix.com>
> Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>

Acked-by: Jan Beulich <jbeulich@suse.com>
diff mbox series

Patch

diff --git a/xen/arch/x86/boot/Makefile b/xen/arch/x86/boot/Makefile
index e10388282f..9b31bfcbfb 100644
--- a/xen/arch/x86/boot/Makefile
+++ b/xen/arch/x86/boot/Makefile
@@ -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