From patchwork Mon Mar 4 12:15:48 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Xiang W X-Patchwork-Id: 1907534 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=UMxwWPEi; dkim=fail reason="signature verification failed" (2048-bit key; secure) header.d=infradead.org header.i=@infradead.org header.a=rsa-sha256 header.s=desiato.20200630 header.b=fXPSW9BD; 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=gitAc3Hn; dkim-atps=neutral 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=patchwork.ozlabs.org) 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 (secp384r1) server-digest SHA384) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4TpHl04HTsz23qH for ; Mon, 4 Mar 2024 23:17:32 +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=MQsTolVIaflQVhbhOyLZ1pXmS9kLmz/mcKeiGtwH1Ig=; b=UMxwWPEikPhwEl PVSVcRpacQdGO2IXxhhOco53i0SYNG4D72zm+jV0hSOH7r7JdBTsgMaCEWppaY0ZR4J+PWtQEbDKN i6ErRD2FszCWarIvtYTbymT8ktPgITukWM8aoA86wriAW/mmDxdBaPzLLJy42gPNo2RpwI2g/Pz0b rccBCwUpc/FiWvfwepSPRP64yfnZFFXIfevgxITncJ8iEZwAy5bnGs12E57zEnl0CouqmwKtVbJ3W SgsM3eSNaDtNEV6sXBGvJHc1rq81zoYGrVA3MgtwB9pbkk+u0mbOZ5naq1nq/RMXI0Z6Rq1KIJG+3 f1lMCLYQtZXiFoZjunkQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1rh7Fu-00000008wsR-2oDW; Mon, 04 Mar 2024 12:17:18 +0000 Received: from desiato.infradead.org ([2001:8b0:10b:1:d65d:64ff:fe57:4e05]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1rh7Fq-00000008wq9-30NR for opensbi@bombadil.infradead.org; Mon, 04 Mar 2024 12:17:15 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=desiato.20200630; h=Content-Transfer-Encoding:MIME-Version :References:In-Reply-To:Message-ID:Date:Subject:Cc:To:From:Sender:Reply-To: Content-Type:Content-ID:Content-Description; bh=mK23Cnr3vKXNkz7Lo8gDhRmlVNmrFQwMJle66dNo7CE=; b=fXPSW9BDddFgQj4GyPYjbuv9b6 vH266uw3eHL4ODGbT40st4GqED5s/bJrXGnpjueBlE7iMdfTfa7vWLI+3TJFKNAX+RkLM6FGY/1/3 +m9xUKmIXTipmNiUPrOx1FG/v6SQkbwp6xcGaTEBPy89+H0yGO6W5LesxcNXcuQ6vaJVYa/+82JRZ r1pcRLf2+dKmkR0kqzwXJKSRz4q3dqWS95LqJKvFRGMXzqYJXr3mQ5ucaEdQfMv+hFejhOEfRm+eO xiVPrEhvS35GZJ9B2kcFiWy2kQnCDxT8ZlC0JV8J7wqmGHZT6SoM6YeSw5A7QsBoB148LlhxnyqJO ibiblZ+A==; Received: from m16.mail.126.com ([220.197.31.7]) by desiato.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1rh7Fm-00000004rFW-24mW for opensbi@lists.infradead.org; Mon, 04 Mar 2024 12:17:12 +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=mK23C nr3vKXNkz7Lo8gDhRmlVNmrFQwMJle66dNo7CE=; b=gitAc3Hnm3K83KYkjzfeo xE6kzuAQGPS5xZ/aAsj0gCp6jCN4OXtL2NUqaE1K2JXMyDqZZPuI6l1frRlIXD7m kdtRDOjradOfIaK9O2rNyIVeCxdFGuVLezI3NHsIi7mGPC4zxh1ZM8QLpnfop91m PBwybdca9C+geBP08NZ764= Received: from T490.lan (unknown [112.83.183.140]) by gzga-smtp-mta-g0-0 (Coremail) with SMTP id _____wD33wl_u+VlK7dEAA--.3521S3; Mon, 04 Mar 2024 20:16:02 +0800 (CST) From: Xiang W To: opensbi@lists.infradead.org Cc: Xiang W , anup@brainfault.org Subject: [PATCH v6 1/5] firmware: fw_base.S: Simplify address get Date: Mon, 4 Mar 2024 20:15:48 +0800 Message-ID: <20240304121557.502655-2-wxjstz@126.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240304121557.502655-1-wxjstz@126.com> References: <20240304121557.502655-1-wxjstz@126.com> MIME-Version: 1.0 X-CM-TRANSID: _____wD33wl_u+VlK7dEAA--.3521S3 X-Coremail-Antispam: 1Uf129KBjvJXoW7Ar47Zw1rCFy8AFyfZrWxXrb_yoW8Kr45pr 13C3W3Krsxta48XFyjka4UWr4UXa1UXrW2g34xKFWfAr1fuFsxXa48Jryrt39Iq34xXw4F vFy2kry3Ca12yFJanT9S1TB71UUUUU7qnTZGkaVYY2UrUUUUjbIjqfuFe4nvWSU5nxnvy2 9KBjDUYxBIdaVFxhVjvjDU0xZFpf9x0piG-erUUUUU= X-Originating-IP: [112.83.183.140] X-CM-SenderInfo: pz0m23b26rjloofrz/xtbBdAOXOmSdLxkgLQAAsY X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240304_121711_171626_D1AE23C0 X-CRM114-Status: UNSURE ( 6.07 ) X-CRM114-Notice: Please train this message. X-Spam-Score: -0.2 (/) X-Spam-Report: Spam detection software, running on the system "desiato.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. Remove _link_start _link_end _load_start. Signed-off-by: Xiang W --- firmware/fw_base.S | 44 +++++++++++ 1 file changed, 11 insertions(+), 33 deletions(-) Content analysis details: (-0.2 points, 5.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at https://www.dnswl.org/, no trust [220.197.31.7 listed in list.dnswl.org] 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record -0.0 SPF_PASS SPF: sender matches SPF record -0.1 DKIM_VALID_EF Message has a valid DKIM or DK signature from envelope-from domain -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature 0.0 FREEMAIL_FROM Sender email is commonly abused enduser mail provider [wxjstz(at)126.com] -0.0 T_SCC_BODY_TEXT_LINE No description available. 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. Remove _link_start _link_end _load_start. Signed-off-by: Xiang W Reviewed-by: Anup Patel --- firmware/fw_base.S | 44 +++++++++++--------------------------------- 1 file changed, 11 insertions(+), 33 deletions(-) diff --git a/firmware/fw_base.S b/firmware/fw_base.S index 09894e6..c657bd9 100644 --- a/firmware/fw_base.S +++ b/firmware/fw_base.S @@ -63,17 +63,11 @@ _try_lottery: amoadd.w a6, a7, (a6) bnez a6, _wait_relocate_copy_done - /* Save load address */ - lla t0, _load_start - lla t1, _fw_start - REG_S t1, 0(t0) - #ifdef FW_PIC /* relocate the global table content */ - lla t0, _link_start - REG_L t0, 0(t0) - /* t1 shall has the address of _fw_start */ - sub t2, t1, t0 + li t0, FW_TEXT_START /* link start */ + lla t1, _fw_start /* load start */ + sub t2, t1, t0 /* load offset */ lla t0, __rel_dyn_start lla t1, __rel_dyn_end beq t0, t1, _relocate_done @@ -96,18 +90,14 @@ _wait_relocate_copy_done: #else /* 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) + li t0, FW_TEXT_START /* link start */ + lla t2, _fw_start /* load start */ + lla t3, _fw_reloc_end /* load end */ + sub t6, t2, t0 /* load offset */ + sub t1, t3, t6 /* link end */ beq t0, t2, _relocate_done - sub t3, t1, t0 - add t3, t3, t2 lla t4, _relocate_done - sub t4, t4, t2 - add t4, t4, t0 + sub t4, t4, t6 blt t2, t0, _relocate_copy_to_upper _relocate_copy_to_lower: ble t1, t2, _relocate_copy_to_lower_loop @@ -147,8 +137,7 @@ _relocate_copy_to_upper_loop: jr t4 _wait_relocate_copy_done: lla t0, _fw_start - lla t1, _link_start - REG_L t1, 0(t1) + li t1, FW_TEXT_START beq t0, t1, _wait_for_boot_hart lla t2, _boot_status lla t3, _wait_for_boot_hart @@ -173,12 +162,7 @@ _relocate_done: */ lla t0, _boot_status #ifndef FW_PIC - lla t1, _link_start - REG_L t1, 0(t1) - lla t2, _load_start - REG_L t2, 0(t2) - sub t0, t0, t1 - add t0, t0, t2 + add t0, t0, t6 #endif li t1, BOOT_STATUS_RELOCATE_DONE REG_S t1, 0(t0) @@ -502,12 +486,6 @@ _relocate_lottery: RISCV_PTR 0 _boot_status: RISCV_PTR 0 -_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 From patchwork Mon Mar 4 12:15:49 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Xiang W X-Patchwork-Id: 1907537 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=jJvqQ2aC; dkim=fail reason="signature verification failed" (2048-bit key; secure) header.d=infradead.org header.i=@infradead.org header.a=rsa-sha256 header.s=desiato.20200630 header.b=iGDLXJsj; 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=ZoT+yyOD; dkim-atps=neutral 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=patchwork.ozlabs.org) 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 (secp384r1) server-digest SHA384) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4TpHl83jvkz23fC for ; Mon, 4 Mar 2024 23:17:40 +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=mjc0PVRTErtAxnomGKruYWTjshBeckBpag0m/LVBPH4=; b=jJvqQ2aCZyMvM3 sr8LKkHTpYeZPfPn1W02EVmQIjXTEs+Ms3nCaIgkBqQA3anMBRVFCGsr8WBAN75SrnY0mpagyZKTm hjjOgKLwN/uK8AJ+OqhxKVmpaRLjdLNAPYsY3CaH86kEvfzI80IUY2pU/JvGnGRdsdGjZZVpZQXaE Mzilr0ty9ZlkwEECEgGcLz1hjpobwfP/niAH7EAiyrFPuG7FLPBXQBcCtGOdI/x0Lcv9LY75zEWdU UwnelqwNz0lxLGLXklm+WSEPRAjUoYSpuCA2wcHfy8s1AV+hBXFEOc7Hrqzm+V/hjXdUEJfu994zY +s3HZk+IqINyFILwhgpQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1rh7G5-00000008wx1-2l3F; Mon, 04 Mar 2024 12:17:29 +0000 Received: from desiato.infradead.org ([2001:8b0:10b:1:d65d:64ff:fe57:4e05]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1rh7Fr-00000008wrZ-3dqJ for opensbi@bombadil.infradead.org; Mon, 04 Mar 2024 12:17:15 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=desiato.20200630; h=Content-Transfer-Encoding:MIME-Version :References:In-Reply-To:Message-ID:Date:Subject:Cc:To:From:Sender:Reply-To: Content-Type:Content-ID:Content-Description; bh=QM6BdF9Odl/MA1S+51cLEJwfoCD7eN9G3NqWZvB9Y4c=; b=iGDLXJsjx9vRu3UB2qhT6jOc2Z s9pWkoY+uI3aQ4c6Ig8Id5Doqa0SwJyjWkSnHjknc5q4oy+nvXzX95nmLVTfWaLi/rhsSBnrFcGDt W2Bi7mh5OVqoS1wUzyFgn2O8L6eAKNoq3XOJp+Qp8uJU9saeStjXx8l8Q+0VFUrl9C1Wfvw46FvZl qVXDXjxGwbhWctTr/hlGkHYIxBG5CjV6On1zrSQwuHBK627dmB9zYElr07ClPpKLqO17HUPphq0Qu GdGMdkTnjZoT19cdeLowCM/194s9HN6muxa6Rw2BESYaFyzS68W8dQtwJL3+qRQf60UWkha8T5g59 2q3+O4xg==; Received: from m16.mail.126.com ([220.197.31.7]) by desiato.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1rh7Fn-00000004rFa-1pYG for opensbi@lists.infradead.org; Mon, 04 Mar 2024 12:17:14 +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=QM6Bd F9Odl/MA1S+51cLEJwfoCD7eN9G3NqWZvB9Y4c=; b=ZoT+yyOD4I3rqycV2znp5 WoIDb6s/+DbcbPDrW7JCAWAcmrWObRbQuikpl55v7cXtpMbDJwbY0aE/jhx2wRpx vIhL0EoirVdgKduD73+srpGZ7ogG1nhSogPwDUTcj2N6lTMWtvD1p6l+3qSmSWQL tFBbLD4zIGk8sB/27JVXgg= Received: from T490.lan (unknown [112.83.183.140]) by gzga-smtp-mta-g0-0 (Coremail) with SMTP id _____wD33wl_u+VlK7dEAA--.3521S4; Mon, 04 Mar 2024 20:16:02 +0800 (CST) From: Xiang W To: opensbi@lists.infradead.org Cc: Xiang W , anup@brainfault.org Subject: [PATCH v6 2/5] firmware: fw_base: Simplified setup trap handler Date: Mon, 4 Mar 2024 20:15:49 +0800 Message-ID: <20240304121557.502655-3-wxjstz@126.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240304121557.502655-1-wxjstz@126.com> References: <20240304121557.502655-1-wxjstz@126.com> MIME-Version: 1.0 X-CM-TRANSID: _____wD33wl_u+VlK7dEAA--.3521S4 X-Coremail-Antispam: 1Uf129KBjvdXoW7Xw4fZFWUKF18XF13Kr4kZwb_yoWkCFg_XF WUua40qw4qvrZ5X3y0kFW3Wwn7WrWFkFW5W3yDCr4Utr17tFWagF9rXw4UW3yrX34vgr98 AF4DXrsrJr92kjkaLaAFLSUrUUUUjb8apTn2vfkv8UJUUUU8Yxn0WfASr-VFAUDa7-sFnT 9fnUUvcSsGvfC2KfnxnUUI43ZEXa7xRNFApUUUUUU== X-Originating-IP: [112.83.183.140] X-CM-SenderInfo: pz0m23b26rjloofrz/xtbBdAOXOmSdLxkgLgABsa X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240304_121712_153605_4FAFDE2D X-CRM114-Status: UNSURE ( 5.65 ) X-CRM114-Notice: Please train this message. X-Spam-Score: -0.2 (/) X-Spam-Report: Spam detection software, running on the system "desiato.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 same detection was done twice when setting mtvec and trap_exit. Merging can reduce code size. Signed-off-by: Xiang W Reviewed-by: Anup Patel --- firmware/fw_base.S | 16 ++++ 1 file changed, 4 insertions(+), 12 deletions(-) Content analysis details: (-0.2 points, 5.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at https://www.dnswl.org/, no trust [220.197.31.7 listed in list.dnswl.org] 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record -0.0 SPF_PASS SPF: sender matches SPF record -0.1 DKIM_VALID_EF Message has a valid DKIM or DK signature from envelope-from domain -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature 0.0 FREEMAIL_FROM Sender email is commonly abused enduser mail provider [wxjstz(at)126.com] -0.0 T_SCC_BODY_TEXT_LINE No description available. 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 The same detection was done twice when setting mtvec and trap_exit. Merging can reduce code size. Signed-off-by: Xiang W Reviewed-by: Anup Patel --- firmware/fw_base.S | 16 ++++------------ 1 file changed, 4 insertions(+), 12 deletions(-) diff --git a/firmware/fw_base.S b/firmware/fw_base.S index c657bd9..d87c0a5 100644 --- a/firmware/fw_base.S +++ b/firmware/fw_base.S @@ -456,22 +456,14 @@ _start_warm: srli a5, a5, ('H' - 'A') andi a5, a5, 0x1 beq a5, zero, _skip_trap_handler_rv32_hyp - lla a4, _trap_handler_rv32_hyp -_skip_trap_handler_rv32_hyp: -#endif - csrw CSR_MTVEC, a4 - -#if __riscv_xlen == 32 /* Override trap exit for H-extension */ - csrr a5, CSR_MISA - srli a5, a5, ('H' - 'A') - andi a5, a5, 0x1 - beq a5, zero, _skip_trap_exit_rv32_hyp - lla a4, _trap_exit_rv32_hyp csrr a5, CSR_MSCRATCH + lla a4, _trap_exit_rv32_hyp REG_S a4, SBI_SCRATCH_TRAP_EXIT_OFFSET(a5) -_skip_trap_exit_rv32_hyp: + lla a4, _trap_handler_rv32_hyp +_skip_trap_handler_rv32_hyp: #endif + csrw CSR_MTVEC, a4 /* Initialize SBI runtime */ csrr a0, CSR_MSCRATCH From patchwork Mon Mar 4 12:15:50 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Xiang W X-Patchwork-Id: 1907536 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=ZT3rrOty; dkim=fail reason="signature verification failed" (2048-bit key; secure) header.d=infradead.org header.i=@infradead.org header.a=rsa-sha256 header.s=desiato.20200630 header.b=J+Rl5/jE; 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=VzCNRgPi; dkim-atps=neutral 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=patchwork.ozlabs.org) 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 (secp384r1) server-digest SHA384) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4TpHl748xmz23qH for ; Mon, 4 Mar 2024 23:17:39 +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=g4ALKiScGEcaqo3Zq2G483qdlRT77+M5+nQ61EnwtL0=; b=ZT3rrOtyBH7e0N PYGAAnE1r/jaPLSol5EPJyVwhD2nYypiYYy6fF1eHuWYTriWySQcc0DGOB92Z9EMlWNSBTlZBjv9s DuWwn+vZaRH7k0Z89DDIzh4UVns9oK/7jPg8cO+v7lcP5inmaiuVhvSZE+mQ4R+WMHIampLAturiw Y+qVO6820jiGqp21qCQw89+yUeFD8W/H12IcqrbMGs38JEZZxGhGC6Fkwji2jJuoUag6nX8trLMmu f4lQvIGUN+EE1/wONX/6Prdkvi3+KlsnUDrhHKUoVGTr3H/9yrC0NpVpCxHv4eP4h3uebsbMnfi8C Tp3OBXnvEVDiSFrKLiKA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1rh7G3-00000008ww6-0i2a; Mon, 04 Mar 2024 12:17:27 +0000 Received: from desiato.infradead.org ([2001:8b0:10b:1:d65d:64ff:fe57:4e05]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1rh7Fq-00000008wq6-30zG for opensbi@bombadil.infradead.org; Mon, 04 Mar 2024 12:17:15 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=desiato.20200630; h=Content-Transfer-Encoding:MIME-Version :References:In-Reply-To:Message-ID:Date:Subject:Cc:To:From:Sender:Reply-To: Content-Type:Content-ID:Content-Description; bh=sZHWapsaM2AZosz4o9OgWfrec+EioHB4imdxRCoCOYw=; b=J+Rl5/jEuFDq9kbkN+liDGoYUR q5YyII/UguGHu8cjvaRZiSS+iGLEII0AVj83pc8uLQvFIzSzLhBx04y4QU51Vpaocw/qn3YrwWxVw 0iOYd3EHWdthz98GfYFWb4iOjUbelBDv87NYgHnZuRoJWyBexMrlK/2XVSx0E/CtygL+Cz5R6Lgwl tb7OyQx4g5EHzjzEBJXvOtgLhhISI7K1ztmZ/hJKm0uan+rWamP5+9XQywVwhXxoLbH9xF2weEzrq hnF2HNCnKA6tN1qLMCX9hA1DB5FDucQ8VVabF5rVMlzuK5I1DVgoj9BiOyJiWwsJkxhJij5qqZhMp udx7H5Aw==; Received: from m16.mail.126.com ([220.197.31.9]) by desiato.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1rh7Fm-00000004rFh-2Pbi for opensbi@lists.infradead.org; Mon, 04 Mar 2024 12:17:12 +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=sZHWa psaM2AZosz4o9OgWfrec+EioHB4imdxRCoCOYw=; b=VzCNRgPiFk4YAIznfOvk1 t0S8+d2Q4DjVjI9xDLg4Ye96PU2xxw95M8OJPcVL+2eTHR/VdJSXIvCzWsu7QOuy M0tKq9OikmaERWL2DQYDjExOkpmJb7kRdrS/SA3xZqKqXAJ/LQs4PmpID4hrMeoQ N9S0yShdOrGUKc6LoDWYBo= Received: from T490.lan (unknown [112.83.183.140]) by gzga-smtp-mta-g0-0 (Coremail) with SMTP id _____wD33wl_u+VlK7dEAA--.3521S5; Mon, 04 Mar 2024 20:16:02 +0800 (CST) From: Xiang W To: opensbi@lists.infradead.org Cc: Xiang W , anup@brainfault.org Subject: [PATCH v6 3/5] firmware: fw_dynamic.S: Remove _bad_dynamic_info Date: Mon, 4 Mar 2024 20:15:50 +0800 Message-ID: <20240304121557.502655-4-wxjstz@126.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240304121557.502655-1-wxjstz@126.com> References: <20240304121557.502655-1-wxjstz@126.com> MIME-Version: 1.0 X-CM-TRANSID: _____wD33wl_u+VlK7dEAA--.3521S5 X-Coremail-Antispam: 1Uf129KBjvdXoWrZw17uw1rJF1Dur1ruryrCrg_yoWDCrc_AF y3uFnxCr4FvrWrta109r1rCw1xZF97ua1qg3WxCw4UXr13J343Xrn5CFW2qr4v9a10kr45 AF17CrnIyFn7ujkaLaAFLSUrUUUUjb8apTn2vfkv8UJUUUU8Yxn0WfASr-VFAUDa7-sFnT 9fnUUvcSsGvfC2KfnxnUUI43ZEXa7xRuD73DUUUUU== X-Originating-IP: [112.83.183.140] X-CM-SenderInfo: pz0m23b26rjloofrz/xtbBdQeXOmSdLzkOYQAAsf X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240304_121711_258446_9D619F68 X-CRM114-Status: UNSURE ( 5.90 ) X-CRM114-Notice: Please train this message. X-Spam-Score: 1.5 (+) X-Spam-Report: Spam detection software, running on the system "desiato.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: _bad_dynamic_info is same as _start_hang, so remove it. Signed-off-by: Xiang W Reviewed-by: Anup Patel --- firmware/fw_dynamic.S | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/firmware/fw_dynamic.S b/firmware/fw_dynamic.S index 7ff1c6a..5ee2883 100644 --- a/firmware/fw_dynamic.S +++ b/firmware/fw_dynamic.S @@ -11,12 +11,6 @@ Content analysis details: (1.5 points, 5.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at https://www.dnswl.org/, no trust [220.197.31.9 listed in list.dnswl.org] 1.7 RCVD_IN_MSPIKE_L4 RBL: Bad reputation (-4) [220.197.31.9 listed in bl.mailspike.net] 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record -0.0 SPF_PASS SPF: sender matches SPF record -0.1 DKIM_VALID_EF Message has a valid DKIM or DK signature from envelope-from domain -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature 0.0 RCVD_IN_MSPIKE_BL Mailspike blocklisted 0.0 FREEMAIL_FROM Sender email is commonly abused enduser mail provider [wxjstz(at)126.com] -0.0 T_SCC_BODY_TEXT_LINE No description available. 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 _bad_dynamic_info is same as _start_hang, so remove it. Signed-off-by: Xiang W Reviewed-by: Anup Patel --- firmware/fw_dynamic.S | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/firmware/fw_dynamic.S b/firmware/fw_dynamic.S index 7ff1c6a..5ee2883 100644 --- a/firmware/fw_dynamic.S +++ b/firmware/fw_dynamic.S @@ -11,12 +11,6 @@ #include "fw_base.S" - .section .entry, "ax", %progbits - .align 3 -_bad_dynamic_info: - wfi - j _bad_dynamic_info - .section .entry, "ax", %progbits .align 3 .global fw_boot_hart @@ -30,10 +24,10 @@ fw_boot_hart: /* Sanity checks */ li a1, FW_DYNAMIC_INFO_MAGIC_VALUE REG_L a0, FW_DYNAMIC_INFO_MAGIC_OFFSET(a2) - bne a0, a1, _bad_dynamic_info + bne a0, a1, _start_hang li a1, FW_DYNAMIC_INFO_VERSION_MAX REG_L a0, FW_DYNAMIC_INFO_VERSION_OFFSET(a2) - bgt a0, a1, _bad_dynamic_info + bgt a0, a1, _start_hang /* Read boot HART id */ li a1, FW_DYNAMIC_INFO_VERSION_2 From patchwork Mon Mar 4 12:15:51 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Xiang W X-Patchwork-Id: 1907533 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=guZQ5r7J; dkim=fail reason="signature verification failed" (2048-bit key; secure) header.d=infradead.org header.i=@infradead.org header.a=rsa-sha256 header.s=desiato.20200630 header.b=hlx3CLo6; 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=b7bzY1th; dkim-atps=neutral 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=patchwork.ozlabs.org) 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 (secp384r1) server-digest SHA384) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4TpHl00PC8z23fC for ; Mon, 4 Mar 2024 23:17:32 +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=x7K5ienNK6crpGr6tsGRDSD9e9o8VaHohIyFPcInO6c=; b=guZQ5r7JRYlU+S tSGB4hh7PUZ7D8j5pm2n3EMRaQhX8XxEO00rX21zjlYF4KW9KGE9IP21igtdpvRaoAxIB3XKbw9cM fhXmNhabe0b1b07Ost3+LTqkKLbWZuvGQUs36Lt7j0pQNMUfue2EwZoAIdChcgUWsBOpD4WNxcFU8 8FtD4x5hK/4SklidwK2JBcqoUpRD0fSiXgOxJPy/vFuzg7LHlEuEUY8JXVfKzrv6G6tpJbbVR61R7 Nl6Lye+METWu92JzGXFe0FKFJAZ90nKv0QmrBT5je2Kyxb7wNe7bcZfzWt+5OlBUYmyl3yLxASRD9 ri29UFCGm6eiNPN9R42A==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1rh7Ft-00000008ws5-0NiX; Mon, 04 Mar 2024 12:17:17 +0000 Received: from desiato.infradead.org ([2001:8b0:10b:1:d65d:64ff:fe57:4e05]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1rh7Fq-00000008wqv-3qgx for opensbi@bombadil.infradead.org; Mon, 04 Mar 2024 12:17:15 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=desiato.20200630; h=Content-Transfer-Encoding:MIME-Version :References:In-Reply-To:Message-ID:Date:Subject:Cc:To:From:Sender:Reply-To: Content-Type:Content-ID:Content-Description; bh=ofhczYxSmW7ffYGcGsi95hrSaEZMimYZ6V+uCGbfmmc=; b=hlx3CLo60/xZojJEGnHFsj59TE kA3BN1m4/BmSr3ZWT7RRsEzP+E+PXs+fDIeBEKKc7QpVyXLMZV/a7vvFbH3WiaeH8Pt09FEPe9v0+ q2GqXPNOe/HA5Z2uHuF5wbgeluGED7/ngqk0CHrCg9vxxx8NFVthz9VhQwgmUdtzZpXxpyk0V0Iqt Gnhde7lNjqxKon1bmzh5Gnrq+u4u7UIQZkWGedgipByUPV0AEuIPQ5hOXz4ruOCwUiDnFP5DNd13P PWDc+MaMKYqadHnwmBvoKPlqFAbh+m3bkTpis0c2jL/zil7X5I5wa+g8+UYKiU+tBFTjd5eDmqfKb B17iV16g==; Received: from m16.mail.126.com ([220.197.31.6]) by desiato.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1rh7Fm-00000004rHN-3lrv for opensbi@lists.infradead.org; Mon, 04 Mar 2024 12:17:13 +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=ofhcz YxSmW7ffYGcGsi95hrSaEZMimYZ6V+uCGbfmmc=; b=b7bzY1th/4MY0Oi1aK0eW SUoKbR6fyMjNrSAD7i8g4Jn5Hv37u2/4LEjIQq3n2ntfSlCTkroGs4QPG5+Eie97 U+qV7E2lqo3En6exyj1lsrX8MqzlPdshQMu5TUeWmrXqyZZ64vhb2KvH8+KTwnq3 lYyGhZASwv94+pAw2MVy6M= Received: from T490.lan (unknown [112.83.183.140]) by gzga-smtp-mta-g0-0 (Coremail) with SMTP id _____wD33wl_u+VlK7dEAA--.3521S6; Mon, 04 Mar 2024 20:16:03 +0800 (CST) From: Xiang W To: opensbi@lists.infradead.org Cc: Xiang W , anup@brainfault.org Subject: [PATCH v6 4/5] firmware: fw_base.S: Remove _relocate_lottery Date: Mon, 4 Mar 2024 20:15:51 +0800 Message-ID: <20240304121557.502655-5-wxjstz@126.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240304121557.502655-1-wxjstz@126.com> References: <20240304121557.502655-1-wxjstz@126.com> MIME-Version: 1.0 X-CM-TRANSID: _____wD33wl_u+VlK7dEAA--.3521S6 X-Coremail-Antispam: 1Uf129KBjvJXoW7Zr4UKry3CFyfJr1ftr4rGrg_yoW8ArWfpr nrJay7Kr4rK343X3W0ga15Wr15Xw4UXay7uayxKFn3ZryfZF4fZFy8Jr95XrWvq34rt3y2 qa42k34UZ3s0yF7anT9S1TB71UUUUU7qnTZGkaVYY2UrUUUUjbIjqfuFe4nvWSU5nxnvy2 9KBjDUYxBIdaVFxhVjvjDU0xZFpf9x0pEwZ2xUUUUU= X-Originating-IP: [112.83.183.140] X-CM-SenderInfo: pz0m23b26rjloofrz/xtbBdQeXOmSdLzkOYQABse X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240304_121711_496563_DD1E253F X-CRM114-Status: UNSURE ( 6.28 ) X-CRM114-Notice: Please train this message. X-Spam-Score: -0.2 (/) X-Spam-Report: Spam detection software, running on the system "desiato.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: Remove _relocate_lottery and use _boot_status instead 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 d87c0a5..d83397e 100644 --- a/firmware/fw_base.S +++ b/firmware/fw_base.S @@ -14,8 +14,9 @@ #include #include List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "opensbi" Errors-To: opensbi-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org Remove _relocate_lottery and use _boot_status instead Signed-off-by: Xiang W Reviewed-by: Anup Patel --- 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 d87c0a5..d83397e 100644 --- a/firmware/fw_base.S +++ b/firmware/fw_base.S @@ -14,8 +14,9 @@ #include #include -#define BOOT_STATUS_RELOCATE_DONE 1 -#define BOOT_STATUS_BOOT_HART_DONE 2 +#define BOOT_STATUS_LOTTERY_DONE 1 +#define BOOT_STATUS_RELOCATE_DONE 2 +#define BOOT_STATUS_BOOT_HART_DONE 3 .macro MOV_3R __d0, __s0, __d1, __s1, __d2, __s2 add \__d0, \__s0, zero @@ -58,9 +59,9 @@ _start: bne a0, a6, _wait_relocate_copy_done _try_lottery: /* Jump to relocation wait loop if we don't get relocation lottery */ - lla a6, _relocate_lottery - li a7, 1 - amoadd.w a6, a7, (a6) + lla a6, _boot_status + li a7, BOOT_STATUS_LOTTERY_DONE + amoswap.w a6, a7, (a6) bnez a6, _wait_relocate_copy_done #ifdef FW_PIC @@ -101,8 +102,6 @@ _relocate: blt t2, t0, _relocate_copy_to_upper _relocate_copy_to_lower: ble t1, t2, _relocate_copy_to_lower_loop - lla t3, _relocate_lottery - BRANGE t2, t1, t3, _start_hang lla t3, _boot_status BRANGE t2, t1, t3, _start_hang lla t3, _relocate @@ -119,8 +118,6 @@ _relocate_copy_to_lower_loop: jr t4 _relocate_copy_to_upper: ble t3, t0, _relocate_copy_to_upper_loop - lla t2, _relocate_lottery - BRANGE t0, t3, t2, _start_hang lla t2, _boot_status BRANGE t0, t3, t2, _start_hang lla t2, _relocate @@ -474,8 +471,6 @@ _skip_trap_handler_rv32_hyp: .data .align 3 -_relocate_lottery: - RISCV_PTR 0 _boot_status: RISCV_PTR 0 From patchwork Mon Mar 4 12:15:52 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Xiang W X-Patchwork-Id: 1907582 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=YHoA5r9o; 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=aAppIgH6; dkim-atps=neutral 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=patchwork.ozlabs.org) 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 (secp384r1) server-digest SHA384) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4TpJ4z0qxZz23l2 for ; Mon, 4 Mar 2024 23:33:07 +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=MjgH8SOeSv0iqBchA1VHL1f0oGz0TDoBv7Ifs8EPWvs=; b=YHoA5r9oncU5Ku sFDnkf6n1S+j+cZAVA8id150Hud5R3ECs561+x0Cc3mdtCdo+RYpEbp2nH1s9h12Z7PFvvjGMZc01 VBTPxeNroTCR2Zs0IxlATbFlf3LxbeAuOCoGeapE2SHpvbB6nUVxlr32r4Zb++KRt3RhVH9BBwNFL zmrsMONlNlagCBljem492ScZxRDnJzu1iYsvbZuNGn+WdO/cwmvC7btQ2kfS8MQHlN9t+8XyPqH2t AEOaxcFlvZyAii6KTRBINbVCoQ+Ks3BjYCkVQ961XSaexYlnBD3FAMyvbfozQQnl0rxu2dfNYiswA BleRQ8VXHynJ7kXtMpbg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1rh7V3-000000090CQ-2XwH; Mon, 04 Mar 2024 12:32:57 +0000 Received: from m16.mail.126.com ([220.197.31.7]) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1rh7UU-00000008zot-2ypb for opensbi@lists.infradead.org; Mon, 04 Mar 2024 12:32:29 +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=D0Fs1 jZ1quHM1oDkIXP2dqWRY717P4irWVymesyUk/A=; b=aAppIgH6Xz+ykZADGPN98 Pi1xjMBS2KNmDBcxyoHLnNhIGj4n1aKrhcPSP+i3CnYNLMrhgexY09zXZU9A3ACH yaebEY/rtmolYczAlLiTC09B41+boXd/EGTZCNgyT8KxSWlyWCVZllbgDMGYeW3J EVYpbtoC8GdAThPqA/kYUg= Received: from T490.lan (unknown [112.83.183.140]) by gzga-smtp-mta-g0-0 (Coremail) with SMTP id _____wD33wl_u+VlK7dEAA--.3521S7; Mon, 04 Mar 2024 20:16:03 +0800 (CST) From: Xiang W To: opensbi@lists.infradead.org Cc: Xiang W , anup@brainfault.org Subject: [PATCH v6 5/5] firmware: fw_base.S: fix _reset_regs Date: Mon, 4 Mar 2024 20:15:52 +0800 Message-ID: <20240304121557.502655-6-wxjstz@126.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240304121557.502655-1-wxjstz@126.com> References: <20240304121557.502655-1-wxjstz@126.com> MIME-Version: 1.0 X-CM-TRANSID: _____wD33wl_u+VlK7dEAA--.3521S7 X-Coremail-Antispam: 1Uf129KBjvdXoW7Gr4xWF1kKryUJFW3WFyfWFg_yoWkKFXEvF W0vryqyr4Dtry5uw1DGr1fCrnY9FWUC3ya9w4UGFZrArWxWa18Krykur47A347Xr43Kry8 AF9rJr93u3s29jkaLaAFLSUrUUUUjb8apTn2vfkv8UJUUUU8Yxn0WfASr-VFAUDa7-sFnT 9fnUUvcSsGvfC2KfnxnUUI43ZEXa7sRKID7PUUUUU== X-Originating-IP: [112.83.183.140] X-CM-SenderInfo: pz0m23b26rjloofrz/xtbBcwiXOmSQAm41SwAAsw X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240304_043225_714516_64162C09 X-CRM114-Status: UNSURE ( 7.10 ) 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: a3 and a4 cannot be reset because used in fw_platform_init. Signed-off-by: Xiang W Reviewed-by: Anup Patel --- firmware/fw_base.S | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/firmware/fw_base.S b/firmware/fw_base.S index d83397e..126b067 100644 --- a/firmware/fw_base.S +++ b/firmware/fw_base.S @@ -167,7 +167,7 @@ _relocate_done: Content analysis details: (-0.2 points, 5.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at https://www.dnswl.org/, no trust [220.197.31.7 listed in list.dnswl.org] -0.0 SPF_PASS SPF: sender matches SPF record 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record -0.1 DKIM_VALID_EF Message has a valid DKIM or DK signature from envelope-from 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_AU Message has a valid DKIM or DK signature from author's domain 0.0 FREEMAIL_FROM Sender email is commonly abused enduser mail provider [wxjstz(at)126.com] -0.0 T_SCC_BODY_TEXT_LINE No description available. 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 a3 and a4 cannot be reset because used in fw_platform_init. Signed-off-by: Xiang W Reviewed-by: Anup Patel --- firmware/fw_base.S | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/firmware/fw_base.S b/firmware/fw_base.S index d83397e..126b067 100644 --- a/firmware/fw_base.S +++ b/firmware/fw_base.S @@ -167,7 +167,7 @@ _relocate_done: /* At this point we are running from link address */ - /* Reset all registers except ra, a0, a1 and a2 for boot HART */ + /* Reset all registers except ra, a0, a1, a2, a3 and a4 for boot HART */ li ra, 0 call _reset_regs @@ -394,7 +394,7 @@ _wait_for_boot_hart: bne t0, t1, _wait_for_boot_hart _start_warm: - /* Reset all registers except ra, a0, a1 and a2 for non-boot HARTs */ + /* Reset all registers except ra, a0, a1, a2, a3 and a4 for non-boot HART */ li ra, 0 call _reset_regs @@ -745,7 +745,7 @@ _reset_regs: /* flush the instruction cache */ fence.i - /* Reset all registers except ra, a0, a1 and a2 */ + /* Reset all registers except ra, a0, a1, a2, a3 and a4 */ li sp, 0 li gp, 0 li tp, 0 @@ -754,8 +754,6 @@ _reset_regs: li t2, 0 li s0, 0 li s1, 0 - li a3, 0 - li a4, 0 li a5, 0 li a6, 0 li a7, 0