From patchwork Mon Nov 9 12:55:03 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg KH X-Patchwork-Id: 320910 Delivered-To: patch@linaro.org Received: by 2002:a92:7b12:0:0:0:0:0 with SMTP id w18csp1723003ilc; Mon, 9 Nov 2020 05:12:49 -0800 (PST) X-Google-Smtp-Source: ABdhPJzIQB76ukO/ZkAzsXGC11Dh0oqGJB7C5hGlB40pIXPlKxtGHB67HrcGCvq1Vpur46djl/YK X-Received: by 2002:a17:906:1614:: with SMTP id m20mr14563820ejd.258.1604927569677; Mon, 09 Nov 2020 05:12:49 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1604927569; cv=none; d=google.com; s=arc-20160816; b=sRDW/71jSHvPcwE93FyPl6SDna+YsbUXKjbuINvyunu8Krhg7MjW9PcWWxWPJKuk+M BEVjOJrTQcKsGpVBI9pz1j0Msp86Lb80EuUQhj7Oz2HAjWkrYurhU3Ijy5pBuy10a5th Vt7xQmdWkBXM7usBzP+Z2HKaIxOMTXx0f7RnJ/neua/eRefiRf745t20OfiMQ+IfvaMO 3KW49rFDUYyF+ALi4IdIQAbCcBBOcjsr+DVn3ItdIeRM0LiAMsGKzXUpfIGoX0FtLTiK e+qRG/BHByp2pziJebk8fCwEiZBIETa6Hpai8JNLoqahFxJ5nAM1reCpjXDweCvwE5QH aFLg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=24YFnqzdwkXSd07T0f38czigQB87CFru3PDJhkW98fM=; b=sznEGqUkrQ80kGzmuso3+0UsHFVr9A1bM1MoSpTqo7yMrMPkV9qPVsNBpaZNGeBT6l uout9Sql/+RoqD+ELmtS+AhwfmTMXpBzi/Mqyt1enfzwwjRKdQFzabExNkamW1uZo4EZ IGv5KwbeB6WlI5hpNUy2OSzAuDu5BTgigh+uTrK27g//yGnn0fFp6ED0935jbq32SFYe De3O1t74vuIJQCe5uJZUetF4GtfDS0BGaE1f3Kqq7rcxM2DMBo0ASFtjWb07nG4XXxK2 LSSppYe8VgmKbOa325eWHEEwTEm936awWGIEEXWiNkNohn+baonqkY9t+d1ohVAE4qR6 KS7A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b="V/mUmrvO"; spf=pass (google.com: domain of stable-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=stable-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id di27si6891321edb.486.2020.11.09.05.12.49; Mon, 09 Nov 2020 05:12:49 -0800 (PST) Received-SPF: pass (google.com: domain of stable-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b="V/mUmrvO"; spf=pass (google.com: domain of stable-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=stable-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731917AbgKINMs (ORCPT + 15 others); Mon, 9 Nov 2020 08:12:48 -0500 Received: from mail.kernel.org ([198.145.29.99]:38426 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1731702AbgKINMo (ORCPT ); Mon, 9 Nov 2020 08:12:44 -0500 Received: from localhost (83-86-74-64.cable.dynamic.v4.ziggo.nl [83.86.74.64]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 6288420789; Mon, 9 Nov 2020 13:12:42 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1604927562; bh=Ijt2dyziR77eHjXfyZfowT0wt48JJFm+4TmuKig9Gcg=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=V/mUmrvOht+cw8eVViPpxBrSnWU/fmNcxcpoKfqqHe+EHYUWprAL3BUtrlI4Lb1wj tYzkU78ERj/PQdpHDkDgK2EbAaCkXawKZiqstG/TUpWG8omCVvhUbnWwdUxy/ZwVbt +oW5oRYYxJ9JvH/x/ziOYAJdwjPedNLFHJ5J7lH0= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Mark Brown , Will Deacon , Jian Cai Subject: [PATCH 5.4 06/85] arm64: asm: Add new-style position independent function annotations Date: Mon, 9 Nov 2020 13:55:03 +0100 Message-Id: <20201109125022.921210756@linuxfoundation.org> X-Mailer: git-send-email 2.29.2 In-Reply-To: <20201109125022.614792961@linuxfoundation.org> References: <20201109125022.614792961@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org From: Mark Brown commit 35e61c77ef386555f3df1bc2057098c6997ca10b upstream. As part of an effort to make the annotations in assembly code clearer and more consistent new macros have been introduced, including replacements for ENTRY() and ENDPROC(). On arm64 we have ENDPIPROC(), a custom version of ENDPROC() which is used for code that will need to run in position independent environments like EFI, it creates an alias for the function with the prefix __pi_ and then emits the standard ENDPROC. Add new-style macros to replace this which expand to the standard SYM_FUNC_*() and SYM_FUNC_ALIAS_*(), resulting in the same object code. These are added in linkage.h for consistency with where the generic assembler code has its macros. Signed-off-by: Mark Brown [will: Rename 'WEAK' macro, use ';' instead of ASM_NL, deprecate ENDPIPROC] Signed-off-by: Will Deacon Cc: Jian Cai Signed-off-by: Greg Kroah-Hartman --- arch/arm64/include/asm/assembler.h | 1 + arch/arm64/include/asm/linkage.h | 16 ++++++++++++++++ 2 files changed, 17 insertions(+) --- a/arch/arm64/include/asm/assembler.h +++ b/arch/arm64/include/asm/assembler.h @@ -462,6 +462,7 @@ USER(\label, ic ivau, \tmp2) // invali .endm /* + * Deprecated! Use SYM_FUNC_{START,START_WEAK,END}_PI instead. * Annotate a function as position independent, i.e., safe to be called before * the kernel virtual mapping is activated. */ --- a/arch/arm64/include/asm/linkage.h +++ b/arch/arm64/include/asm/linkage.h @@ -4,4 +4,20 @@ #define __ALIGN .align 2 #define __ALIGN_STR ".align 2" +/* + * Annotate a function as position independent, i.e., safe to be called before + * the kernel virtual mapping is activated. + */ +#define SYM_FUNC_START_PI(x) \ + SYM_FUNC_START_ALIAS(__pi_##x); \ + SYM_FUNC_START(x) + +#define SYM_FUNC_START_WEAK_PI(x) \ + SYM_FUNC_START_ALIAS(__pi_##x); \ + SYM_FUNC_START_WEAK(x) + +#define SYM_FUNC_END_PI(x) \ + SYM_FUNC_END(x); \ + SYM_FUNC_END_ALIAS(__pi_##x) + #endif