From patchwork Fri Mar 13 12:07:26 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ard Biesheuvel X-Patchwork-Id: 45765 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-wi0-f198.google.com (mail-wi0-f198.google.com [209.85.212.198]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 1A75C214BF for ; Fri, 13 Mar 2015 12:10:31 +0000 (UTC) Received: by wivz2 with SMTP id z2sf3246143wiv.1 for ; Fri, 13 Mar 2015 05:10:30 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:delivered-to:from:to:subject:date:message-id :in-reply-to:references:cc:precedence:list-id:list-unsubscribe :list-archive:list-post:list-help:list-subscribe:mime-version :content-type:content-transfer-encoding:sender:errors-to :x-original-sender:x-original-authentication-results:mailing-list; bh=N8NFfvjCK09D7eDnskH5nqj+v1A0iWwy0KN1gHk66tM=; b=Z2EIKsqujclQsmT1YMHMCxGXAwtpZggDuPrDDyCQlMHbVmsuwZQe+txJqf4tipSwyP a8+7/Pw80A/Afj6AFX6XKwmEm8XUM0c9vpIxs23nohNKEusbB+6hyM021m4McGnEgLhO Rc0E33Id0sLuEH2cav+3oAShTgcPmG/O3bSP66DOtR1wcBWvaPXDu3NZ4SvkCSaxTxsC Jp8dhoxM3olJczYiJvzZ2i6fFWLjgAbQXBITYSFJiWFI1G9kRQacYW9Z3PSNM/l2n1O6 s8DWzljlQ9sp6LMwKK6hhhBxZ+C0/ZJaYMbMHa/P4cHUaog/vPIaaX0W48mJNYCxOU0s 63WQ== X-Gm-Message-State: ALoCoQkwqXX82oEBKmgseYU3OPv6Qhg83lQOMWEEcccIQjEiW2oGu8alTPQ0p5e4EHUFp6ofcVg8 X-Received: by 10.112.199.69 with SMTP id ji5mr7104126lbc.0.1426248630311; Fri, 13 Mar 2015 05:10:30 -0700 (PDT) X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.5.166 with SMTP id t6ls402574lat.83.gmail; Fri, 13 Mar 2015 05:10:29 -0700 (PDT) X-Received: by 10.152.87.199 with SMTP id ba7mr37124121lab.75.1426248629973; Fri, 13 Mar 2015 05:10:29 -0700 (PDT) Received: from mail-lb0-f173.google.com (mail-lb0-f173.google.com. [209.85.217.173]) by mx.google.com with ESMTPS id bb1si1240072lab.113.2015.03.13.05.10.29 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 13 Mar 2015 05:10:29 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.217.173 as permitted sender) client-ip=209.85.217.173; Received: by lbvn10 with SMTP id n10so22303076lbv.11 for ; Fri, 13 Mar 2015 05:10:29 -0700 (PDT) X-Received: by 10.152.30.103 with SMTP id r7mr39775736lah.76.1426248629887; Fri, 13 Mar 2015 05:10:29 -0700 (PDT) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patch@linaro.org Received: by 10.112.35.133 with SMTP id h5csp862831lbj; Fri, 13 Mar 2015 05:10:28 -0700 (PDT) X-Received: by 10.70.124.138 with SMTP id mi10mr41469528pdb.39.1426248627851; Fri, 13 Mar 2015 05:10:27 -0700 (PDT) Received: from bombadil.infradead.org (bombadil.infradead.org. [2001:1868:205::9]) by mx.google.com with ESMTPS id qa2si3678644pdb.130.2015.03.13.05.10.27 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 13 Mar 2015 05:10:27 -0700 (PDT) Received-SPF: none (google.com: linux-arm-kernel-bounces+patch=linaro.org@lists.infradead.org does not designate permitted sender hosts) client-ip=2001:1868:205::9; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1YWOOc-0000F2-K2; Fri, 13 Mar 2015 12:08:54 +0000 Received: from mail-wi0-f181.google.com ([209.85.212.181]) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1YWONv-0008HM-NS for linux-arm-kernel@lists.infradead.org; Fri, 13 Mar 2015 12:08:12 +0000 Received: by wivr20 with SMTP id r20so5388613wiv.3 for ; Fri, 13 Mar 2015 05:07:49 -0700 (PDT) X-Received: by 10.194.85.129 with SMTP id h1mr97538497wjz.147.1426248469273; Fri, 13 Mar 2015 05:07:49 -0700 (PDT) Received: from ards-macbook-pro.local (53.Red-79-151-58.dynamicIP.rima-tde.net. [79.151.58.53]) by mx.google.com with ESMTPSA id w4sm2507612wib.19.2015.03.13.05.07.47 (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 13 Mar 2015 05:07:48 -0700 (PDT) From: Ard Biesheuvel To: linux-arm-kernel@lists.infradead.org, arnd@arndb.de, linux@arm.linux.org.uk, nico@linaro.org Subject: [PATCH v2 2/8] ARM: move HYP text to end of .text section Date: Fri, 13 Mar 2015 13:07:26 +0100 Message-Id: <1426248452-4773-3-git-send-email-ard.biesheuvel@linaro.org> X-Mailer: git-send-email 1.8.3.2 In-Reply-To: <1426248452-4773-1-git-send-email-ard.biesheuvel@linaro.org> References: <1426248452-4773-1-git-send-email-ard.biesheuvel@linaro.org> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20150313_050811_944267_AABA676F X-CRM114-Status: GOOD ( 10.32 ) X-Spam-Score: -0.7 (/) X-Spam-Report: SpamAssassin version 3.4.0 on bombadil.infradead.org summary: Content analysis details: (-0.7 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.7 RCVD_IN_DNSWL_LOW RBL: Sender listed at http://www.dnswl.org/, low trust [209.85.212.181 listed in list.dnswl.org] -0.0 RCVD_IN_MSPIKE_H3 RBL: Good reputation (+3) [209.85.212.181 listed in wl.mailspike.net] -0.0 SPF_PASS SPF: sender matches SPF record -0.0 RCVD_IN_MSPIKE_WL Mailspike good senders Cc: Ard Biesheuvel X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: , List-Help: , List-Subscribe: , MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patch=linaro.org@lists.infradead.org X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: ard.biesheuvel@linaro.org X-Original-Authentication-Results: mx.google.com; spf=pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.217.173 as permitted sender) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org X-Google-Group-Id: 836684582541 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 --- 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 #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