linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: ard.biesheuvel@linaro.org (Ard Biesheuvel)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH 0/2] add interworking support to Thumb2 kernel
Date: Sat, 20 Aug 2016 09:45:29 +0200	[thread overview]
Message-ID: <1471679131-3570-1-git-send-email-ard.biesheuvel@linaro.org> (raw)

In the core kernel, interworking is supported since vmlinux is a static
binary, and the linker takes care of fixing up the bl instructions and
emitting veneers if necessary. For modules, however, all function objects
must currently be in the same mode, since the kernel's module loader does
not handle interworking switches at all.

However, now that we have optimized PLT support, we can simply enable it
unconditionally for Thumb2 builds, which by itself is reasonable since
the module area is pretty small, especially with multiplatform kernels
(current multi_v7_defconfig results in a .text section that exceeds 8 MB,
leaving less than 8 MB for modules when not using PLTs).
PLT support also allows us to reuse the veneer emitting routines to emit
veneers for interworking branches that cannot be fixed up by tweaking
the instruction encoding.

Patch #1 fixes an issue where ARM functions exported from other modules
will be mistaken for Thumb2 functions due to the missing STT_FUNC annotation
on SHN_UNDEF symbols.

Patch #2 implements the interworking support, by tweaking the instruction
encoding for unconditional bl instructions, and emitting a PLT veneer in
all other cases.

Ard Biesheuvel (2):
  ARM: Thumb-2: infer function annotation for external ksyms
  ARM: add interworking support to Thumb-2 kernel

 arch/arm/Kconfig              |  1 +
 arch/arm/include/asm/module.h |  3 +-
 arch/arm/kernel/module-plts.c | 21 +++++--
 arch/arm/kernel/module.c      | 64 ++++++++++++++++----
 4 files changed, 69 insertions(+), 20 deletions(-)

-- 
2.7.4

             reply	other threads:[~2016-08-20  7:45 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-08-20  7:45 Ard Biesheuvel [this message]
2016-08-20  7:45 ` [PATCH 1/2] ARM: Thumb-2: infer function annotation for external ksyms Ard Biesheuvel
2016-08-20  7:45 ` [PATCH 2/2] ARM: add interworking support to Thumb-2 kernel Ard Biesheuvel
2016-08-20 16:23 ` [PATCH 0/2] add interworking support to Thumb2 kernel Russell King - ARM Linux
2016-08-20 16:36   ` Ard Biesheuvel
2016-08-20 16:55     ` Russell King - ARM Linux
2016-08-20 17:38       ` Ard Biesheuvel

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=1471679131-3570-1-git-send-email-ard.biesheuvel@linaro.org \
    --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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).