From mboxrd@z Thu Jan 1 00:00:00 1970 From: Ross Lagerwall Subject: Re: [PATCH v3 08/23] x86/xen_hello_world.xsplice: Test payload for patching 'xen_extra_version'. (v2) Date: Tue, 16 Feb 2016 11:31:50 +0000 Message-ID: <56C308A6.3010300@citrix.com> References: <1455300361-13092-1-git-send-email-konrad.wilk@oracle.com> <1455300361-13092-9-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.bemta14.messagelabs.com ([193.109.254.103]) by lists.xen.org with esmtp (Exim 4.72) (envelope-from ) id 1aVdrH-0004Ge-71 for xen-devel@lists.xenproject.org; Tue, 16 Feb 2016 11:31:55 +0000 In-Reply-To: <1455300361-13092-9-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 Cc: Wei Liu , Ian Campbell , Stefano Stabellini , jinsong.liu@alibaba-inc.com, Ian Jackson , mpohlack@amazon.de, Stefano Stabellini , Jan Beulich , andrew.cooper3@citrix.com, xen-devel@lists.xenproject.org, Keir Fraser , sasha.levin@citrix.com List-Id: xen-devel@lists.xenproject.org On 02/12/2016 06:05 PM, Konrad Rzeszutek Wilk wrote: > This change demonstrates how to generate an xSplice ELF payload. > > The idea here is that we want to patch in the hypervisor > the 'xen_version_extra' function with an function that will > return 'Hello World'. The 'xl info | grep extraversion' > will reflect the new value after the patching. > > To generate this ELF payload file we need: > - C code of the new code (xen_hello_world_func.c). > - C code generating the .xsplice.funcs structure > (xen_hello_world.c) > - The address of the old code (xen_extra_version). We > retrieve it by using 'nm --defined' on xen-syms. > - The size of the new and old code for which we use > nm --defined -S on our code and xen-syms respectively. > snip > diff --git a/tools/misc/xsplice.lds b/tools/misc/xsplice.lds > new file mode 100644 > index 0000000..f52eb8c > --- /dev/null > +++ b/tools/misc/xsplice.lds > @@ -0,0 +1,11 @@ > +OUTPUT_FORMAT("elf64-x86-64", "elf64-x86-64", "elf64-x86-64") > +OUTPUT_ARCH(i386:x86-64) > +ENTRY(xsplice_hello_world) > +SECTIONS > +{ > + /* The hypervisor expects ".xsplice.func", so change > + * the ".data.xsplice_hello_world" to it. */ > + > + .xsplice.funcs : { *(*.xsplice_hello_world) } > + > +} I think this file can be dropped now, nothing uses it as far as I can see. -- Ross Lagerwall