From patchwork Tue Nov 29 03:54:07 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: DongdongZhang X-Patchwork-Id: 1710013 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; spf=none (no SPF record) smtp.mailfrom=lists.infradead.org (client-ip=2607:7c80:54:3::133; helo=bombadil.infradead.org; envelope-from=opensbi-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org; receiver=) Authentication-Results: legolas.ozlabs.org; dkim=pass (2048-bit key; secure) header.d=lists.infradead.org header.i=@lists.infradead.org header.a=rsa-sha256 header.s=bombadil.20210309 header.b=sruS08TY; dkim-atps=neutral Received: from bombadil.infradead.org (bombadil.infradead.org [IPv6:2607:7c80:54:3::133]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-384) server-digest SHA384) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4NLpSP5wP5z23ng for ; Tue, 29 Nov 2022 14:57:09 +1100 (AEDT) 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=zJ2oCB4nIk6rq4O0aei2KrvxJgYHG81o1Fu6tln9XtQ=; b=sruS08TY4kfCsa J+BRKcu6QCAV43OSXXtuQ7fOPdQukGpoyei7gcz0f4EWcqXbMCSkHl4eK8qVq43O+MI+5DTfAWaxK 0l9hZc0jKMos/azgJssxB4Oa1L60MFO7HwfIjmKa7R4/vED/m7jR6lamcj08+/v4BABkU0YZ9yaO2 5rFY9Ty8F1I6Q7ACZCNypZeIAzsKWR7HFqa772vu4hO9GhRdkHmSgGQOOQBOxfjHwRHjn15P6bLjg 6EChAt8KjbzvYa9Uhn4xhI/Jh8mNLV+6WJiQZWqV7jhauiGN5PeRdxb1TFvxQfpYa0+rQF24Uaz2L g0+ZF/7kptiVvdxQ8LMg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1ozrjq-005tXV-98; Tue, 29 Nov 2022 03:56:54 +0000 Received: from zg8tmja5ljk3lje4ms43mwaa.icoremail.net ([209.97.181.73]) by bombadil.infradead.org with smtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1ozrjo-005tVM-4T for opensbi@lists.infradead.org; Tue, 29 Nov 2022 03:56:53 +0000 Received: from localhost.localdomain (unknown [10.12.130.38]) by app2 (Coremail) with SMTP id EggMCgCneC16goVjUfcTAA--.25050S5; Tue, 29 Nov 2022 11:54:34 +0800 (CST) From: Dongdong Zhang To: opensbi@lists.infradead.org Cc: Dongdong Zhang Subject: [PATCH 1/1] firmware: Minor optimization for relocate Date: Tue, 29 Nov 2022 11:54:07 +0800 Message-Id: <20221129035407.28946-2-zhangdongdong@eswincomputing.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20221129035407.28946-1-zhangdongdong@eswincomputing.com> References: <20221129035407.28946-1-zhangdongdong@eswincomputing.com> X-CM-TRANSID: EggMCgCneC16goVjUfcTAA--.25050S5 X-Coremail-Antispam: 1UD129KBjvdXoW7XFyrGFy7ZF18KrWxKw17ZFb_yoWxKwb_JF W0kFyv9wn0qryjqr1rurWrCryag3yrua1Fgr1Duay7Jay7GF909FyDuayUZan8WFsrKr95 ZFykZF9Fv3ZrtjkaLaAFLSUrUUUUUb8apTn2vfkv8UJUUUU8Yxn0WfASr-VFAUDa7-sFnT 9fnUUIcSsGvfJTRUUUbf8FF20E14v26r4j6ryUM7CY07I20VC2zVCF04k26cxKx2IYs7xG 6rWj6s0DM7CIcVAFz4kK6r1j6r18M28IrcIa0xkI8VA2jI8067AKxVWUGwA2048vs2IY02 0Ec7CjxVAFwI0_Jr4l8cAvFVAK0II2c7xJM28CjxkF64kEwVA0rcxSw2x7M28EF7xvwVC0 I7IYx2IY67AKxVW7JVWDJwA2z4x0Y4vE2Ix0cI8IcVCY1x0267AKxVW8Jr0_Cr1UM28EF7 xvwVC2z280aVAFwI0_GcCE3s1l84ACjcxK6I8E87Iv6xkF7I0E14v26rxl6s0DM2AIxVAI cxkEcVAq07x20xvEncxIr21l5I8CrVACY4xI64kE6c02F40Ex7xfMcIj6xIIjxv20xvE14 v26r1j6r18McIj6I8E87Iv67AKxVWUJVW8JwAm72CE4IkC6x0Yz7v_Jr0_Gr1lF7xvr2IY c2Ij64vIr41lF7I21c0EjII2zVCS5cI20VAGYxC7MxkIecxEwVCm-wCF04k20xvY0x0EwI xGrwCFx2IqxVCFs4IE7xkEbVWUJVW8JwC20s026c02F40E14v26r1j6r18MI8I3I0E7480 Y4vE14v26r106r1rMI8E67AF67kF1VAFwI0_Jrv_JF1lIxkGc2Ij64vIr41lIxAIcVC0I7 IYx2IY67AKxVWUJVWUCwCI42IY6xIIjxv20xvEc7CjxVAFwI0_Jr0_Gr1lIxAIcVCF04k2 6cxKx2IYs7xG6r1j6r1xMIIF0xvEx4A2jsIE14v26r1j6r4UMIIF0xvEx4A2jsIEc7CjxV AFwI0_Jr0_GrUvcSsGvfC2KfnxnUUI43ZEXa7VUbHqcUUUUUU== X-CM-SenderInfo: x2kd0wpgrqwvxrqjqvxvzl0uprps33xlqjhudrp/1tbiAQEFCmOE-PAQZgABsT X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20221128_195652_459118_DAFD3250 X-CRM114-Status: UNSURE ( 7.98 ) X-CRM114-Notice: Please train this message. X-Spam-Score: 0.0 (/) X-Spam-Report: Spam detection software, running on the system "bombadil.infradead.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see the administrator of that system for details. Content preview: The t3 register stores the address of _load_end. If relocation is not required, it is unnecessary to calculate the address of _load_end. This can reduce the operation time of two instructions. Signed-off-by: Dongdong Zhang --- firmware/fw_base.S | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) Content analysis details: (0.0 points, 5.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 SPF_PASS SPF: sender matches SPF record 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record X-BeenThere: opensbi@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 Sender: "opensbi" Errors-To: opensbi-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org The t3 register stores the address of _load_end. If relocation is not required, it is unnecessary to calculate the address of _load_end. This can reduce the operation time of two instructions. Signed-off-by: Dongdong Zhang Reviewed-by: Bin Meng Reviewed-by: Anup Patel --- firmware/fw_base.S | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/firmware/fw_base.S b/firmware/fw_base.S index 07be4c4..3f622b3 100644 --- a/firmware/fw_base.S +++ b/firmware/fw_base.S @@ -128,9 +128,9 @@ _relocate: REG_L t1, 0(t1) lla t2, _load_start REG_L t2, 0(t2) + beq t0, t2, _relocate_done sub t3, t1, t0 add t3, t3, t2 - beq t0, t2, _relocate_done lla t4, _relocate_done sub t4, t4, t2 add t4, t4, t0