All of lore.kernel.org
 help / color / mirror / Atom feed
From: ard.biesheuvel@linaro.org (Ard Biesheuvel)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH] ARM: force linker to use PIC veneers
Date: Tue, 24 Mar 2015 16:51:07 +0100	[thread overview]
Message-ID: <CAKv+Gu9pNZFjrRbRkK=Yp5RkV6GCM2NmVWzXRYmqmS97q+e0NQ@mail.gmail.com> (raw)
In-Reply-To: <alpine.LFD.2.11.1503241125450.27567@knanqh.ubzr>

On 24 March 2015 at 16:49, Nicolas Pitre <nicolas.pitre@linaro.org> wrote:
> On Tue, 24 Mar 2015, Ard Biesheuvel wrote:
>
>> On 24 March 2015 at 16:16, Nicolas Pitre <nicolas.pitre@linaro.org> wrote:
>> > On Tue, 24 Mar 2015, Ard Biesheuvel wrote:
>> >
>> >> On 24 March 2015 at 13:22, Dave Martin <Dave.Martin@arm.com> wrote:
>> >> > How many such veneers get added in the your kernel configuration, and
>> >> > how many are actually necessary (i.e., calls between MMU-off code and
>> >> > elsewhere)?
>> >> >
>> >>
>> >> Very few. In addition to the example (which will be addressed in
>> >> another way regardless) there are some resume functions that get
>> >> allocated in .data, and those would need it as well.
>> >
>> >
>> > What are they? I thought we removed all instances of those already.
>> >
>> >> I have also proposed b_far/bl_far macros that could be used there as
>> >> well.
>> >
>> > Could the automatic veneer insertion replace the unconditional
>> > b_far/bl_far usage?  The former would be preferable to the later.
>> >
>>
>> Agreed. I am not entirely sure why those functions don't get a veneer.
>> Perhaps simply because .data is not annotated as executable?
>>
>> Frankly, I don't really understand the purpose of putting those in
>> .data in the first place. but if they need to remain there, I can try
>> to figure out how to get the linker to emit veneers for those as well.
>
> I'm guilty of introducing the first instance of code in .data back in
> ... hrm ... 1998 or so.  I wasn't as experienced in ARM assembly back
> then and the resume code needed to fetch its context data while the MMU
> was off. So the easy way was simply to put the code next to the data
> block and get its address using adr.
>
> These days we know how to write code to obtain position independent
> memory addresses at run time. One such example is commit b4e6153704
> where the bl relocation also exceeded its range.  But I thought I had
> converted all those instances already.
>

Yes, there are still some instances left of that, including the core
cpu_resume() itself.
(and they all copy the same comment :-))

  reply	other threads:[~2015-03-24 15:51 UTC|newest]

Thread overview: 25+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-03-24 10:16 [PATCH] ARM: force linker to use PIC veneers Ard Biesheuvel
2015-03-24 12:22 ` Dave Martin
2015-03-24 12:50   ` Ard Biesheuvel
2015-03-24 13:54     ` Dave Martin
2015-03-24 14:04       ` Ard Biesheuvel
2015-03-24 15:23         ` Nicolas Pitre
2015-03-24 17:35       ` Ard Biesheuvel
2015-03-25 10:46         ` Dave Martin
2015-03-26 11:36           ` Russell King - ARM Linux
2015-03-26 12:20             ` Ard Biesheuvel
2015-03-26 12:22               ` Russell King - ARM Linux
2015-03-26 12:24                 ` Ard Biesheuvel
2015-03-26 12:53                   ` Dave P Martin
2015-03-26 13:05                     ` Ard Biesheuvel
2015-03-26 13:19                       ` Dave P Martin
2015-03-27  0:01                         ` Ard Biesheuvel
2015-03-30 12:06                           ` Dave P Martin
2015-03-24 15:16     ` Nicolas Pitre
2015-03-24 15:23       ` Ard Biesheuvel
2015-03-24 15:49         ` Nicolas Pitre
2015-03-24 15:51           ` Ard Biesheuvel [this message]
2015-03-24 23:25             ` Russell King - ARM Linux
2015-03-24 23:30               ` Ard Biesheuvel
2015-03-24 15:41       ` Ard Biesheuvel
2015-03-24 16:42 ` Nicolas Pitre

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='CAKv+Gu9pNZFjrRbRkK=Yp5RkV6GCM2NmVWzXRYmqmS97q+e0NQ@mail.gmail.com' \
    --to=ard.biesheuvel@linaro.org \
    --cc=linux-arm-kernel@lists.infradead.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.