From patchwork Sat Aug 5 20:52:10 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ard Biesheuvel X-Patchwork-Id: 9883317 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 98A42603B4 for ; Sat, 5 Aug 2017 20:53:28 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 8BBC4286CC for ; Sat, 5 Aug 2017 20:53:28 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 80663287C1; Sat, 5 Aug 2017 20:53:28 +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=-7.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, RCVD_IN_DNSWL_HI autolearn=unavailable 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 382FE2871C for ; Sat, 5 Aug 2017 20:53:28 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752697AbdHEUxX (ORCPT ); Sat, 5 Aug 2017 16:53:23 -0400 Received: from mail-wr0-f169.google.com ([209.85.128.169]:37435 "EHLO mail-wr0-f169.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752660AbdHEUxS (ORCPT ); Sat, 5 Aug 2017 16:53:18 -0400 Received: by mail-wr0-f169.google.com with SMTP id 33so27138901wrz.4 for ; Sat, 05 Aug 2017 13:53:17 -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=UjP01tbr0+U785R7Y/bWJ4Ge/bnZSzS/dsXQg2oOd7g=; b=Oq6tPsih7wDXmHZr39rBllBoYIPyGCDr/HHAvcTRlmIaxA2jkkUW3qm39k5Ib2V+Jn ADGifVvUgfCor6SeZQy2Gio9kd69ARO+ujKxwELP7PzbjF75cPl+wNgAV2Eq2N3VYQh/ cZ0hVIndrJ1Rk+O2C338qHLwBc+W59yqIRt74= 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=UjP01tbr0+U785R7Y/bWJ4Ge/bnZSzS/dsXQg2oOd7g=; b=EDL7KPrtItTIHhlmnaunzeOnGm60NJGI5XnRuOzT2qT/esOQFp1KmD4HMDMOMsA401 Ivj4wudETcVyzbWidizOdmJoSxTusGgRlDlqioItYOVNB9KCd/6AUXUZnwJSwdnBWSLc esPibIoltqCcUkatfTknXJ11m/00S88s+W37AI87RDK+gkQfm8QaRTv7Hmq9z2jGaH7o tLRWwQwwXuxmw3hNqPGf/d3L4se9tqbGWklYx+V0xs/Dq4p7BRDLfjkLeaCjAhm3Vga9 Wa9HFSHAAiPaR3Qz5/jFRxL/IUQsgFZkeBYy3QEPUKcOxyre7qLfLHSsD5qtSac/peaW I+JA== X-Gm-Message-State: AIVw112mD7Pc08cJkpo+fnD73j7uOzIOCynwK9eDrb2Fr0tEHL+6OglO qc7LgAfPgoDfcl7C X-Received: by 10.223.172.230 with SMTP id o93mr5071030wrc.273.1501966397092; Sat, 05 Aug 2017 13:53:17 -0700 (PDT) Received: from localhost.localdomain ([160.77.147.147]) by smtp.gmail.com with ESMTPSA id v62sm2601775wmd.2.2017.08.05.13.53.14 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sat, 05 Aug 2017 13:53:16 -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 03/15] ARM: head-common.S: use PC-relative insn sequence for __turn_mmu_on Date: Sat, 5 Aug 2017 21:52:10 +0100 Message-Id: <20170805205222.19868-4-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: kvm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: kvm@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Replace the open coded PC relative offset calculations with a pair of adr_l invocations. Signed-off-by: Ard Biesheuvel --- arch/arm/kernel/head.S | 12 ++---------- 1 file changed, 2 insertions(+), 10 deletions(-) diff --git a/arch/arm/kernel/head.S b/arch/arm/kernel/head.S index 04286fd9e09c..0a98aec0e39d 100644 --- a/arch/arm/kernel/head.S +++ b/arch/arm/kernel/head.S @@ -227,11 +227,8 @@ __create_page_tables: * Create identity mapping to cater for __enable_mmu. * This identity mapping will be removed by paging_init(). */ - adr r0, __turn_mmu_on_loc - ldmia r0, {r3, r5, r6} - sub r0, r0, r3 @ virt->phys offset - add r5, r5, r0 @ phys __turn_mmu_on - add r6, r6, r0 @ phys __turn_mmu_on_end + adr_l r5, __turn_mmu_on @ _pa(__turn_mmu_on) + adr_l r6, __turn_mmu_on_end @ _pa(__turn_mmu_on_end) mov r5, r5, lsr #SECTION_SHIFT mov r6, r6, lsr #SECTION_SHIFT @@ -354,11 +351,6 @@ __create_page_tables: ret lr ENDPROC(__create_page_tables) .ltorg - .align -__turn_mmu_on_loc: - .long . - .long __turn_mmu_on - .long __turn_mmu_on_end #if defined(CONFIG_SMP) .text