From patchwork Thu Mar 12 17:38:08 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ard Biesheuvel X-Patchwork-Id: 45742 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-wi0-f200.google.com (mail-wi0-f200.google.com [209.85.212.200]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 68AE0214BF for ; Thu, 12 Mar 2015 17:41:20 +0000 (UTC) Received: by wivr20 with SMTP id r20sf13614659wiv.0 for ; Thu, 12 Mar 2015 10:41:19 -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=fM49E7t/8T1cdvjAQ3udzST70nVBrw4qwn6XZJLOrg6135pCISXRgzcunij3uezDLh 0/CYD0wIav0m6/S00vP7xdD/i/ZcKesmWSoNiTVoP9ovQKRP7QxHPMuxT/r1hk7KFhey 4kxTo0vBUgOtB82QGom6NVlkHX9H31PqvMDOCgD/UAKuBxECAGPnzHNWmpUVAEhTioK6 EyMUiUnULw6tWpw0KTM7/jK6JeFcxVHNu+S7EXrKbB8f5C5Q/aOGvhwQS65uERkoyS34 uqcxy0tdviMLdz2BjdnmdtwPfHkfPEANLlklNdlnmFUq06XdTzwgMknjdlcFuABsokYY tgXw== X-Gm-Message-State: ALoCoQnnbnf61MPC/wlxo8CymxVVsluIvyfedBfWyMAmRGj14U5BLgQMxM7n2+ueCQKlLg+AqA7H X-Received: by 10.180.208.12 with SMTP id ma12mr4303036wic.6.1426182079735; Thu, 12 Mar 2015 10:41:19 -0700 (PDT) X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.36.67 with SMTP id o3ls263365laj.67.gmail; Thu, 12 Mar 2015 10:41:19 -0700 (PDT) X-Received: by 10.152.204.42 with SMTP id kv10mr33307550lac.52.1426182079208; Thu, 12 Mar 2015 10:41:19 -0700 (PDT) Received: from mail-lb0-f176.google.com (mail-lb0-f176.google.com. [209.85.217.176]) by mx.google.com with ESMTPS id o8si4814056laj.176.2015.03.12.10.41.19 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 12 Mar 2015 10:41:19 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.217.176 as permitted sender) client-ip=209.85.217.176; Received: by lbiz11 with SMTP id z11so17588989lbi.13 for ; Thu, 12 Mar 2015 10:41:19 -0700 (PDT) X-Received: by 10.152.26.201 with SMTP id n9mr39559378lag.29.1426182078877; Thu, 12 Mar 2015 10:41:18 -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 h5csp382478lbj; Thu, 12 Mar 2015 10:41:18 -0700 (PDT) X-Received: by 10.70.90.133 with SMTP id bw5mr93529032pdb.93.1426182077128; Thu, 12 Mar 2015 10:41:17 -0700 (PDT) Received: from bombadil.infradead.org (bombadil.infradead.org. [2001:1868:205::9]) by mx.google.com with ESMTPS id cy3si13481730pdb.42.2015.03.12.10.41.16 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 12 Mar 2015 10:41:17 -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 1YW75G-0004gB-1z; Thu, 12 Mar 2015 17:39:46 +0000 Received: from mail-wi0-f179.google.com ([209.85.212.179]) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1YW74X-0004GX-9Q for linux-arm-kernel@lists.infradead.org; Thu, 12 Mar 2015 17:39:02 +0000 Received: by wibbs8 with SMTP id bs8so22363067wib.4 for ; Thu, 12 Mar 2015 10:38:38 -0700 (PDT) X-Received: by 10.180.75.140 with SMTP id c12mr61083877wiw.14.1426181918200; Thu, 12 Mar 2015 10:38:38 -0700 (PDT) Received: from ards-macbook-pro.local (45.Red-83-50-109.dynamicIP.rima-tde.net. [83.50.109.45]) by mx.google.com with ESMTPSA id m9sm14081659wiz.24.2015.03.12.10.38.36 (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Thu, 12 Mar 2015 10:38:37 -0700 (PDT) From: Ard Biesheuvel To: linux-arm-kernel@lists.infradead.org, arnd@arndb.de, linux@arm.linux.org.uk, nico@linaro.org Subject: [RFT/RFC PATCH 2/6] ARM: move HYP text to end of .text section Date: Thu, 12 Mar 2015 18:38:08 +0100 Message-Id: <1426181892-15440-3-git-send-email-ard.biesheuvel@linaro.org> X-Mailer: git-send-email 1.8.3.2 In-Reply-To: <1426181892-15440-1-git-send-email-ard.biesheuvel@linaro.org> References: <1426181892-15440-1-git-send-email-ard.biesheuvel@linaro.org> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20150312_103901_529709_A3E705AE X-CRM114-Status: GOOD ( 10.35 ) 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.179 listed in list.dnswl.org] -0.0 RCVD_IN_MSPIKE_H3 RBL: Good reputation (+3) [209.85.212.179 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.176 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