From patchwork Sat Aug 5 20:52:11 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ard Biesheuvel X-Patchwork-Id: 9883335 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 A246C60392 for ; Sat, 5 Aug 2017 20:53:42 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 94504286CC for ; Sat, 5 Aug 2017 20:53:42 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 892B1287B9; Sat, 5 Aug 2017 20:53:42 +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.8 required=2.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_HI,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 3063F286CC for ; Sat, 5 Aug 2017 20:53:42 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752713AbdHEUx2 (ORCPT ); Sat, 5 Aug 2017 16:53:28 -0400 Received: from mail-wr0-f172.google.com ([209.85.128.172]:34060 "EHLO mail-wr0-f172.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751519AbdHEUxV (ORCPT ); Sat, 5 Aug 2017 16:53:21 -0400 Received: by mail-wr0-f172.google.com with SMTP id 12so27171838wrb.1 for ; Sat, 05 Aug 2017 13:53:21 -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=smB7+/ftor91JOGfrg55i5EDQc5Fj3QoDW7QAxSNp94=; b=CvL9zWh3Z+N/BHL7Bk1jeDxYxAhZfS4ac/wJ1sPuDmCQAhGpMpcTIufFVpHzfTAeQr QFAynJbhh6baayr4TEcPbSErRi3P9kGRl28mCUtF3FJ3lLrF57HJGXfVZeUC+Dcs1rp8 nOcCeJlrpZKIe59Tqb+MRDEAqFteHQnolaT7U= 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=smB7+/ftor91JOGfrg55i5EDQc5Fj3QoDW7QAxSNp94=; b=ckyjgXYD49rjuRL6pJlFPBylrmBUyHAN78/Diir8ZDzMFPOEQdw+wUOLnCaMuedxKi II/hBY4ldQxvXyG6udq+Rg2EVpvYw7Q/obe5gQE9w2ahShED2WtB3cd7fpvcK1HfRpcI O8OlhT9+jpdkUmHeZ45m64XnvBvIt608170VG3KlFS/ZxG9bFnai8KrGp1Td6LwLutLz iOVuwD1Zfw3fEfDvlIjUGSzE7OE21JKO0MmiJZjfIyB6G1jez6EtYlfFJA4XigcLiZ8a vvq/7wIvXOeDd3OpPZ6JJFCiddw4eXasZRyEJpZUxXHJehwJFTami0g0FAwsKurerHv0 e6WA== X-Gm-Message-State: AIVw111HI71qBIZiVW98oyVpjr8xsQY9pG6UUjAUCiC8l8bHbyJCvBRx lQ4d+Dd31BA5lTtu X-Received: by 10.223.134.26 with SMTP id 26mr5064482wrv.268.1501966400685; Sat, 05 Aug 2017 13:53:20 -0700 (PDT) Received: from localhost.localdomain ([160.77.147.147]) by smtp.gmail.com with ESMTPSA id v62sm2601775wmd.2.2017.08.05.13.53.17 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sat, 05 Aug 2017 13:53:19 -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 04/15] ARM: head.S: use PC-relative insn sequence for secondary_data Date: Sat, 5 Aug 2017 21:52:11 +0100 Message-Id: <20170805205222.19868-5-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/head.S | 19 ++++--------------- 1 file changed, 4 insertions(+), 15 deletions(-) diff --git a/arch/arm/kernel/head.S b/arch/arm/kernel/head.S index 0a98aec0e39d..6e9df3663a57 100644 --- a/arch/arm/kernel/head.S +++ b/arch/arm/kernel/head.S @@ -386,10 +386,8 @@ ENTRY(secondary_startup) /* * Use the page tables supplied from __cpu_up. */ - adr r4, __secondary_data - ldmia r4, {r5, r7, r12} @ address to jump to after - sub lr, r4, r5 @ mmu has been enabled - add r3, r7, lr + adr_l r3, secondary_data + mov_l r12, __secondary_switched ldrd r4, [r3, #0] @ get secondary_data.pgdir ARM_BE8(eor r4, r4, r5) @ Swap r5 and r4 in BE: ARM_BE8(eor r5, r4, r5) @ it can be done in 3 steps @@ -404,22 +402,13 @@ ARM_BE8(eor r4, r4, r5) @ without using a temp reg. ENDPROC(secondary_startup) ENDPROC(secondary_startup_arm) - /* - * r6 = &secondary_data - */ ENTRY(__secondary_switched) - ldr sp, [r7, #12] @ get secondary_data.stack + ldr_l r7, secondary_data + 12 @ get secondary_data.stack + mov sp, r7 mov fp, #0 b secondary_start_kernel ENDPROC(__secondary_switched) - .align - - .type __secondary_data, %object -__secondary_data: - .long . - .long secondary_data - .long __secondary_switched #endif /* defined(CONFIG_SMP) */