Re: [Xen-devel] [PATCH v9 11/27] xsplice: Implement payload loading

2016-04-27 Thread Konrad Rzeszutek Wilk
On Wed, Apr 27, 2016 at 10:14:20AM -0600, Jan Beulich wrote: > >>> On 27.04.16 at 17:48, wrote: > > +int xsplice_elf_resolve_symbols(struct xsplice_elf *elf) > > +{ > > +unsigned int i; > > +int rc = 0; > > + > > +ASSERT(elf->sym); > > + > > +for ( i = 1; i < elf->nsym; i++ ) > > +

Re: [Xen-devel] [PATCH v9 11/27] xsplice: Implement payload loading

2016-04-27 Thread Jan Beulich
>>> On 27.04.16 at 17:48, wrote: > +int xsplice_elf_resolve_symbols(struct xsplice_elf *elf) > +{ > +unsigned int i; > +int rc = 0; > + > +ASSERT(elf->sym); > + > +for ( i = 1; i < elf->nsym; i++ ) > +{ > +unsigned int idx = elf->sym[i].sym->st_shndx; > +const E

Re: [Xen-devel] [PATCH v9 11/27] xsplice: Implement payload loading

2016-04-27 Thread Jan Beulich
>>> On 27.04.16 at 17:48, wrote: > Here is the inline patch: At first I'll reply on just the particular issue in move_payload(); I'll then go through the entire patch to see if anything else needs commenting. > +static int move_payload(struct payload *payload, struct xsplice_elf *elf) > +{ > +

Re: [Xen-devel] [PATCH v9 11/27] xsplice: Implement payload loading

2016-04-27 Thread Konrad Rzeszutek Wilk
On Wed, Apr 27, 2016 at 02:28:09AM -0600, Jan Beulich wrote: > >>> On 27.04.16 at 05:28, wrote: > >> > +static int move_payload(struct payload *payload, struct xsplice_elf > >> > *elf) > >> > +{ > > ..snip.. > >> > +for ( i = 1; i < elf->hdr->e_shnum; i++ ) > >> > +{ > >> > +if (

Re: [Xen-devel] [PATCH v9 11/27] xsplice: Implement payload loading

2016-04-27 Thread Jan Beulich
>>> On 27.04.16 at 05:28, wrote: >> > +static int move_payload(struct payload *payload, struct xsplice_elf *elf) >> > +{ > ..snip.. >> > +for ( i = 1; i < elf->hdr->e_shnum; i++ ) >> > +{ >> > +if ( elf->sec[i].sec->sh_flags & SHF_ALLOC ) >> > +{ >> > +uint8_t *

Re: [Xen-devel] [PATCH v9 11/27] xsplice: Implement payload loading

2016-04-27 Thread Jan Beulich
>>> On 27.04.16 at 03:47, wrote: >> > +static int move_payload(struct payload *payload, struct xsplice_elf *elf) >> > +{ > .. snip.. >> > +/* Compute size of different regions. */ >> > +for ( i = 1; i < elf->hdr->e_shnum; i++ ) >> > +{ >> > +if ( (elf->sec[i].sec->sh_flags & (S

Re: [Xen-devel] [PATCH v9 11/27] xsplice: Implement payload loading

2016-04-26 Thread Konrad Rzeszutek Wilk
> > +static int move_payload(struct payload *payload, struct xsplice_elf *elf) > > +{ ..snip.. > > +for ( i = 1; i < elf->hdr->e_shnum; i++ ) > > +{ > > +if ( elf->sec[i].sec->sh_flags & SHF_ALLOC ) > > +{ > > +uint8_t *buf; > > Perhaps void * again? And missing

Re: [Xen-devel] [PATCH v9 11/27] xsplice: Implement payload loading

2016-04-26 Thread Konrad Rzeszutek Wilk
> > +static int move_payload(struct payload *payload, struct xsplice_elf *elf) > > +{ .. snip.. > > +/* Compute size of different regions. */ > > +for ( i = 1; i < elf->hdr->e_shnum; i++ ) > > +{ > > +if ( (elf->sec[i].sec->sh_flags & (SHF_ALLOC|SHF_EXECINSTR)) == > > +

Re: [Xen-devel] [PATCH v9 11/27] xsplice: Implement payload loading

2016-04-26 Thread Jan Beulich
>>> On 25.04.16 at 17:34, wrote: > From: Ross Lagerwall > > Add support for loading xsplice payloads. This is somewhat similar to > the Linux kernel module loader, implementing the following steps: > - Verify the elf file. > - Parse the elf file. > - Allocate a region of memory mapped within a f

Re: [Xen-devel] [PATCH v9 11/27] xsplice: Implement payload loading

2016-04-26 Thread Ross Lagerwall
On 04/25/2016 04:34 PM, Konrad Rzeszutek Wilk wrote: snip +static int move_payload(struct payload *payload, struct xsplice_elf *elf) +{ +uint8_t *text_buf, *ro_buf, *rw_buf; +unsigned int i; +size_t size = 0; +unsigned int *offset; +int rc = 0; + +offset = xzalloc_array(un

[Xen-devel] [PATCH v9 11/27] xsplice: Implement payload loading

2016-04-25 Thread Konrad Rzeszutek Wilk
From: Ross Lagerwall Add support for loading xsplice payloads. This is somewhat similar to the Linux kernel module loader, implementing the following steps: - Verify the elf file. - Parse the elf file. - Allocate a region of memory mapped within a free area of [xen_virt_end, XEN_VIRT_END]. - Co