From mboxrd@z Thu Jan 1 00:00:00 1970 From: Ross Lagerwall Subject: Re: [PATCH v2 2/3] XENVER_build_id: Provide ld-embedded build-ids Date: Mon, 9 Nov 2015 17:26:25 +0000 Message-ID: <5640D741.9000503@citrix.com> References: <1446838577-7563-1-git-send-email-konrad.wilk@oracle.com> <1446838577-7563-3-git-send-email-konrad.wilk@oracle.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii"; Format="flowed" Content-Transfer-Encoding: 7bit Return-path: Received: from mail6.bemta3.messagelabs.com ([195.245.230.39]) by lists.xen.org with esmtp (Exim 4.72) (envelope-from ) id 1ZvqD9-0007Yo-CY for xen-devel@lists.xenproject.org; Mon, 09 Nov 2015 17:26:31 +0000 In-Reply-To: <1446838577-7563-3-git-send-email-konrad.wilk@oracle.com> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: Konrad Rzeszutek Wilk , JBeulich@suse.com, mpohlack@amazon.de, andrew.cooper3@citrix.com, ian.campbell@citrix.com, wei.liu2@citrix.com, ian.jackson@eu.citrix.com, xen-devel@lists.xenproject.org, dgdegra@tycho.nsa.gov List-Id: xen-devel@lists.xenproject.org On 11/06/2015 07:36 PM, Konrad Rzeszutek Wilk wrote: > From: Martin Pohlack > > The mechanism to get this is via the XENVER_build_id and > we add a new subsequent sub-command to retrieve the > binary build-id. The hypercall allows an arbitrary > size (the buffer and len is provided to the hypervisor). > > Note that one can also retrieve the value by 'readelf -h xen-syms'. > > For EFI builds we re-use the same build-id that the xen-syms > was built with. > > Note that there are no changes to the XSM files (dummy.c > and hooks.c) as the priviliged subops fall in the default case. > > Since the new sub-ops provides the len parameter in the > arguments to the hypercall we have to modify libxc to allow > copying the arguments before the hypercall. We provide a > new macro that modifies the bounce structure to change > the direction. > snip > diff --git a/xen/arch/x86/Makefile b/xen/arch/x86/Makefile > index d4e507a..17a4830 100644 > --- a/xen/arch/x86/Makefile > +++ b/xen/arch/x86/Makefile > @@ -109,15 +109,19 @@ $(TARGET)-syms: prelink.o xen.lds $(BASEDIR)/common/symbols-dummy.o The above invocation of ld also needs to pass "--build-id=sha1". Otherwise, the first invocation of tools/symbols has __note_gnu_build_id_end == __note_gnu_build_id_start, which may cause the size of the symbol table to change later when there is actually a build id (presumably due to the way it is compressed?) ultimately resulting in incorrect values in the symbol table. > $(NM) -pa --format=sysv $(@D)/.$(@F).0 \ > | $(BASEDIR)/tools/symbols --sysv --sort >$(@D)/.$(@F).0.S > $(MAKE) -f $(BASEDIR)/Rules.mk $(@D)/.$(@F).0.o > - $(LD) $(LDFLAGS) -T xen.lds -N prelink.o \ > + $(LD) $(LDFLAGS) -T xen.lds -N prelink.o --build-id=sha1 \ > $(@D)/.$(@F).0.o -o $(@D)/.$(@F).1 > $(NM) -pa --format=sysv $(@D)/.$(@F).1 \ > | $(BASEDIR)/tools/symbols --sysv --sort --warn-dup >$(@D)/.$(@F).1.S > $(MAKE) -f $(BASEDIR)/Rules.mk $(@D)/.$(@F).1.o > - $(LD) $(LDFLAGS) -T xen.lds -N prelink.o \ > + $(LD) $(LDFLAGS) -T xen.lds -N prelink.o --build-id=sha1 \ > $(@D)/.$(@F).1.o -o $@ > rm -f $(@D)/.$(@F).[0-9]* > -- Ross Lagerwall