From patchwork Tue Mar 24 19:05:41 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ard Biesheuvel X-Patchwork-Id: 6085231 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 88DDABF90F for ; Tue, 24 Mar 2015 19:08:41 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id A2A39201CE for ; Tue, 24 Mar 2015 19:08:40 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.9]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id AE97D201C0 for ; Tue, 24 Mar 2015 19:08:39 +0000 (UTC) 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 1YaU9x-0003d0-NZ; Tue, 24 Mar 2015 19:06:41 +0000 Received: from mail-we0-f176.google.com ([74.125.82.176]) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1YaU9o-0003OW-Nc for linux-arm-kernel@lists.infradead.org; Tue, 24 Mar 2015 19:06:36 +0000 Received: by weop45 with SMTP id p45so1953377weo.0 for ; Tue, 24 Mar 2015 12:06:10 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=w7b/A7/8f1OqyMEc1pBgEumdrPa64RLr+PAkpbMDpdg=; b=btFxV6Q7z+leMEh/oYSAg/cQYtncFl14sljvybo1v2FOKhG9PJIjJx2Z54BSeTud5e 7qHYRBuqCxlJUGuGdQvpECK32GduFgTII24Oq+/tfUDXAb4usck6C6BNP9gJznwCSSN3 U6aa+BxqoNEL3BzB9Rjp2Ly5k5Hg2YbHhJQGYSoVEAWWxFQjO3+dmZNiSdzsE3rcdAXk a3zInoMul3sakR1EtjFeHQPvS9rHeIo6Zql0gOAPTSKxSJ758hXuNqQqfHnnWK03ppaN KaMuL0ydPX9FrcpxcxuUd9K+0kQcmf76rOXGCjvrM++nH4hmzB8naulJ3i7zdFK2b6XT XfJQ== X-Gm-Message-State: ALoCoQmJGV5t34mYHkUly7kGoKE6kf/90rzfjjNnyt3O5XpT7LpdlnlPMAVnO9U/63IIS3AHFj0H X-Received: by 10.194.187.236 with SMTP id fv12mr10667642wjc.131.1427223970664; Tue, 24 Mar 2015 12:06:10 -0700 (PDT) Received: from ards-macbook-pro.local ([90.174.5.10]) by mx.google.com with ESMTPSA id uo6sm170452wjc.49.2015.03.24.12.06.08 (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Tue, 24 Mar 2015 12:06:09 -0700 (PDT) From: Ard Biesheuvel To: linux-arm-kernel@lists.infradead.org, linux@arm.linux.org.uk, dave.martin@linaro.org, nico@linaro.org, arnd@arndb.de Subject: [PATCH v3] ARM: exynos: move resume code to .text section Date: Tue, 24 Mar 2015 20:05:41 +0100 Message-Id: <1427223941-26251-1-git-send-email-ard.biesheuvel@linaro.org> X-Mailer: git-send-email 1.8.3.2 In-Reply-To: References: X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20150324_120632_954110_FE684933 X-CRM114-Status: GOOD ( 10.89 ) X-Spam-Score: -0.7 (/) 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+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Spam-Status: No, score=-4.2 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_MED, T_RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP This code calls cpu_resume() using a straight branch (b), so now that we have moved cpu_resume() back to .text, this should be moved there as well. Any direct references to symbols that will remain in the .data section are replaced with explicit PC-relative references. Signed-off-by: Ard Biesheuvel Acked-by: Nicolas Pitre --- v3: add missing .align, regroup changes to be more logical v2: keep cp15_save_power and cp15_save_diag in the .data section arch/arm/mach-exynos/sleep.S | 31 ++++++++++++++++--------------- 1 file changed, 16 insertions(+), 15 deletions(-) diff --git a/arch/arm/mach-exynos/sleep.S b/arch/arm/mach-exynos/sleep.S index 31d25834b9c4..cf950790fbdc 100644 --- a/arch/arm/mach-exynos/sleep.S +++ b/arch/arm/mach-exynos/sleep.S @@ -23,14 +23,7 @@ #define CPU_MASK 0xff0ffff0 #define CPU_CORTEX_A9 0x410fc090 - /* - * The following code is located into the .data section. This is to - * allow l2x0_regs_phys to be accessed with a relative load while we - * can't rely on any MMU translation. We could have put l2x0_regs_phys - * in the .text section as well, but some setups might insist on it to - * be truly read-only. (Reference from: arch/arm/kernel/sleep.S) - */ - .data + .text .align /* @@ -69,10 +62,12 @@ ENTRY(exynos_cpu_resume_ns) cmp r0, r1 bne skip_cp15 - adr r0, cp15_save_power + adr r0, _cp15_save_power ldr r1, [r0] - adr r0, cp15_save_diag + ldr r1, [r0, r1] + adr r0, _cp15_save_diag ldr r2, [r0] + ldr r2, [r0, r2] mov r0, #SMC_CMD_C15RESUME dsb smc #0 @@ -118,14 +113,20 @@ skip_l2x0: skip_cp15: b cpu_resume ENDPROC(exynos_cpu_resume_ns) + + .align +_cp15_save_power: + .long cp15_save_power - . +_cp15_save_diag: + .long cp15_save_diag - . +#ifdef CONFIG_CACHE_L2X0 +1: .long l2x0_saved_regs - . +#endif /* CONFIG_CACHE_L2X0 */ + + .data .globl cp15_save_diag cp15_save_diag: .long 0 @ cp15 diagnostic .globl cp15_save_power cp15_save_power: .long 0 @ cp15 power control - -#ifdef CONFIG_CACHE_L2X0 - .align -1: .long l2x0_saved_regs - . -#endif /* CONFIG_CACHE_L2X0 */