[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Xen-devel] [PATCH v3 3/3] x86: check for multiboot{1, 2} header presence


  • To: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>
  • From: Roger Pau Monné <roger.pau@xxxxxxxxxx>
  • Date: Thu, 27 Jun 2019 15:08:46 +0200
  • Authentication-results: esa2.hc3370-68.iphmx.com; dkim=none (message not signed) header.i=none; spf=None smtp.pra=roger.pau@xxxxxxxxxx; spf=Pass smtp.mailfrom=roger.pau@xxxxxxxxxx; spf=None smtp.helo=postmaster@xxxxxxxxxxxxxxx
  • Cc: xen-devel@xxxxxxxxxxxxxxxxxxxx, Wei Liu <wl@xxxxxxx>, Jan Beulich <jbeulich@xxxxxxxx>
  • Delivery-date: Thu, 27 Jun 2019 13:09:15 +0000
  • Ironport-sdr: dQyezhxtpN+vrPlnNNyou01y0Jyt+CGVd8HcM3He6YR0TubwAI0xYrnWrAY2OrcD5KmsiXDMNs vECEt4SB70kfNqre9Sdx2+CZUpkcc4pG8eAC9JGm34hxixP8s0WtQeTdtRPQG6JTIaAddddFgd 15tsEmA7OFwI70o/A3kZfN/OZFJYvLnUnl85RjJS4jhQZ2lrK7r7JfFx0EFys3jwrV56Tez9Sg 1pgJic5NIK54pXc+akUvFD3k85HC/nkKChxhQqOCWtwHHXbFjxxvp2+BkmSUasuvF+0yVC4qvn xKc=
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

On Thu, Jun 27, 2019 at 12:51:05PM +0100, Andrew Cooper wrote:
> On 27/06/2019 10:33, Roger Pau Monne wrote:
> > diff --git a/xen/arch/x86/Makefile b/xen/arch/x86/Makefile
> > index 8a8d8f060f..94e6c9aee3 100644
> > --- a/xen/arch/x86/Makefile
> > +++ b/xen/arch/x86/Makefile
> > @@ -99,9 +99,14 @@ endif
> >  syms-warn-dup-y := --warn-dup
> >  syms-warn-dup-$(CONFIG_SUPPRESS_DUPLICATE_SYMBOL_WARNINGS) :=
> >  
> > +$(TARGET): TMP = $(@D)/.$(@F)
> 
> I'd suggest giving this a .elf32 suffix to make it clear which pass of
> the build it comes from.

That's fine, please also adjust the ignored list and the clean
target.

> >  $(TARGET): $(TARGET)-syms $(efi-y) boot/mkelf32
> > -   ./boot/mkelf32 $(notes_phdrs) $(TARGET)-syms $(TARGET) 
> > $(XEN_IMG_OFFSET) \
> > +   ./boot/mkelf32 $(notes_phdrs) $(TARGET)-syms $(TMP) $(XEN_IMG_OFFSET) \
> >                    `$(NM) $(TARGET)-syms | sed -ne 's/^\([^ ]*\) . 
> > __2M_rwdata_end$$/0x\1/p'`
> > +   # Check for multiboot{1,2} headers
> > +   od -t x4 -N 8192 $(TMP) | grep 1badb002 > /dev/null ||
> > +   od -t x4 -N 32768 $(TMP) | grep e85250d6 > /dev/null
> 
> This works, but
> 
> Makefile:104: recipe for target '/local/xen.git/xen/xen' failed
> 
> Isn't helpful to identify what went wrong.  Sadly, we can't use $(error
> ...) in a shell snippet, but:
> 
> andrewcoop@andrewcoop:/local/xen.git/xen$ git d
> diff --git a/xen/arch/x86/Makefile b/xen/arch/x86/Makefile
> index 94e6c9aee3..a1d6605a8b 100644
> --- a/xen/arch/x86/Makefile
> +++ b/xen/arch/x86/Makefile
> @@ -99,13 +99,14 @@ endif
>  syms-warn-dup-y := --warn-dup
>  syms-warn-dup-$(CONFIG_SUPPRESS_DUPLICATE_SYMBOL_WARNINGS) :=
>  
> -$(TARGET): TMP = $(@D)/.$(@F)
> +$(TARGET): TMP = $(@D)/.$(@F).elf32
>  $(TARGET): $(TARGET)-syms $(efi-y) boot/mkelf32
>         ./boot/mkelf32 $(notes_phdrs) $(TARGET)-syms $(TMP) $(XEN_IMG_OFFSET) 
> \
>                        `$(NM) $(TARGET)-syms | sed -ne 's/^\([^ ]*\) . 
> __2M_rwdata_end$$/0x\1/p'`
> -       # Check for multiboot{1,2} headers
> -       od -t x4 -N 8192 $(TMP) | grep 1badb002 > /dev/null
> -       od -t x4 -N 32768 $(TMP) | grep e85250d6 > /dev/null
> +       od -t x4 -N 8192 $(TMP)  | grep 1badb002 > /dev/null || \
> +               { echo "No Multiboot1 header found"; false; }
> +       od -t x4 -N 32768 $(TMP) | grep e85250d6 > /dev/null || \
> +               { echo "No Multiboot2 header found"; false; }
>         mv $(TMP) $(TARGET)
>  
>  ALL_OBJS := $(BASEDIR)/arch/x86/boot/built_in.o 
> $(BASEDIR)/arch/x86/efi/built_in.o $(ALL_OBJS)
> 
> results in:
> 
> No Multiboot1 header found
> Makefile:104: recipe for target '/local/xen.git/xen/xen' failed
> make[2]: *** [/local/xen.git/xen/xen] Error 1
> Makefile:136: recipe for target '/local/xen.git/xen/xen' failed
> make[1]: *** [/local/xen.git/xen/xen] Error 2
> Makefile:45: recipe for target 'build' failed
> make: *** [build] Error 2
> 
> Which is far more clear.
> 
> Thoughts?

Thanks, is indeed better. I also agree with Jan on the
redirection to stderr.

Roger.

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

 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.