From patchwork Wed Jan 17 10:42:00 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Xiang W X-Patchwork-Id: 1887350 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org 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=N/OYj49V; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=126.com header.i=@126.com header.a=rsa-sha256 header.s=s110527 header.b=TQgWe7So; dkim-atps=neutral Authentication-Results: legolas.ozlabs.org; spf=none (no SPF record) smtp.mailfrom=lists.infradead.org (client-ip=198.137.202.133; helo=bombadil.infradead.org; envelope-from=opensbi-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org; receiver=patchwork.ozlabs.org) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (secp384r1) server-digest SHA384) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4TFMsV2nQyz23f6 for ; Wed, 17 Jan 2024 21:42:54 +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:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version: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=29ad46w1hyby0FWPmsSHGB2sMTs028ndjPDLkqnfues=; b=N/OYj49VcJhxe0 iA0U2/eFL7IPpHtfiN2qXaTqsnnVqsYbzk3MG50IFbaCpYCZ1Q3TgT6U8Ksisq7In0uwyy5Y0nTdX BBXXTJQs/IFvTCjkopd7xpn5aBoSDAoO2LjM0vHMoa3HX5DvzlBrSLIqgBTvKXHRiHAuhAglnVPYH EhXe6N0CwpVM6RAEGSgdd+XK/BgO7AP3bAU45N6yq+RA539AkUcO5ZuqDtrNZOJT1We50Rf4gkxXo iY7NJ3UBTSyECLJxAZOJUUDRRhq3PA3N4rJ7XifWFr1VO5uFo1lBNTL97uYezGjj+gaZNfr+F7UJX cgEV71xu4ku7k2dm9Ivg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1rQ3NS-00FJoG-1N; Wed, 17 Jan 2024 10:42:34 +0000 Received: from m16.mail.126.com ([220.197.31.8]) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1rQ3NM-00FJk5-0I for opensbi@lists.infradead.org; Wed, 17 Jan 2024 10:42:30 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=126.com; s=s110527; h=From:Subject:Date:Message-ID:MIME-Version; bh=sfcC4 JZfHJbIPyPg8/eFqjrf39H/Nwd0ESLb7KGbtf0=; b=TQgWe7SozCNadkx9PHa6h 1/bk4D9GPuotAQCoxFTP+DN/qIFuswuPNEgcLd5saVIm7iHJlLRKu30V5CoDa1Ty bAjq39JFHZOXduYUpCQbVvGxZeMZoD4NYp7w/Yg/5Ywp34Kn6VJ9ULwES+vJ/2+6 YstSgT9PDTKSCnKPPmkl3A= Received: from T490.lan (unknown [112.83.182.118]) by gzga-smtp-mta-g0-0 (Coremail) with SMTP id _____wC3_5cLr6dlF6RgAQ--.42458S5; Wed, 17 Jan 2024 18:42:22 +0800 (CST) From: Xiang W To: opensbi@lists.infradead.org Cc: Xiang W Subject: [PATCH v3 03/10] firmware: fw_base.S: Simplify address get in _relocate Date: Wed, 17 Jan 2024 18:42:00 +0800 Message-ID: <20240117104212.1055737-4-wxjstz@126.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240117104212.1055737-1-wxjstz@126.com> References: <20240117104212.1055737-1-wxjstz@126.com> MIME-Version: 1.0 X-CM-TRANSID: _____wC3_5cLr6dlF6RgAQ--.42458S5 X-Coremail-Antispam: 1Uf129KBjvdXoW7GFWftr4DZF1UAryxuw17Wrg_yoWktFb_XF yIvFykGr1jqrW5Zr4Svr1rJrn0kw4avanYgF4kuay7XFWxC3s0vr4UX3yDWa90van8Kr98 ZFn7Xrs29Fn7XjkaLaAFLSUrUUUUjb8apTn2vfkv8UJUUUU8Yxn0WfASr-VFAUDa7-sFnT 9fnUUvcSsGvfC2KfnxnUUI43ZEXa7xRM-B_UUUUUU== X-Originating-IP: [112.83.182.118] X-CM-SenderInfo: pz0m23b26rjloofrz/xtbBcw5oOmSQAhyLnAAAsS X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240117_024228_539206_EE2F7935 X-CRM114-Status: UNSURE ( 5.92 ) X-CRM114-Notice: Please train this message. X-Spam-Score: -0.2 (/) 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: Simplify address get in _relocate. Remove _link_end. Signed-off-by: Xiang W --- firmware/fw_base.S | 17 ++++++ 1 file changed, 6 insertions(+), 11 deletions(-) diff --git a/firmware/fw_base.S b/firmware/fw_base.S index 0e1b6fb..3d88704 100644 --- a/firmware/fw_base.S +++ b/firmware/fw_base.S @@ -97,17 +97,14 @@ _wait_relocate_copy_done: /* Relocate if load a [...] Content analysis details: (-0.2 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 0.0 FREEMAIL_FROM Sender email is commonly abused enduser mail provider [wxjstz[at]126.com] -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID_EF Message has a valid DKIM or DK signature from envelope-from domain 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: , Sender: "opensbi" Errors-To: opensbi-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org Simplify address get in _relocate. Remove _link_end. Signed-off-by: Xiang W --- firmware/fw_base.S | 17 ++++++----------- 1 file changed, 6 insertions(+), 11 deletions(-) diff --git a/firmware/fw_base.S b/firmware/fw_base.S index 0e1b6fb..3d88704 100644 --- a/firmware/fw_base.S +++ b/firmware/fw_base.S @@ -97,17 +97,14 @@ _wait_relocate_copy_done: /* Relocate if load address != link address */ _relocate: lla t0, _link_start - REG_L t0, 0(t0) - lla t1, _link_end - REG_L t1, 0(t1) - lla t2, _load_start - REG_L t2, 0(t2) + REG_L t0, 0(t0) /* link start */ + lla t2, _fw_start /* load start */ beq t0, t2, _relocate_done - sub t3, t1, t0 - add t3, t3, t2 + sub t6, t2, t0 /* runtime offset */ + lla t3, _fw_reloc_end /* load end */ lla t4, _relocate_done - sub t4, t4, t2 - add t4, t4, t0 + sub t1, t3, t6 /* link end */ + sub t4, t4, t6 /* link _relocate_done */ blt t2, t0, _relocate_copy_to_upper _relocate_copy_to_lower: ble t1, t2, _relocate_copy_to_lower_loop @@ -506,8 +503,6 @@ _load_start: RISCV_PTR _fw_start _link_start: RISCV_PTR FW_TEXT_START -_link_end: - RISCV_PTR _fw_reloc_end .section .entry, "ax", %progbits .align 3