From patchwork Wed Aug 3 15:38:50 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ard Biesheuvel X-Patchwork-Id: 73217 Delivered-To: patch@linaro.org Received: by 10.140.29.52 with SMTP id a49csp924378qga; Wed, 3 Aug 2016 08:43:13 -0700 (PDT) X-Received: by 10.66.140.103 with SMTP id rf7mr114128179pab.75.1470238993895; Wed, 03 Aug 2016 08:43:13 -0700 (PDT) Return-Path: Received: from bombadil.infradead.org (bombadil.infradead.org. [2001:1868:205::9]) by mx.google.com with ESMTPS id y24si9378632pff.12.2016.08.03.08.43.13 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 03 Aug 2016 08:43:13 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-arm-kernel-bounces+patch=linaro.org@lists.infradead.org designates 2001:1868:205::9 as permitted sender) client-ip=2001:1868:205::9; Authentication-Results: mx.google.com; dkim=neutral (body hash did not verify) header.i=@linaro.org; spf=pass (google.com: best guess record for domain of linux-arm-kernel-bounces+patch=linaro.org@lists.infradead.org designates 2001:1868:205::9 as permitted sender) smtp.mailfrom=linux-arm-kernel-bounces+patch=linaro.org@lists.infradead.org; dmarc=fail (p=NONE dis=NONE) header.from=linaro.org Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.85_2 #1 (Red Hat Linux)) id 1bUyJ2-0000DE-57; Wed, 03 Aug 2016 15:42:04 +0000 Received: from mail-wm0-x22d.google.com ([2a00:1450:400c:c09::22d]) by bombadil.infradead.org with esmtps (Exim 4.85_2 #1 (Red Hat Linux)) id 1bUyGV-00055g-90 for linux-arm-kernel@lists.infradead.org; Wed, 03 Aug 2016 15:39:32 +0000 Received: by mail-wm0-x22d.google.com with SMTP id o80so342294077wme.1 for ; Wed, 03 Aug 2016 08:39:10 -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=8bfiLyxDXwK8XzKo4w38FTRn2MY/sjtR4E6z5l/XDls=; b=hHki0u1TgaU9o/gMv2yf/6Pl8H/r9A51a6G7JvI2VPN/c4kc3mLInHRlv/qWnOi8J+ 2Aww+71XS8KC8Sh1DoQN73s+DZCqXVsfNG4Q7m4rq7+1QWkxyPxH523/48fWUB10DVo4 frqgfC7Q1w6TmebffAXLdw1R3EzIVHHrfOtSw= 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=8bfiLyxDXwK8XzKo4w38FTRn2MY/sjtR4E6z5l/XDls=; b=LWCF6nFfcC1Dc7ev4BTorqv3MV2mMDWM60rYZ0jCFK8mPsD1Tetcv88bNcG/MtBaVq 5bOjLJk8t1mx1sWri/ydJhdNQ/hKM+LgE1NgEH3XVk/HMw6uPVESyiEUiKKV8M8DfNnn 8S1Ef+6nYvjFrsovAvKR8vGqEJsQDmbj1IagbSyKXepRodMGeurJzMv1XuZllDCmymRG ZvdWL5/8I1VYR77rqXiOZarlYU+/AHznLDoiQmVwo8tGpYGJJCKs1siUoAmG2hLSNj+H PoT4FKLcXaqz4Mcn0RgUMTrBwwxzOfRmARI7lqwcqtZF4G3Zap/UfKx8HR+bPlPfATZg ogEw== X-Gm-Message-State: AEkoout3PO5ohxpakG7XqGXPj5VcJ2B9B7TJVoBEkTYzXsZVV/PTKpjTob4ZAzAgRHpaePiB X-Received: by 10.194.192.195 with SMTP id hi3mr60587562wjc.108.1470238749241; Wed, 03 Aug 2016 08:39:09 -0700 (PDT) Received: from localhost.localdomain (3.red-81-34-118.dynamicip.rima-tde.net. [81.34.118.3]) by smtp.gmail.com with ESMTPSA id uo4sm8291402wjc.36.2016.08.03.08.39.07 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 03 Aug 2016 08:39:08 -0700 (PDT) From: Ard Biesheuvel To: linux-arm-kernel@lists.infradead.org, linux@arm.linux.org.uk, nico@linaro.org, arnd@arndb.de, dave.martin@arm.com Subject: [PATCH 8/8] ARM: head.S: use PC relative insn sequence to calculate PHYS_OFFSET Date: Wed, 3 Aug 2016 17:38:50 +0200 Message-Id: <1470238730-30038-9-git-send-email-ard.biesheuvel@linaro.org> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1470238730-30038-1-git-send-email-ard.biesheuvel@linaro.org> References: <1470238730-30038-1-git-send-email-ard.biesheuvel@linaro.org> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20160803_083927_556880_AF8DDE2D X-CRM114-Status: GOOD ( 10.03 ) X-Spam-Score: -2.7 (--) X-Spam-Report: SpamAssassin version 3.4.0 on bombadil.infradead.org summary: Content analysis details: (-2.7 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.7 RCVD_IN_DNSWL_LOW RBL: Sender listed at http://www.dnswl.org/, low trust [2a00:1450:400c:c09:0:0:0:22d listed in] [list.dnswl.org] -0.0 SPF_PASS SPF: sender matches SPF record -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Ard Biesheuvel MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patch=linaro.org@lists.infradead.org Replace the open coded arithmetic with a simple adr_l/sub pair. Signed-off-by: Ard Biesheuvel --- arch/arm/kernel/head.S | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) -- 2.7.4 _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel diff --git a/arch/arm/kernel/head.S b/arch/arm/kernel/head.S index b9746366b633..bd5a6151b3d7 100644 --- a/arch/arm/kernel/head.S +++ b/arch/arm/kernel/head.S @@ -106,10 +106,8 @@ ENTRY(stext) #endif #ifndef CONFIG_XIP_KERNEL - adr r3, 2f - ldmia r3, {r4, r8} - sub r4, r3, r4 @ (PHYS_OFFSET - PAGE_OFFSET) - add r8, r8, r4 @ PHYS_OFFSET + adr_l r8, _text + sub r8, r8, #TEXT_OFFSET @ PHYS_OFFSET #else ldr r8, =PLAT_PHYS_OFFSET @ always constant in this case #endif @@ -161,10 +159,6 @@ ENTRY(stext) 1: b __enable_mmu ENDPROC(stext) .ltorg -#ifndef CONFIG_XIP_KERNEL -2: .long . - .long PAGE_OFFSET -#endif /* * Setup the initial page tables. We only setup the barest