From: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
To: Ross Lagerwall <ross.lagerwall@citrix.com>
Cc: Tim Deegan <tim@xen.org>, Ian Jackson <ian.jackson@eu.citrix.com>,
Ian Campbell <ian.campbell@citrix.com>,
Jan Beulich <jbeulich@suse.com>,
xen-devel@lists.xen.org
Subject: Re: [PATCH v1 01/11] xsplice: Design document (v2).
Date: Thu, 5 Nov 2015 14:56:30 -0500 [thread overview]
Message-ID: <20151105195630.GC3559@x230.dumpdata.com> (raw)
In-Reply-To: <563B344F.80109@citrix.com>
On Thu, Nov 05, 2015 at 10:49:51AM +0000, Ross Lagerwall wrote:
> On 11/04/2015 09:10 PM, Konrad Rzeszutek Wilk wrote:
> snip
> >>+The payload **MUST** contain enough data to allow us to apply the update
> >>+and also safely reverse it. As such we **MUST** know:
> >>+
> >>+ * The locations in memory to be patched. This can be determined dynamically
> >>+ via symbols or via virtual addresses.
> >>+ * The new code that will be patched in.
> >>+ * Signature to verify the payload.
> >
> >Argh. We need to move the 'Signature to verify' in the 'v2' section
> >as I don't think we can get that done in time.
>
> No, not for V1.
>
> >
> >>+
> >>+This binary format can be constructed using an custom binary format but
> >>+there are severe disadvantages of it:
> >>+
> >>+ * The format might need to be changed and we need an mechanism to accommodate
> >>+ that.
> >>+ * It has to be platform agnostic.
> >>+ * Easily constructed using existing tools.
> >>+
> >>+As such having the payload in an ELF file is the sensible way. We would be
> >>+carrying the various sets of structures (and data) in the ELF sections under
> >>+different names and with definitions. The prefix for the ELF section name
> >>+would always be: *.xsplice* to match up to the names of the structures.
> >>+
> >>+Note that every structure has padding. This is added so that the hypervisor
> >>+can re-use those fields as it sees fit.
> >>+
> >>+Earlier design attempted to ineptly explain the relations of the ELF sections
> >>+to each other without using proper ELF mechanism (sh_info, sh_link, data
> >>+structures using Elf types, etc). This design will explain in detail
> >>+the structures and how they are used together and not dig in the ELF
> >>+format - except mention that the section names should match the
> >>+structure names.
> >>+
> >>+The xSplice payload is a relocatable ELF binary. A typical binary would have:
> >>+
> >>+ * One or more .text sections
> >>+ * Zero or more read-only data sections
> >>+ * Zero or more data sections
> >>+ * Relocations for each of these sections
> >>+
> >>+It may also have some architecture-specific sections. For example:
> >>+
> >>+ * Alternatives instructions
> >>+ * Bug frames
> >>+ * Exception tables
> >>+ * Relocations for each of these sections
> >>+
> >>+The xSplice core code loads the payload as a standard ELF binary, relocates it
> >>+and handles the architecture-specifc sections as needed. This process is much
> >>+like what the Linux kernel module loader does. It contains no xSplice-specific
> >>+details and thus will not be discussed further.
> >
> >What is 'it'? The 'process of what module loader does'?
>
> 'It' refers to the process of module loading in the previous sentence.
>
> >
> >>+
> >>+Importantly, the payload also contains a section with an array of structures
> >>+describing the functions to be patched:
> >>+<pre>
> >>+struct xsplice_patch_func {
> >>+ unsigned long new_addr;
> >>+ unsigned long new_size;
> >>+ unsigned long old_addr;
> >>+ unsigned long old_size;
> >>+ char *name;
> >>+ uint8_t pad[64];
> >>+};
> >>+<pre>
> >
> >Uh, so 104 bytes ? Or did you mean to s/64/24/ so the structure is nicely
> >padded to 64-bytes?
> >
> >I think that is what you meant.
>
> OK. I'm not too fussed about exact sizes for V1 anyway, it's likely to
> change at some point.
Right. How do we want to handle that?
The original structure I wrote up was mostly copied from ksplice kmodsrc with
modifications. Which meant it was capable of patching data, code, your
grandmothers sofa, you name it. But for v1 we want to have the basic -
patching code.
However going forward we will want to expand and make changes - and some
companies may want to add fields and structures (and naturally also
add code to the hypervisor for that) and so on.
And at some point we will make mistakes and realize that some structures
are to be deprecated.
To make the live easier for them we ought to provide some way for this.
Thoughts?
>
> --
> Ross Lagerwall
next prev parent reply other threads:[~2015-11-05 19:56 UTC|newest]
Thread overview: 40+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-11-03 18:15 [PATCH v1 01/11] xsplice: Design document (v2) Ross Lagerwall
2015-11-03 18:15 ` [PATCH v1 02/11] xen/xsplice: Hypervisor implementation of XEN_XSPLICE_op Ross Lagerwall
2015-11-04 21:17 ` Konrad Rzeszutek Wilk
2015-11-12 16:28 ` Jan Beulich
2015-11-13 14:13 ` Konrad Rzeszutek Wilk
2015-11-13 23:50 ` Daniel De Graaf
2015-11-03 18:16 ` [PATCH v1 03/11] libxc: Implementation of XEN_XSPLICE_op in libxc Ross Lagerwall
2015-11-03 18:16 ` [PATCH v1 04/11] xen-xsplice: Tool to manipulate xsplice payloads Ross Lagerwall
2015-11-04 21:27 ` Konrad Rzeszutek Wilk
2015-11-03 18:16 ` [PATCH v1 05/11] elf: Add relocation types to elfstructs.h Ross Lagerwall
2015-11-05 10:38 ` Jan Beulich
2015-11-05 11:52 ` Ross Lagerwall
2015-11-03 18:16 ` [PATCH v1 06/11] xsplice: Add helper elf routines Ross Lagerwall
2015-11-04 21:49 ` Konrad Rzeszutek Wilk
2015-11-03 18:16 ` [PATCH v1 07/11] xsplice: Implement payload loading Ross Lagerwall
2015-11-04 22:21 ` Konrad Rzeszutek Wilk
2015-11-05 10:35 ` Jan Beulich
2015-11-05 11:51 ` Ross Lagerwall
2015-11-05 12:13 ` Jan Beulich
2015-11-05 11:15 ` Ross Lagerwall
2015-11-05 20:12 ` Konrad Rzeszutek Wilk
2015-11-03 18:16 ` [PATCH v1 08/11] xsplice: Implement support for applying patches Ross Lagerwall
2015-11-05 3:17 ` Konrad Rzeszutek Wilk
2015-11-05 11:45 ` Ross Lagerwall
2015-11-05 20:08 ` Konrad Rzeszutek Wilk
2015-11-05 3:19 ` Konrad Rzeszutek Wilk
2015-11-27 13:51 ` Martin Pohlack
2015-11-03 18:16 ` [PATCH v1 09/11] xsplice: Add support for bug frames Ross Lagerwall
2015-11-05 19:43 ` Konrad Rzeszutek Wilk
2015-11-03 18:16 ` [PATCH v1 10/11] xsplice: Add support for exception tables Ross Lagerwall
2015-11-05 19:47 ` Konrad Rzeszutek Wilk
2015-11-27 16:28 ` Martin Pohlack
2015-11-27 17:05 ` Ross Lagerwall
2015-11-03 18:16 ` [PATCH v1 11/11] xsplice: Add support for alternatives Ross Lagerwall
2015-11-05 19:48 ` Konrad Rzeszutek Wilk
2015-11-04 21:10 ` [PATCH v1 01/11] xsplice: Design document (v2) Konrad Rzeszutek Wilk
2015-11-05 10:49 ` Ross Lagerwall
2015-11-05 19:56 ` Konrad Rzeszutek Wilk [this message]
2015-11-10 9:55 ` Ross Lagerwall
2015-11-27 12:48 ` Martin Pohlack
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20151105195630.GC3559@x230.dumpdata.com \
--to=konrad.wilk@oracle.com \
--cc=ian.campbell@citrix.com \
--cc=ian.jackson@eu.citrix.com \
--cc=jbeulich@suse.com \
--cc=ross.lagerwall@citrix.com \
--cc=tim@xen.org \
--cc=xen-devel@lists.xen.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.