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: 109494 Delivered-To: patch@linaro.org Received: by 10.140.101.6 with SMTP id t6csp991865qge; Sat, 5 Aug 2017 13:53:45 -0700 (PDT) X-Received: by 10.84.239.22 with SMTP id w22mr8007130plk.90.1501966425275; Sat, 05 Aug 2017 13:53:45 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1501966425; cv=none; d=google.com; s=arc-20160816; b=KCMzOIJNUX99+DJoHUM+0txdwstFVR66dVsZybv3QW30FV2A4lHWUBpgDAzsggBgvO x/JON0gR+UISmNaCL6G3+eZHzeWO9IbbFbu4Mqn4dkVJfozxtENueStorU/q6YGG8M79 8+yHrxzOidt8fKD3V6ioQir8NBT0WrE/AzRylJzdcQeOqtAcwRx7WdDE3T2KXL5L7WTJ x5vf/JUwphXLjTySWiA3s/IVqlYVTU0j6i97uV9O+KrRkMZgaFvxhfLPPdUsGG/7OVbS ugx+iFrYxVVrpIv5QqYCGyqShL05BAeAoYbHEaIwBQMko/r1UIKyXfpCqDuKFEMNr7su Ipzg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:dkim-signature:arc-authentication-results; bh=/YgPCmkG7+GojHfTD57l8TFXDU6ngygNLxr9Gkyh93s=; b=naPzUgvYWH3IrTJhBeqnYaFDestTgoA8pHV/5/8JLvGvzc9EuevHLUJdnTKrtZ2zgB n/EZtw45ZRRa3Es4uVY05AC5mXNNSY41Ao1cRBuVzMCa25p5S0Bz8imCQXxeb+poMLh6 pSqhklPJQkcZv3wntpfeCzrDtnnTaLFIuGdRVGcQMsZH64B9FldI8eDRlMrKJ5Q3Eo3G HyaTLSdkZpuDGFYQiqxJc6qWG4N2ymlxtj6finNhg+NI0R5Q/edifc9AsOuxW0LIJSXA RS7IAC+w4t21gRWMk2LmBGeaCJSKOlAnuGBYhWI47gMoYsWX7W4cekvgMkSlbOGVp+Xq gm1w== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@linaro.org header.b=Sw1aUrcS; spf=pass (google.com: best guess record for domain of linux-omap-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-omap-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id e6si3018685plk.487.2017.08.05.13.53.45; Sat, 05 Aug 2017 13:53:45 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-omap-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=neutral (body hash did not verify) header.i=@linaro.org header.b=Sw1aUrcS; spf=pass (google.com: best guess record for domain of linux-omap-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-omap-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752771AbdHEUxl (ORCPT + 3 others); 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 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(-) -- 2.11.0 -- To unsubscribe from this list: send the line "unsubscribe linux-omap" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html 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)