From patchwork Sat Aug 5 20:52:15 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ard Biesheuvel X-Patchwork-Id: 9883347 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 58D6A60392 for ; Sat, 5 Aug 2017 20:53:52 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 44B6F1FFEB for ; Sat, 5 Aug 2017 20:53:52 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 34B51287B9; Sat, 5 Aug 2017 20:53:52 +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 D6309286CC for ; Sat, 5 Aug 2017 20:53:51 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752790AbdHEUxs (ORCPT ); Sat, 5 Aug 2017 16:53:48 -0400 Received: from mail-wm0-f46.google.com ([74.125.82.46]:35070 "EHLO mail-wm0-f46.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752761AbdHEUxf (ORCPT ); Sat, 5 Aug 2017 16:53:35 -0400 Received: by mail-wm0-f46.google.com with SMTP id m85so42480804wma.0 for ; Sat, 05 Aug 2017 13:53:35 -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=5WQyT0WG5y7rV9xMOfN/zzzm++0D2SfRBebqJRnq+2g=; b=AzNI/lXkhN3bBVYoUgoq6xCjWG7+uhNT4iuVu3dHqOm6FrxYoP+/ndrWwt4l4CclLQ +GHkB98NdzgRtUiJChGRPsfklH/+6nCt3S3ZeCuV2C8U2bc/eJpkaBP71kLcX/WrgAhU 3jrlh4rVaO4jBs53gIebS/FBKNqK0U10sqjWQ= 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=5WQyT0WG5y7rV9xMOfN/zzzm++0D2SfRBebqJRnq+2g=; b=qYgvaN1Vg9L200CW5nlhFITW8OnlJ+Xana3SZHEFWj/5l5rb8aEyWuaVRK67d/5N/Y 155lOA/K88rT+vh8FNoOUqrfwSN6vameqc6nWvb/bCRepVgg6rk0HhhoBLkK02sDxRy4 zurWsfxcXSUvrHo1mLVD5XZmPuu8FeELzIlo4AKqrvCuQU58xLGAG0TLv1WkR9nfXoqY SDh9IEDratnR1mkTd0DObCHl6GVju6w94RZztCtfp3f5JpP4noZFtjACiXEwmPyll2wQ /tPsnKO61hquzej/fgfGDWUDpd0f2Wti/OhfcNab91PchYL6y/maGtfFFZ5xAr3k9OHn qmhQ== X-Gm-Message-State: AHYfb5griZDnT2QtqaGer/z7+zRgKlFOySVXgziRPLKSRQjZWxjiWW7P WMJFILD4KcQ7tBzlbvzd8Q== X-Received: by 10.28.180.8 with SMTP id d8mr4167339wmf.161.1501966414539; Sat, 05 Aug 2017 13:53:34 -0700 (PDT) Received: from localhost.localdomain ([160.77.147.147]) by smtp.gmail.com with ESMTPSA id v62sm2601775wmd.2.2017.08.05.13.53.30 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sat, 05 Aug 2017 13:53:33 -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 08/15] ARM: head.S: use PC relative insn sequence to calculate PHYS_OFFSET Date: Sat, 5 Aug 2017 21:52:15 +0100 Message-Id: <20170805205222.19868-9-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 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(-) diff --git a/arch/arm/kernel/head.S b/arch/arm/kernel/head.S index 939543e73874..e08a4623a980 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 @ __pa(_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