From patchwork Tue Mar 24 17:52:28 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ard Biesheuvel X-Patchwork-Id: 46275 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-lb0-f197.google.com (mail-lb0-f197.google.com [209.85.217.197]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 20D92214B0 for ; Tue, 24 Mar 2015 17:55:35 +0000 (UTC) Received: by lbvp9 with SMTP id p9sf92523lbv.0 for ; Tue, 24 Mar 2015 10:55:34 -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=6e+KEndrHVVePc4BBztuEIYZG2ACqS0W5RKV6mwO+s4=; b=RZW0ujvKoxRM2ypTX5X3YC1RenAkiYXrQ+ARBfYMm1eG3fJjCh+w04V+jqAz5gm/SZ TrxmWNdaLQm7RZb33GjLJpzaiiH4UHOwGtACbgOjfCxkoNAaTfuGiShGDrg14pIKFTQH yu2PEwpbdHEpmMKnkYnL0QEYvWtau/R494lWpDMpoYkefWbpty4AO08GaH4BCe65hsg/ 2uv31UxlXEFLTtJLgh7ASj9gljryQQQX0Kg4SVP0eWb6krkk93D0osCyTteu6aguquea Hyq+2A3sfILDU+wDtIluBSjPW/z7r4P0HRWDO9OFDVbeWO+L4D8OYLur2B9p0ZLjdeZ8 8YaQ== X-Gm-Message-State: ALoCoQnyINa8WfSLqyNJ75OhkYvdX4nEHGyn9h9U/f9yuZbOyAV6oYvigZrcXR/ro0f0p9yR/oWq X-Received: by 10.112.219.35 with SMTP id pl3mr1150302lbc.13.1427219734152; Tue, 24 Mar 2015 10:55:34 -0700 (PDT) X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.88.50 with SMTP id bd18ls884118lab.108.gmail; Tue, 24 Mar 2015 10:55:33 -0700 (PDT) X-Received: by 10.152.5.36 with SMTP id p4mr4923178lap.7.1427219733883; Tue, 24 Mar 2015 10:55:33 -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 b8si3568377lae.45.2015.03.24.10.55.33 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 24 Mar 2015 10:55:33 -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 lbcmq2 with SMTP id mq2so436726lbc.0 for ; Tue, 24 Mar 2015 10:55:33 -0700 (PDT) X-Received: by 10.112.162.232 with SMTP id yd8mr4690895lbb.41.1427219733793; Tue, 24 Mar 2015 10:55:33 -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.57.201 with SMTP id k9csp1606594lbq; Tue, 24 Mar 2015 10:55:32 -0700 (PDT) X-Received: by 10.68.94.129 with SMTP id dc1mr10017488pbb.8.1427219732058; Tue, 24 Mar 2015 10:55:32 -0700 (PDT) Received: from bombadil.infradead.org (bombadil.infradead.org. [2001:1868:205::9]) by mx.google.com with ESMTPS id yp6si6387320pbc.215.2015.03.24.10.55.31 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 24 Mar 2015 10:55:32 -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 1YaT1W-0002k3-IH; Tue, 24 Mar 2015 17:53:54 +0000 Received: from mail-we0-f179.google.com ([74.125.82.179]) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1YaT0m-0002OB-Ey for linux-arm-kernel@lists.infradead.org; Tue, 24 Mar 2015 17:53:09 +0000 Received: by wetk59 with SMTP id k59so307663wet.3 for ; Tue, 24 Mar 2015 10:52:46 -0700 (PDT) X-Received: by 10.194.108.137 with SMTP id hk9mr9884670wjb.112.1427219566292; Tue, 24 Mar 2015 10:52:46 -0700 (PDT) Received: from ards-macbook-pro.local ([90.174.5.112]) by mx.google.com with ESMTPSA id ge8sm7064903wjc.32.2015.03.24.10.52.44 (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Tue, 24 Mar 2015 10:52:45 -0700 (PDT) From: Ard Biesheuvel To: linux-arm-kernel@lists.infradead.org, nico@linaro.org, linux@arm.linux.org.uk, dave.martin@arm.com, arnd@arndb.de Subject: [PATCH v2 2/4] ARM: move cpu_resume() to .text section Date: Tue, 24 Mar 2015 18:52:28 +0100 Message-Id: <1427219550-21636-3-git-send-email-ard.biesheuvel@linaro.org> X-Mailer: git-send-email 1.8.3.2 In-Reply-To: <1427219550-21636-1-git-send-email-ard.biesheuvel@linaro.org> References: <1427219550-21636-1-git-send-email-ard.biesheuvel@linaro.org> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20150324_105308_686331_BB18C2AB X-CRM114-Status: GOOD ( 11.46 ) 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 [74.125.82.179 listed in list.dnswl.org] -0.0 SPF_PASS SPF: sender matches SPF record -0.0 RCVD_IN_MSPIKE_H3 RBL: Good reputation (+3) [74.125.82.179 listed in wl.mailspike.net] -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 Move cpu_resume() to the .text section where it belongs. Change the adr reference to sleep_save_sp to an explicit PC relative reference so sleep_save_sp itself can remain in .data. This helps prevent linker failure on large kernels, as the code in the .data section may be too far away to be in range for normal b/bl instructions. Reviewed-by: Nicolas Pitre Tested-by: Sudeep Holla Signed-off-by: Ard Biesheuvel --- arch/arm/kernel/sleep.S | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) diff --git a/arch/arm/kernel/sleep.S b/arch/arm/kernel/sleep.S index 0ea3813fedce..fabdb14e88b8 100644 --- a/arch/arm/kernel/sleep.S +++ b/arch/arm/kernel/sleep.S @@ -116,14 +116,7 @@ cpu_resume_after_mmu: ldmfd sp!, {r4 - r11, pc} ENDPROC(cpu_resume_after_mmu) -/* - * Note: Yes, part of the following code is located into the .data section. - * This is to allow sleep_save_sp to be accessed with a relative load - * while we can't rely on any MMU translation. We could have put - * sleep_save_sp in the .text section as well, but some setups might - * insist on it to be truly read-only. - */ - .data + .text .align ENTRY(cpu_resume) ARM_BE8(setend be) @ ensure we are in BE mode @@ -145,6 +138,8 @@ ARM_BE8(setend be) @ ensure we are in BE mode compute_mpidr_hash r1, r4, r5, r6, r0, r3 1: adr r0, _sleep_save_sp + ldr r2, [r0] + add r0, r0, r2 ldr r0, [r0, #SLEEP_SAVE_SP_PHYS] ldr r0, [r0, r1, lsl #2] @@ -156,10 +151,12 @@ THUMB( bx r3 ) ENDPROC(cpu_resume) .align 2 +_sleep_save_sp: + .long sleep_save_sp - . mpidr_hash_ptr: .long mpidr_hash - . @ mpidr_hash struct offset + .data .type sleep_save_sp, #object ENTRY(sleep_save_sp) -_sleep_save_sp: .space SLEEP_SAVE_SP_SZ @ struct sleep_save_sp