From mboxrd@z Thu Jan 1 00:00:00 1970 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=-17.5 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED, 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 0CB1EC4338F for ; Thu, 29 Jul 2021 15:33:27 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id C541460F43 for ; Thu, 29 Jul 2021 15:33:26 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org C541460F43 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=arm.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:MIME-Version:List-Subscribe:List-Help: List-Post:List-Archive:List-Unsubscribe:List-Id:References:In-Reply-To: Message-Id:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=PdQW7ClqD0s/V/muNGgsknW2drsx7EZyX4tBUBtrUSM=; b=CKMQ8HCsBAc6/V UktoBTd97LP/TrPgY8eCI1f2IQuVej+BLyvSiPfJJL6lQVrEwDpNINSxNA5kC1Os9nXU4tathHKID POtQiO7ABcevMzbuiGr6PE+r7HGtKivSyODGDP+G9yP8GnQGsWsRWYygdf4yMhcxnmO9oCH7+hDZX s7qeB9yqbxbKM9MLkM1f9EiZoTno2OsSeLCg4vTNRCzSPeZxbvdI8UGYKSXJT1zn12yWS2mnBYwef M1VvI6bNC4unZOpUB2HB7X31A+6SoMVqGOXbigR1pot4o873CLQ9WeFTmTPC0W5BiSkhH63FuhvZ8 7vmf5m7ehfQpRSkybnfA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1m97zC-004iyg-IW; Thu, 29 Jul 2021 15:30:15 +0000 Received: from foss.arm.com ([217.140.110.172]) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1m97qQ-004gdP-JZ for linux-arm-kernel@lists.infradead.org; Thu, 29 Jul 2021 15:21:16 +0000 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 60680D6E; Thu, 29 Jul 2021 08:21:09 -0700 (PDT) Received: from lakrids.cambridge.arm.com (usa-sjc-imap-foss1.foss.arm.com [10.121.207.14]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPA id 92D933F73D; Thu, 29 Jul 2021 08:21:08 -0700 (PDT) From: Mark Rutland To: linux-arm-kernel@lists.infradead.org Cc: Andre.Przywara@arm.com, Jaxson.Han@arm.com, mark.rutland@arm.com, Wei.Chen@arm.com Subject: [boot-wrapper PATCH 09/12] Cleanup `.globl` usage Date: Thu, 29 Jul 2021 16:20:47 +0100 Message-Id: <20210729152050.23635-10-mark.rutland@arm.com> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20210729152050.23635-1-mark.rutland@arm.com> References: <20210729152050.23635-1-mark.rutland@arm.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210729_082110_836319_70150FFA X-CRM114-Status: GOOD ( 15.07 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org In some places we use `ENTRY()` to mark an assembly function, whereas in others we just use `.globl`. Where we use `.globl` for functions or data, we don't keep this close to the actual definition. Further, `ENTRY()` is a keyword in linker script with a different meaning, and so it would be nicer if we didn't use the same term in the assembly files. This patch adds `ASM_FUNC()` and `ASM_DATA()` markers, and uses them consistently throughout the codebase. Signed-off-by: Mark Rutland --- arch/aarch32/boot.S | 4 ++-- arch/aarch32/psci.S | 4 ++-- arch/aarch32/stack.S | 11 +++-------- arch/aarch32/utils.S | 4 ++-- arch/aarch64/boot.S | 8 +++----- arch/aarch64/psci.S | 9 +++------ arch/aarch64/spin.S | 8 +++----- arch/aarch64/stack.S | 11 ++++------- arch/aarch64/utils.S | 9 +++------ include/linkage.h | 6 +++++- 10 files changed, 30 insertions(+), 44 deletions(-) diff --git a/arch/aarch32/boot.S b/arch/aarch32/boot.S index 0bd1ca2..15e51d4 100644 --- a/arch/aarch32/boot.S +++ b/arch/aarch32/boot.S @@ -16,7 +16,7 @@ .arch_extension virt .section .init -ENTRY(_start) +ASM_FUNC(_start) /* Stack initialisation */ cpuid r0, r1 bl find_logical_id @@ -67,7 +67,7 @@ _spin_dead: * r0: kernel address * r1-r3, sp[0]: kernel arguments */ -ENTRY(jump_kernel) +ASM_FUNC(jump_kernel) sub sp, #4 @ Ignore fourth argument push {r0 - r3} mov r5, sp diff --git a/arch/aarch32/psci.S b/arch/aarch32/psci.S index 0b7663e..dc7aeb7 100644 --- a/arch/aarch32/psci.S +++ b/arch/aarch32/psci.S @@ -38,12 +38,12 @@ handle_smc: pop {r4 - r12, lr} movs pc, lr -ENTRY(start_el3) +ASM_FUNC(start_el3) ldr r0, =smc_vectors blx setup_vector /* pass through */ -ENTRY(start_no_el3) +ASM_FUNC(start_no_el3) /* * For no-el3, we assume that firmware launched the boot-wrapper in * non-secure EL2 or EL1. We assume it has its own PSCI implementation diff --git a/arch/aarch32/stack.S b/arch/aarch32/stack.S index 59f3f52..ac6885b 100644 --- a/arch/aarch32/stack.S +++ b/arch/aarch32/stack.S @@ -6,18 +6,13 @@ * Use of this source code is governed by a BSD-style license that can be * found in the LICENSE.txt file. */ - - .globl setup_stack - .globl stack_top - .globl stack_bottom - .text /* * Setup initial stack pointer * r0: logical CPU ID * Clobbers r1 and r2 */ -setup_stack: +ASM_FUNC(setup_stack) mov r1, #STACK_SIZE ldr r2, =stack_top mls sp, r0, r1, r2 @@ -25,8 +20,8 @@ setup_stack: .section .stack .align 2 -stack_bottom: +ASM_DATA(stack_bottom) .irp cpu, CPU_IDS .space STACK_SIZE .endr -stack_top: +ASM_DATA(stack_top) diff --git a/arch/aarch32/utils.S b/arch/aarch32/utils.S index 53d8747..5809f48 100644 --- a/arch/aarch32/utils.S +++ b/arch/aarch32/utils.S @@ -18,7 +18,7 @@ * Returns MPIDR_INVALID for unknown MPIDRs * Clobbers r1, r2, r3. */ -ENTRY(find_logical_id) +ASM_FUNC(find_logical_id) ldr r2, =id_table mov r1, #0 1: mov r3, #NR_CPUS @@ -40,7 +40,7 @@ ENTRY(find_logical_id) * Setup EL3 vectors. * r0: vector address */ -ENTRY(setup_vector) +ASM_FUNC(setup_vector) mcr p15, 0, r0, c12, c0, 1 @ MVBAR isb bx lr diff --git a/arch/aarch64/boot.S b/arch/aarch64/boot.S index fae0188..ca73bcd 100644 --- a/arch/aarch64/boot.S +++ b/arch/aarch64/boot.S @@ -6,15 +6,13 @@ * Use of this source code is governed by a BSD-style license that can be * found in the LICENSE.txt file. */ +#include #include "common.S" .section .init - .globl _start - .globl jump_kernel - -_start: +ASM_FUNC(_start) cpuid x0, x1 bl find_logical_id cmp x0, #MPIDR_INVALID @@ -119,7 +117,7 @@ err_invalid_id: * x0: entry address * x1-x4: arguments */ -jump_kernel: +ASM_FUNC(jump_kernel) mov x19, x0 mov x20, x1 mov x21, x2 diff --git a/arch/aarch64/psci.S b/arch/aarch64/psci.S index 6dbca11..8bd224b 100644 --- a/arch/aarch64/psci.S +++ b/arch/aarch64/psci.S @@ -6,6 +6,7 @@ * Use of this source code is governed by a BSD-style license that can be * found in the LICENSE.txt file. */ +#include #include #include "common.S" @@ -45,9 +46,6 @@ vector: .text - .globl start_no_el3 - .globl start_el3 - err_exception: b err_exception @@ -81,8 +79,7 @@ smc_exit: ldp x18, x19, [sp], #16 eret - -start_el3: +ASM_FUNC(start_el3) ldr x0, =vector bl setup_vector @@ -95,7 +92,7 @@ start_el3: * This PSCI implementation requires EL3. Without EL3 we'll only boot the * primary cpu, all others will be trapped in an infinite loop. */ -start_no_el3: +ASM_FUNC(start_no_el3) cpuid x0, x1 bl find_logical_id cbz x0, psci_first_spin diff --git a/arch/aarch64/spin.S b/arch/aarch64/spin.S index ca05937..1ea1c0b 100644 --- a/arch/aarch64/spin.S +++ b/arch/aarch64/spin.S @@ -6,16 +6,14 @@ * Use of this source code is governed by a BSD-style license that can be * found in the LICENSE.txt file. */ +#include #include "common.S" .text - .globl start_no_el3 - .globl start_el3 - -start_el3: -start_no_el3: +ASM_FUNC(start_el3) +ASM_FUNC(start_no_el3) cpuid x0, x1 bl find_logical_id diff --git a/arch/aarch64/stack.S b/arch/aarch64/stack.S index 8fb38ba..c89c388 100644 --- a/arch/aarch64/stack.S +++ b/arch/aarch64/stack.S @@ -6,10 +6,7 @@ * Use of this source code is governed by a BSD-style license that can be * found in the LICENSE.txt file. */ - - .globl setup_stack - .globl stack_top - .globl stack_bottom +#include .text /* @@ -17,7 +14,7 @@ * x0: logical CPU ID * Clobbers x1 and x2 */ -setup_stack: +ASM_FUNC(setup_stack) mov w1, #STACK_SIZE ldr x2, =stack_top umsubl x0, w0, w1, x2 // sp = st_base - cpu * st_size @@ -26,8 +23,8 @@ setup_stack: .section .stack .align 4 -stack_bottom: +ASM_DATA(stack_bottom) .irp cpu, CPU_IDS .space STACK_SIZE .endr -stack_top: +ASM_DATA(stack_top) diff --git a/arch/aarch64/utils.S b/arch/aarch64/utils.S index ae22ea7..85c7f8a 100644 --- a/arch/aarch64/utils.S +++ b/arch/aarch64/utils.S @@ -6,11 +6,8 @@ * Use of this source code is governed by a BSD-style license that can be * found in the LICENSE.txt file. */ - #include - - .globl find_logical_id - .globl setup_vector +#include .text @@ -20,7 +17,7 @@ * Sets the Z flag when CPU is primary * Clobbers x1, x2, x3 */ -find_logical_id: +ASM_FUNC(find_logical_id) ldr x2, =id_table mov x1, xzr 1: mov x3, #NR_CPUS // check we haven't walked off the end of the array @@ -40,7 +37,7 @@ find_logical_id: * Setup EL3 vectors * x0: vector address */ -setup_vector: +ASM_FUNC(setup_vector) msr VBAR_EL3, x0 isb ret diff --git a/include/linkage.h b/include/linkage.h index 844a811..db8b204 100644 --- a/include/linkage.h +++ b/include/linkage.h @@ -13,10 +13,14 @@ #ifdef __ASSEMBLY__ -#define ENTRY(name) \ +#define ASM_FUNC(name) \ .globl name; \ .type name, %function; \ name: +#define ASM_DATA(name) \ + .globl name; \ + name: + #endif /* __ASSEMBLY__ */ #endif -- 2.11.0 _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel