Re: [PATCH 1/2] ARM: PIE infrastructure

2016-04-27 Thread Russell King - ARM Linux
On Sat, Apr 23, 2016 at 01:15:03AM +0200, Alexandre Belloni wrote: > Well, do you want me to iterate and use fncpy on all the functions from > the generated binary? No, because that will break the image too. > I'm not sure this is necessary as the generated binary is self contained > and doing

Re: [PATCH 1/2] ARM: PIE infrastructure

2016-04-27 Thread Russell King - ARM Linux
On Sat, Apr 23, 2016 at 01:15:03AM +0200, Alexandre Belloni wrote: > Well, do you want me to iterate and use fncpy on all the functions from > the generated binary? No, because that will break the image too. > I'm not sure this is necessary as the generated binary is self contained > and doing

Re: [PATCH 1/2] ARM: PIE infrastructure

2016-04-25 Thread Dave P Martin
On Sat, Apr 23, 2016 at 01:15:03AM +0200, Alexandre Belloni wrote: > On 04/04/2016 at 11:00:52 +0100, Russell King - ARM Linux wrote : > > > + /* Copy chunk specific code/data */ > > > + fncpy((char *)chunk->addr, code_start, code_sz); > > > > Sorry, NAK. This abuses fncpy(). There is extensive

Re: [PATCH 1/2] ARM: PIE infrastructure

2016-04-25 Thread Dave P Martin
On Sat, Apr 23, 2016 at 01:15:03AM +0200, Alexandre Belloni wrote: > On 04/04/2016 at 11:00:52 +0100, Russell King - ARM Linux wrote : > > > + /* Copy chunk specific code/data */ > > > + fncpy((char *)chunk->addr, code_start, code_sz); > > > > Sorry, NAK. This abuses fncpy(). There is extensive

Re: [PATCH 1/2] ARM: PIE infrastructure

2016-04-22 Thread Alexandre Belloni
On 04/04/2016 at 11:00:52 +0100, Russell King - ARM Linux wrote : > > + /* Copy chunk specific code/data */ > > + fncpy((char *)chunk->addr, code_start, code_sz); > > Sorry, NAK. This abuses fncpy(). There is extensive documentation on > the proper use of this in asm/fncpy.h, and anything

Re: [PATCH 1/2] ARM: PIE infrastructure

2016-04-22 Thread Alexandre Belloni
On 04/04/2016 at 11:00:52 +0100, Russell King - ARM Linux wrote : > > + /* Copy chunk specific code/data */ > > + fncpy((char *)chunk->addr, code_start, code_sz); > > Sorry, NAK. This abuses fncpy(). There is extensive documentation on > the proper use of this in asm/fncpy.h, and anything

Re: [PATCH 1/2] ARM: PIE infrastructure

2016-04-04 Thread Russell King - ARM Linux
On Sun, Apr 03, 2016 at 09:23:53AM +0200, Alexandre Belloni wrote: > +struct pie_chunk *__pie_load_data(struct gen_pool *pool, void *code_start, > + void *code_end, bool phys) > +{ > + struct pie_chunk *chunk; > + unsigned long offset; > + int ret; > +

Re: [PATCH 1/2] ARM: PIE infrastructure

2016-04-04 Thread Russell King - ARM Linux
On Sun, Apr 03, 2016 at 09:23:53AM +0200, Alexandre Belloni wrote: > +struct pie_chunk *__pie_load_data(struct gen_pool *pool, void *code_start, > + void *code_end, bool phys) > +{ > + struct pie_chunk *chunk; > + unsigned long offset; > + int ret; > +

[PATCH 1/2] ARM: PIE infrastructure

2016-04-03 Thread Alexandre Belloni
Add support for embedding position independent executables (PIE) in the kernel. Those PIEs can then be loaded into memory allocated using genalloc. For example, this allows running code from SRAM which is usually needed for suspend/resume or to change the DDR timings. That code is usually written

[PATCH 1/2] ARM: PIE infrastructure

2016-04-03 Thread Alexandre Belloni
Add support for embedding position independent executables (PIE) in the kernel. Those PIEs can then be loaded into memory allocated using genalloc. For example, this allows running code from SRAM which is usually needed for suspend/resume or to change the DDR timings. That code is usually written