From patchwork Sat Aug 5 20:52:13 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ard Biesheuvel X-Patchwork-Id: 9883341 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id C665560392 for ; Sat, 5 Aug 2017 20:53:45 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id B8726286CC for ; Sat, 5 Aug 2017 20:53:45 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id AD1DE287B9; Sat, 5 Aug 2017 20:53:45 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.3 required=2.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_HI, RCVD_IN_SORBS_SPAM, T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 61B25286CC for ; Sat, 5 Aug 2017 20:53:45 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752771AbdHEUxl (ORCPT ); Sat, 5 Aug 2017 16:53:41 -0400 Received: from mail-wm0-f50.google.com ([74.125.82.50]:35053 "EHLO mail-wm0-f50.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752610AbdHEUx2 (ORCPT ); Sat, 5 Aug 2017 16:53:28 -0400 Received: by mail-wm0-f50.google.com with SMTP id m85so42479802wma.0 for ; Sat, 05 Aug 2017 13:53:27 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=qVwwZv5cVJLFrFIZWKPDugl12/5aWWtNTrDvraSpoBo=; b=Sw1aUrcSiEdyR2j4KUHaazcCiabH2dop+7ki3zfbXv6GWE4qfBx/PPqx+y8lVTYRTr wQULxvvSxr8AXLNkMtS6EHKCLnZK9jP/Vw/B7Wo+uPsC86AgkbjDe69C9Lito7Mthulr Sqo3rWsYME27diHPrCdyAiBYp3llsCTiAr7SU= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=qVwwZv5cVJLFrFIZWKPDugl12/5aWWtNTrDvraSpoBo=; b=Jue13eDFqoEzBEIRgsmBUcMiC4pxlDDYKlDpUOsCbofOJ7OBXAMFklToHlbm14YsLx rPvsaiZ5D/FaWaPPmI4/bnIMYbUf7RgmR7VKt4uLmvdLom+NZdVWfJxrvtG51igwzfNf fTeo18sqvfxhOt8mp0j2AEZPy1Bxvj9z9A2NQSvaSWYYwhL13a8b/1Q6m9szxw4b/SeX kQi5bi9s79fnx2BjLpXvI/75MPKqT0J6kZ6eb4g7xarSB9lQBQVU4LFuObmgqwEpK0E4 E6ZjxhRrSQxLJDdk6RdPfReEyLLx1Ea2R9XqtJhWCRl00hzO21i/OAZGLCvKAVxDP9qY EpkQ== X-Gm-Message-State: AHYfb5gkjq1ofi/WHOdpmwdHeLf3argji21H2VkmH6hRVnMdus8UbViq XX99f8HFXLa1J0zU X-Received: by 10.28.142.74 with SMTP id q71mr4596993wmd.25.1501966407181; Sat, 05 Aug 2017 13:53:27 -0700 (PDT) Received: from localhost.localdomain ([160.77.147.147]) by smtp.gmail.com with ESMTPSA id v62sm2601775wmd.2.2017.08.05.13.53.24 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sat, 05 Aug 2017 13:53:26 -0700 (PDT) From: Ard Biesheuvel To: linux-arm-kernel@lists.infradead.org, linux-renesas-soc@vger.kernel.org, linux@armlinux.org.uk, linux-omap@vger.kernel.org, kvm@vger.kernel.org, kvmarm@lists.cs.columbia.edu, krzk@kernel.org, jason@lakedaemon.net, arm@kernel.org, andrew@lunn.ch, gregory.clement@free-electrons.com, sebastian.hesselbarth@gmail.com, tony@atomide.com, baohua@kernel.org, horms@verge.net.au, magnus.damm@gmail.com, vireshk@kernel.org, shiraz.linux.kernel@gmail.com, patrice.chotard@st.com, nico@linaro.org, dave.martin@arm.com, marc.zyngier@arm.com Cc: Ard Biesheuvel Subject: [PATCH 06/15] ARM: sleep.S: use PC-relative insn sequence for sleep_save_sp/mpidr_hash Date: Sat, 5 Aug 2017 21:52:13 +0100 Message-Id: <20170805205222.19868-7-ard.biesheuvel@linaro.org> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20170805205222.19868-1-ard.biesheuvel@linaro.org> References: <20170805205222.19868-1-ard.biesheuvel@linaro.org> Sender: linux-omap-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-omap@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Replace the open coded PC relative offset calculations with adr_l and ldr_l invocations. Signed-off-by: Ard Biesheuvel --- arch/arm/kernel/sleep.S | 16 +++------------- 1 file changed, 3 insertions(+), 13 deletions(-) diff --git a/arch/arm/kernel/sleep.S b/arch/arm/kernel/sleep.S index 0f6c1000582c..3026b119d3ff 100644 --- a/arch/arm/kernel/sleep.S +++ b/arch/arm/kernel/sleep.S @@ -137,9 +137,8 @@ ARM_BE8(setend be) @ ensure we are in BE mode mov r1, #0 ALT_SMP(mrc p15, 0, r0, c0, c0, 5) ALT_UP_B(1f) - adr r2, mpidr_hash_ptr - ldr r3, [r2] - add r2, r2, r3 @ r2 = struct mpidr_hash phys address + adr_l r2, mpidr_hash @ r2 = struct mpidr_hash phys address + /* * This ldmia relies on the memory layout of the mpidr_hash * struct mpidr_hash. @@ -147,10 +146,7 @@ ARM_BE8(setend be) @ ensure we are in BE mode ldmia r2, { r3-r6 } @ r3 = mpidr mask (r4,r5,r6) = l[0,1,2] shifts 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_l r0, sleep_save_sp + SLEEP_SAVE_SP_PHYS ldr r0, [r0, r1, lsl #2] @ load phys pgd, stack, resume fn @@ -164,12 +160,6 @@ ENDPROC(cpu_resume) ENDPROC(cpu_resume_arm) #endif - .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)