[Xen-devel] [PATCH] x86/boot: Fix build dependenices for reloc.c

Andrew Cooper posted 1 patch 4 years, 8 months ago
Patches applied successfully (tree, apply log)
git fetch https://github.com/patchew-project/xen tags/patchew/20190730170754.31389-1-andrew.cooper3@citrix.com
xen/arch/x86/boot/Makefile | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
[Xen-devel] [PATCH] x86/boot: Fix build dependenices for reloc.c
Posted by Andrew Cooper 4 years, 8 months ago
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(-)

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
 
-- 
2.11.0


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xenproject.org
https://lists.xenproject.org/mailman/listinfo/xen-devel
Re: [Xen-devel] [PATCH] x86/boot: Fix build dependenices for reloc.c
Posted by Roger Pau Monné 4 years, 8 months ago
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.

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xenproject.org
https://lists.xenproject.org/mailman/listinfo/xen-devel
Re: [Xen-devel] [PATCH] x86/boot: Fix build dependenices for reloc.c
Posted by Andrew Cooper 4 years, 8 months ago
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

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xenproject.org
https://lists.xenproject.org/mailman/listinfo/xen-devel
Re: [Xen-devel] [PATCH] x86/boot: Fix build dependenices for reloc.c
Posted by Roger Pau Monné 4 years, 8 months ago
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.

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xenproject.org
https://lists.xenproject.org/mailman/listinfo/xen-devel
Re: [Xen-devel] [PATCH] x86/boot: Fix build dependenices for reloc.c
Posted by Jan Beulich 4 years, 8 months ago
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>
_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xenproject.org
https://lists.xenproject.org/mailman/listinfo/xen-devel
Re: [Xen-devel] [PATCH] x86/boot: Fix build dependenices for reloc.c
Posted by Wei Liu 4 years, 8 months ago
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.

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xenproject.org
https://lists.xenproject.org/mailman/listinfo/xen-devel
Re: [Xen-devel] [PATCH] x86/boot: Fix build dependenices for reloc.c
Posted by Andrew Cooper 4 years, 8 months ago
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

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xenproject.org
https://lists.xenproject.org/mailman/listinfo/xen-devel