From patchwork Mon Sep 14 09:57:02 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ard Biesheuvel X-Patchwork-Id: 254224 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-14.9 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, INCLUDES_PATCH, MAILING_LIST_MULTI, SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 61063C43461 for ; Mon, 14 Sep 2020 09:58:02 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 2259521BE5 for ; Mon, 14 Sep 2020 09:58:02 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1600077482; bh=NieCvGRheFFDbEqkhq2wZXvPlHLF2jc+r0dsBAFUpts=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=VvsUhyXAhJqFKaEu6nFrDhuheJ7QEC5M3CeszSn8db8VHAtoL1u0/MrrJC5D0djsQ nU1cteHlXhwz/g3BcAeZKHl0h5FzsC/j81sH08b2oWMRGzxGi4asp/SDZfqqZIe7By pYrTjFX4vdd3uMCXX5qmiDibDE/g+IR1XusJ4HP4= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726239AbgINJ6A (ORCPT ); Mon, 14 Sep 2020 05:58:00 -0400 Received: from mail.kernel.org ([198.145.29.99]:49162 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726344AbgINJ54 (ORCPT ); Mon, 14 Sep 2020 05:57:56 -0400 Received: from e123331-lin.nice.arm.com (unknown [37.6.197.50]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id CAF0620732; Mon, 14 Sep 2020 09:57:52 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1600077476; bh=NieCvGRheFFDbEqkhq2wZXvPlHLF2jc+r0dsBAFUpts=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=IrTJe8wuKdcrh7xrNMc0YSktFTDDzj+c+yI2G+rxxmUXFmnSKkCuEEhenYNlYa53F ichgvGT2PD2zpwx3Ft9oV9fdgmugIi3xY769bkJO9T1N8Iv7DlkOXZxq6Ki9WN1w1E l6La3wbzAz4w+QT/eYKCXYS8+czinU9wCbX2WOQ0= From: Ard Biesheuvel To: linux-efi@vger.kernel.org Cc: linux-arm-kernel@lists.infradead.org, Ard Biesheuvel , Russell King , Linus Walleij , Nicolas Pitre , Nick Desaulniers , Stefan Agner , Peter Smith , Marc Zyngier , Will Deacon Subject: [PATCH 08/12] ARM: head: use PC-relative insn sequence for __smp_alt Date: Mon, 14 Sep 2020 12:57:02 +0300 Message-Id: <20200914095706.3985-9-ardb@kernel.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200914095706.3985-1-ardb@kernel.org> References: <20200914095706.3985-1-ardb@kernel.org> Sender: linux-efi-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-efi@vger.kernel.org Now that calling __do_fixup_smp_on_up() can be done without passing the physical-to-virtual offset in r3, we can replace the open coded PC relative offset calculations with a pair of adr_l invocations. This removes some open coded arithmetic involving virtual addresses, avoids literal pools on v7+, and slightly reduces the footprint of the code. 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 3199d29f4480..5f6436a40db1 100644 --- a/arch/arm/kernel/head.S +++ b/arch/arm/kernel/head.S @@ -520,19 +520,11 @@ ARM_BE8(rev r0, r0) @ byteswap if big endian retne lr __fixup_smp_on_up: - adr r0, 1f - ldmia r0, {r3 - r5} - sub r3, r0, r3 - add r4, r4, r3 - add r5, r5, r3 + adr_l r4, __smpalt_begin + adr_l r5, __smpalt_end b __do_fixup_smp_on_up ENDPROC(__fixup_smp) - .align -1: .word . - .word __smpalt_begin - .word __smpalt_end - .pushsection .data .align 2 .globl smp_on_up