All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] xen: arm: include .text.cold and .text.unlikely in text area
@ 2014-06-09 14:28 Ian Campbell
  2014-06-09 14:50 ` Julien Grall
  2014-06-10  8:50 ` Jan Beulich
  0 siblings, 2 replies; 6+ messages in thread
From: Ian Campbell @ 2014-06-09 14:28 UTC (permalink / raw)
  To: xen-devel; +Cc: Ian Campbell, Jan Beulich

Otherwise functions in these sections can end up between .text and .rodata
which is after _etext and therefore gets made non-executable.

This matches x86 (although it was done there for different reasons).

Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
Cc: Jan Beulich <JBeulich@suse.com>
---
Jan, any reason why x86 doesn't just use .text.*?
---
 xen/arch/arm/xen.lds.S |    2 ++
 1 file changed, 2 insertions(+)

diff --git a/xen/arch/arm/xen.lds.S b/xen/arch/arm/xen.lds.S
index e8b4f47..be55dad 100644
--- a/xen/arch/arm/xen.lds.S
+++ b/xen/arch/arm/xen.lds.S
@@ -30,6 +30,8 @@ SECTIONS
   .text : /* XXX should be AT ( XEN_PHYS_START ) */ {
         _stext = .;            /* Text section */
        *(.text)
+       *(.text.cold)
+       *(.text.unlikely)
        *(.fixup)
        *(.gnu.warning)
        _etext = .;             /* End of text section */
-- 
1.7.10.4

^ permalink raw reply related	[flat|nested] 6+ messages in thread

* Re: [PATCH] xen: arm: include .text.cold and .text.unlikely in text area
  2014-06-09 14:28 [PATCH] xen: arm: include .text.cold and .text.unlikely in text area Ian Campbell
@ 2014-06-09 14:50 ` Julien Grall
  2014-06-10 14:12   ` Ian Campbell
  2014-06-10  8:50 ` Jan Beulich
  1 sibling, 1 reply; 6+ messages in thread
From: Julien Grall @ 2014-06-09 14:50 UTC (permalink / raw)
  To: Ian Campbell, xen-devel; +Cc: Jan Beulich

Hi Ian,

On 06/09/2014 03:28 PM, Ian Campbell wrote:
> Otherwise functions in these sections can end up between .text and .rodata
> which is after _etext and therefore gets made non-executable.
> 
> This matches x86 (although it was done there for different reasons).
> 
> Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
> Cc: Jan Beulich <JBeulich@suse.com>

Acked-by: Julien Grall <julien.grall@linaro.org>

Regards,

-- 
Julien Grall

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] xen: arm: include .text.cold and .text.unlikely in text area
  2014-06-09 14:28 [PATCH] xen: arm: include .text.cold and .text.unlikely in text area Ian Campbell
  2014-06-09 14:50 ` Julien Grall
@ 2014-06-10  8:50 ` Jan Beulich
  2014-06-10  9:07   ` Ian Campbell
  1 sibling, 1 reply; 6+ messages in thread
From: Jan Beulich @ 2014-06-10  8:50 UTC (permalink / raw)
  To: Ian Campbell; +Cc: xen-devel

>>> On 09.06.14 at 16:28, <ian.campbell@citrix.com> wrote:
> Otherwise functions in these sections can end up between .text and .rodata
> which is after _etext and therefore gets made non-executable.
> 
> This matches x86 (although it was done there for different reasons).
> 
> Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
> Cc: Jan Beulich <JBeulich@suse.com>
> ---
> Jan, any reason why x86 doesn't just use .text.*?

Because we want the .cold and .unlikely all adjacent, rather than
intermixed with eventual other ones (imagine mixing in a
hypothetical .text.hot).

Jan

> ---
>  xen/arch/arm/xen.lds.S |    2 ++
>  1 file changed, 2 insertions(+)
> 
> diff --git a/xen/arch/arm/xen.lds.S b/xen/arch/arm/xen.lds.S
> index e8b4f47..be55dad 100644
> --- a/xen/arch/arm/xen.lds.S
> +++ b/xen/arch/arm/xen.lds.S
> @@ -30,6 +30,8 @@ SECTIONS
>    .text : /* XXX should be AT ( XEN_PHYS_START ) */ {
>          _stext = .;            /* Text section */
>         *(.text)
> +       *(.text.cold)
> +       *(.text.unlikely)
>         *(.fixup)
>         *(.gnu.warning)
>         _etext = .;             /* End of text section */
> -- 
> 1.7.10.4

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] xen: arm: include .text.cold and .text.unlikely in text area
  2014-06-10  8:50 ` Jan Beulich
@ 2014-06-10  9:07   ` Ian Campbell
  2014-06-10  9:48     ` Jan Beulich
  0 siblings, 1 reply; 6+ messages in thread
From: Ian Campbell @ 2014-06-10  9:07 UTC (permalink / raw)
  To: Jan Beulich; +Cc: xen-devel

On Tue, 2014-06-10 at 09:50 +0100, Jan Beulich wrote:
> >>> On 09.06.14 at 16:28, <ian.campbell@citrix.com> wrote:
> > Otherwise functions in these sections can end up between .text and .rodata
> > which is after _etext and therefore gets made non-executable.
> > 
> > This matches x86 (although it was done there for different reasons).
> > 
> > Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
> > Cc: Jan Beulich <JBeulich@suse.com>
> > ---
> > Jan, any reason why x86 doesn't just use .text.*?
> 
> Because we want the .cold and .unlikely all adjacent, rather than
> intermixed with eventual other ones (imagine mixing in a
> hypothetical .text.hot).

That makes sense. Could we specify .text.* after those as a fallback or
would we rather deal with each new section specifically so we can have a
think about the right location?

I don't suppose there is a linker option to make it barf on
non-explicitly placed sections, is there? That would have turned this
silent (and hard to diagnose) failure into something more explicit.

Ian.

> 
> Jan
> 
> > ---
> >  xen/arch/arm/xen.lds.S |    2 ++
> >  1 file changed, 2 insertions(+)
> > 
> > diff --git a/xen/arch/arm/xen.lds.S b/xen/arch/arm/xen.lds.S
> > index e8b4f47..be55dad 100644
> > --- a/xen/arch/arm/xen.lds.S
> > +++ b/xen/arch/arm/xen.lds.S
> > @@ -30,6 +30,8 @@ SECTIONS
> >    .text : /* XXX should be AT ( XEN_PHYS_START ) */ {
> >          _stext = .;            /* Text section */
> >         *(.text)
> > +       *(.text.cold)
> > +       *(.text.unlikely)
> >         *(.fixup)
> >         *(.gnu.warning)
> >         _etext = .;             /* End of text section */
> > -- 
> > 1.7.10.4
> 
> 
> 

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] xen: arm: include .text.cold and .text.unlikely in text area
  2014-06-10  9:07   ` Ian Campbell
@ 2014-06-10  9:48     ` Jan Beulich
  0 siblings, 0 replies; 6+ messages in thread
From: Jan Beulich @ 2014-06-10  9:48 UTC (permalink / raw)
  To: Ian Campbell; +Cc: xen-devel

>>> On 10.06.14 at 11:07, <Ian.Campbell@citrix.com> wrote:
> On Tue, 2014-06-10 at 09:50 +0100, Jan Beulich wrote:
>> >>> On 09.06.14 at 16:28, <ian.campbell@citrix.com> wrote:
>> > Otherwise functions in these sections can end up between .text and .rodata
>> > which is after _etext and therefore gets made non-executable.
>> > 
>> > This matches x86 (although it was done there for different reasons).
>> > 
>> > Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
>> > Cc: Jan Beulich <JBeulich@suse.com>
>> > ---
>> > Jan, any reason why x86 doesn't just use .text.*?
>> 
>> Because we want the .cold and .unlikely all adjacent, rather than
>> intermixed with eventual other ones (imagine mixing in a
>> hypothetical .text.hot).
> 
> That makes sense. Could we specify .text.* after those as a fallback or
> would we rather deal with each new section specifically so we can have a
> think about the right location?

That's certainly an option - placing them inefficiently is clearly
better than placing them wrongly.

> I don't suppose there is a linker option to make it barf on
> non-explicitly placed sections, is there? That would have turned this
> silent (and hard to diagnose) failure into something more explicit.

I'm not aware of any such option.

Jan

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] xen: arm: include .text.cold and .text.unlikely in text area
  2014-06-09 14:50 ` Julien Grall
@ 2014-06-10 14:12   ` Ian Campbell
  0 siblings, 0 replies; 6+ messages in thread
From: Ian Campbell @ 2014-06-10 14:12 UTC (permalink / raw)
  To: Julien Grall; +Cc: Jan Beulich, xen-devel

On Mon, 2014-06-09 at 15:50 +0100, Julien Grall wrote:
> Hi Ian,
> 
> On 06/09/2014 03:28 PM, Ian Campbell wrote:
> > Otherwise functions in these sections can end up between .text and .rodata
> > which is after _etext and therefore gets made non-executable.
> > 
> > This matches x86 (although it was done there for different reasons).
> > 
> > Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
> > Cc: Jan Beulich <JBeulich@suse.com>
> 
> Acked-by: Julien Grall <julien.grall@linaro.org>

Applied, thanks.

Ian.

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2014-06-10 14:12 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-06-09 14:28 [PATCH] xen: arm: include .text.cold and .text.unlikely in text area Ian Campbell
2014-06-09 14:50 ` Julien Grall
2014-06-10 14:12   ` Ian Campbell
2014-06-10  8:50 ` Jan Beulich
2014-06-10  9:07   ` Ian Campbell
2014-06-10  9:48     ` Jan Beulich

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.