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

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


  • To: Jan Beulich <JBeulich@xxxxxxxx>
  • From: Roger Pau Monné <roger.pau@xxxxxxxxxx>
  • Date: Wed, 19 Jun 2019 16:40:20 +0200
  • Authentication-results: esa6.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: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>, WeiLiu <wl@xxxxxxx>, xen-devel <xen-devel@xxxxxxxxxxxxxxxxxxxx>
  • Delivery-date: Wed, 19 Jun 2019 14:40:34 +0000
  • Ironport-sdr: Yd2jccaywLzRUe9SwB+R0D3/6yugpu02r3/yCFjr+EMVd6C03loFV655KPQtMrBsozUmCra5uH l249P1OHGTGrBNEXQyBJZIJMCqbWcmieUsDc4TaahQaTwryUipItAB+86dcpWZ94VDeylp+Il4 bInPcLoGJBaLKERTchf8EQd1Lmo+4kKi7tYl/QTcHUa2qoce89Y0YgTRXeMk5s5RTa9Z0Gj+wk KJI9BS+nWUi9TMC3M5swlPZmEtTtG0jfbFIC/egrtXDNDtnYhj25a65ouD77aSmHf9n7P8j2DH 6ZA=
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

On Wed, Jun 19, 2019 at 07:08:52AM -0600, Jan Beulich wrote:
> >>> On 19.06.19 at 13:02, <roger.pau@xxxxxxxxxx> wrote:
> > After building the hypervisor binary. Note that the check is performed
> > by searching for the magic header value at the start of the binary.
> > 
> > Signed-off-by: Roger Pau Monné <roger.pau@xxxxxxxxxx>
> > ---
> > Cc: Jan Beulich <jbeulich@xxxxxxxx>
> > Cc: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>
> > Cc: Wei Liu <wl@xxxxxxx>
> > ---
> >  xen/arch/x86/Makefile | 3 +++
> >  1 file changed, 3 insertions(+)
> > 
> > diff --git a/xen/arch/x86/Makefile b/xen/arch/x86/Makefile
> > index 8a8d8f060f..9bb3bf6e6c 100644
> > --- a/xen/arch/x86/Makefile
> > +++ b/xen/arch/x86/Makefile
> > @@ -102,6 +102,9 @@ 
> > syms-warn-dup-$(CONFIG_SUPPRESS_DUPLICATE_SYMBOL_WARNINGS) :=
> >  $(TARGET): $(TARGET)-syms $(efi-y) boot/mkelf32
> >     ./boot/mkelf32 $(notes_phdrs) $(TARGET)-syms $(TARGET) 
> > $(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 $(TARGET) | grep 1badb002 > /dev/null
> > +   od -t x4 -N 32768 $(TARGET) | grep e85250d6 > /dev/null
> 
> What's the behavior when a signature is _not _ found? Will
> $(TARGET) get deleted (by make)? I don't think it would (as we
> don't specific .DELETE_ON_ERROR anywhere), so a subsequent
> rebuild may not even execute this rule, and hence may look to be
> successful despite it not actually having been.

Oh, right. It should be:

od -t x4 -N 8192 $(TARGET) | grep 1badb002 > /dev/null || (rm -rf $(TARGET); 
exit 1)
od -t x4 -N 32768 $(TARGET) | grep e85250d6 > /dev/null || (rm -rf $(TARGET); 
exit 1)

Would you be OK with the above runes?

Thanks, 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®.