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 v2 2/8] ARM: move HYP text to end of .text section
Date: Fri, 13 Mar 2015 13:07:26 +0100	[thread overview]
Message-ID: <1426248452-4773-3-git-send-email-ard.biesheuvel@linaro.org> (raw)
In-Reply-To: <1426248452-4773-1-git-send-email-ard.biesheuvel@linaro.org>

The HYP text is essentially a separate binary from the kernel proper,
so it can be moved away from the rest of the kernel. This helps prevent
link failures due to branch relocations exceeding their range.

Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
---
 arch/arm/kernel/vmlinux.lds.S | 8 ++++++--
 arch/arm/kvm/init.S           | 5 +----
 arch/arm/kvm/interrupts.S     | 4 +---
 3 files changed, 8 insertions(+), 9 deletions(-)

diff --git a/arch/arm/kernel/vmlinux.lds.S b/arch/arm/kernel/vmlinux.lds.S
index b31aa73e8076..e3b9403bd2d6 100644
--- a/arch/arm/kernel/vmlinux.lds.S
+++ b/arch/arm/kernel/vmlinux.lds.S
@@ -22,11 +22,14 @@
 	ALIGN_FUNCTION();						\
 	VMLINUX_SYMBOL(__idmap_text_start) = .;				\
 	*(.idmap.text)							\
-	VMLINUX_SYMBOL(__idmap_text_end) = .;				\
+	VMLINUX_SYMBOL(__idmap_text_end) = .;
+
+#define HYP_TEXT							\
 	. = ALIGN(32);							\
 	VMLINUX_SYMBOL(__hyp_idmap_text_start) = .;			\
 	*(.hyp.idmap.text)						\
-	VMLINUX_SYMBOL(__hyp_idmap_text_end) = .;
+	VMLINUX_SYMBOL(__hyp_idmap_text_end) = .;			\
+	*(.hyp.text)
 
 #ifdef CONFIG_HOTPLUG_CPU
 #define ARM_CPU_DISCARD(x)
@@ -118,6 +121,7 @@ SECTIONS
 		. = ALIGN(4);
 		*(.got)			/* Global offset table		*/
 			ARM_CPU_KEEP(PROC_INFO)
+			HYP_TEXT
 	}
 
 #ifdef CONFIG_DEBUG_RODATA
diff --git a/arch/arm/kvm/init.S b/arch/arm/kvm/init.S
index 3988e72d16ff..7a377d36de5d 100644
--- a/arch/arm/kvm/init.S
+++ b/arch/arm/kvm/init.S
@@ -51,8 +51,7 @@
  *   Switches to the runtime PGD, set stack and vectors.
  */
 
-	.text
-	.pushsection    .hyp.idmap.text,"ax"
+	.section    ".hyp.idmap.text", #alloc
 	.align 5
 __kvm_hyp_init:
 	.globl __kvm_hyp_init
@@ -155,5 +154,3 @@ target:	@ We're now in the trampoline code, switch page tables
 
 	.globl __kvm_hyp_init_end
 __kvm_hyp_init_end:
-
-	.popsection
diff --git a/arch/arm/kvm/interrupts.S b/arch/arm/kvm/interrupts.S
index 79caf79b304a..db22e9bedfcd 100644
--- a/arch/arm/kvm/interrupts.S
+++ b/arch/arm/kvm/interrupts.S
@@ -27,7 +27,7 @@
 #include <asm/vfpmacros.h>
 #include "interrupts_head.S"
 
-	.text
+	.section	".hyp.text", #alloc
 
 __kvm_hyp_code_start:
 	.globl __kvm_hyp_code_start
@@ -316,8 +316,6 @@ THUMB(	orr	r2, r2, #PSR_T_BIT	)
 	eret
 .endm
 
-	.text
-
 	.align 5
 __kvm_hyp_vector:
 	.globl __kvm_hyp_vector
-- 
1.8.3.2

  parent reply	other threads:[~2015-03-13 12:07 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-03-13 12:07 [PATCH v2 0/8] ARM kernel size fixes Ard Biesheuvel
2015-03-13 12:07 ` [PATCH v2 1/8] ARM: replace PROCINFO embedded branch with relative offset Ard Biesheuvel
2015-04-19 16:59   ` Joachim Eastwood
2015-04-19 17:08     ` Russell King - ARM Linux
2015-04-19 17:41       ` Ard Biesheuvel
2015-04-19 19:28         ` Russell King - ARM Linux
2015-04-19 19:45           ` Joachim Eastwood
2015-04-19 21:52           ` Ard Biesheuvel
2015-04-19 19:24       ` Joachim Eastwood
2015-03-13 12:07 ` Ard Biesheuvel [this message]
2015-03-13 12:07 ` [PATCH v2 3/8] ARM: add macro to perform far branches (b/bl) Ard Biesheuvel
2015-03-13 16:40   ` Russell King - ARM Linux
2015-03-17 20:35     ` Ard Biesheuvel
2015-03-18 10:07   ` Ard Biesheuvel
2015-03-19  9:01     ` [PATCH] " Ard Biesheuvel
2015-03-13 12:07 ` [PATCH v2 4/8] ARM: use bl_far to call __hyp_stub_install_secondary from the .data section Ard Biesheuvel
2015-03-13 12:07 ` [PATCH v2 5/8] ARM: move the .idmap.text section closer to .head.text Ard Biesheuvel
2015-03-13 12:07 ` [PATCH v2 6/8] asm-generic: introduce .text.fixup input section Ard Biesheuvel
2015-03-18 18:58   ` Arnd Bergmann
2015-03-13 12:07 ` [PATCH v2 7/8] ARM: keep .text and .fixup regions together Ard Biesheuvel
2015-03-13 12:07 ` [PATCH v2 8/8] kallsyms: allow kallsyms data to reside in the .data section Ard Biesheuvel
2015-03-18  7:54 ` [PATCH v2 0/8] ARM kernel size fixes 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=1426248452-4773-3-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).