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 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 smtp.lore.kernel.org (Postfix) with ESMTPS id A75B6C48BF6 for ; Mon, 4 Mar 2024 09:26:19 +0000 (UTC) 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:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:References: Message-ID:Subject:Cc:To:From:Date:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=JX+b3WgxjUfLOguS1dDMpjVYONdP7WNbytcAu7COPRA=; b=HFa0bOEVii+Qw+ rQ6s3UJmcJWVD4HkiBIf+mcnf2uc0tdJh917RY8aRo1VnYK2X+TcQPJ3WC8kPUX1FTIHit5sIcD5C 8SFmUgPE6hSTxFuRo7mRSHMWKTv1Af64u++SqH0kR5PbgxxaOjP0VcAgXv5V7w9/7O9SBSUX5zIre t8flxx6DxyY4UMPCSxPy1hVMtFTST9MGO4dvy00lj3l/spCfSAtxjNCm4pJWCJYCjlVAqgI+4kzIy RVWUYVjvNObkccv+4UskDbG7CUNnNwmwqGn182sQhopqgtMMekqMrxoidlZNi3Plrvcwfg4ZjM6X8 2LKZc7j20zhJhyGS8nRg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1rh4aI-00000008NVD-1lV2; Mon, 04 Mar 2024 09:26:10 +0000 Received: from foss.arm.com ([217.140.110.172]) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1rh4a1-00000008NJa-0JnC for linux-arm-kernel@lists.infradead.org; Mon, 04 Mar 2024 09:26:02 +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 B862E1FB; Mon, 4 Mar 2024 01:26:25 -0800 (PST) Received: from FVFF77S0Q05N (unknown [10.57.69.81]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id A02EB3F762; Mon, 4 Mar 2024 01:25:47 -0800 (PST) Date: Mon, 4 Mar 2024 09:25:38 +0000 From: Mark Rutland To: Puranjay Mohan Cc: catalin.marinas@arm.com, will@kernel.org, anshuman.khandual@arm.com, ardb@kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] arm64: head: remove unnecessary instructions from __relocate_kernel Message-ID: References: <20240302145210.65919-1-puranjay12@gmail.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20240302145210.65919-1-puranjay12@gmail.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240304_012553_308621_1015DEBB X-CRM114-Status: GOOD ( 19.39 ) 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: , 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 On Sat, Mar 02, 2024 at 02:52:10PM +0000, Puranjay Mohan wrote: > Formerly, we had to access the RELA and RELR tables via the kernel > mapping that was being relocated, and so deriving the start and end > addresses was done by loading __rela_offset in x9 and then adding the > actual virtual offset of the kernel to it. > > d7bea550279d ("arm64: head: use relative references to the RELA and RELR > tables") changed this to load the entries via the ID map as we map the > entire kernel image via the ID map. > > The two instructions for finding the actual virtual offset were left by > that commit, so remove them now as they are unnecessary and add runtime > overhead. These instructions are already gone in linux-next; they're removed by commit: 734958ef0b5497b1 ("arm64: head: move relocation handling to C code") ... so this patch isn't necessary. > Fixes: d7bea550279d ("arm64: head: use relative references to the RELA and RELR tables") As a heads-up for future patches, while this would be a cleanup it is not a fix, and wouldn't need a fixes tag. Mark. > Signed-off-by: Puranjay Mohan > --- > arch/arm64/kernel/head.S | 2 -- > 1 file changed, 2 deletions(-) > > diff --git a/arch/arm64/kernel/head.S b/arch/arm64/kernel/head.S > index cab7f91949d8..90db196f7c19 100644 > --- a/arch/arm64/kernel/head.S > +++ b/arch/arm64/kernel/head.S > @@ -787,8 +787,6 @@ SYM_FUNC_START_LOCAL(__relocate_kernel) > */ > adr_l x9, __rela_start > adr_l x10, __rela_end > - mov_q x11, KIMAGE_VADDR // default virtual offset > - add x11, x11, x23 // actual virtual offset > > 0: cmp x9, x10 > b.hs 1f > > base-commit: 5ad3cb0ed525b80c7f66c32b49a68c1f3510bec9 > -- > 2.42.0 > _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel