Message ID | 20240211161138.2538981-4-wxjstz@126.com |
---|---|
State | Changes Requested |
Headers | show
Return-Path: <opensbi-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org> 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=flP8tUQm; 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=dLm1TdQw; 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 4TXszz5x2Jz23yd for <incoming@patchwork.ozlabs.org>; Mon, 12 Feb 2024 03:12:14 +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=oCGtJZq+SQTdQmZ3TaZhwdBWBr3Tc06lWCL6FJY/5ow=; b=flP8tUQmdCx9p7 +MCOcxbnLzjN6supbHdNcqfzUkLfrYC+N8BWPsODs3MUxc+i4UE6HZJ1Xyf6EIWgp2cAPfo0ZKSgT ALvpxr8kDGxo6+95QkzvdjDlZeNgj+UjkVGbdoZyM66g/lwgnb/KemJe1lABuI0QpVffuVeWwYNfy 12MRxabtLgTwTA9cQ8GEc4KeZl8Ew/tAj01ooctBmwais/Xuf5ROVlJtwuh0JEWCOkpk7hSjshvfq kcU96bPyQ75W/CQC8Q79nEaTFzXMSe4E9aDO0oCEgyu0NA7cIhQpEbqNJQVf1Y1mv9WRFIHwXNd2R wktUqw6ugt/EbfrsbNxQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1rZCR1-00000002zdG-1v4M; Sun, 11 Feb 2024 16:12:03 +0000 Received: from m16.mail.126.com ([220.197.31.6]) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1rZCQw-00000002zaQ-2JeV for opensbi@lists.infradead.org; Sun, 11 Feb 2024 16:12:01 +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=NOe+z 5GsUh8h4ceV/9bSVUeeJCnHpQW39ylJahuuIDc=; b=dLm1TdQwqeiOzvB9pHiGj jS413EX45ZfykhyaYCJrsnoHTQtSBWZhCGrGmJLZj8LlnHe/cYJlXutJPsWKABdD 3+CTwblX8Pn5wOhblBeTCWF9cvUCFGhlVGbc3VKYYGBx+97vCoF50KqDyGosOnge 5VQj8expf1NiVcd5zTZWCc= Received: from T490.lan (unknown [36.153.54.93]) by gzga-smtp-mta-g1-1 (Coremail) with SMTP id _____wDXf23B8chlw7Q2Ag--.15450S5; Mon, 12 Feb 2024 00:11:48 +0800 (CST) From: Xiang W <wxjstz@126.com> To: opensbi@lists.infradead.org Cc: Xiang W <wxjstz@126.com>, anup@brainfault.org Subject: [PATCH v4 3/8] firmware: fw_base: Simplified setup trap handler Date: Mon, 12 Feb 2024 00:11:27 +0800 Message-ID: <20240211161138.2538981-4-wxjstz@126.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240211161138.2538981-1-wxjstz@126.com> References: <20240211161138.2538981-1-wxjstz@126.com> MIME-Version: 1.0 X-CM-TRANSID: _____wDXf23B8chlw7Q2Ag--.15450S5 X-Coremail-Antispam: 1Uf129KBjvdXoW7Xw4fZFWUKF18XF13Kr4kZwb_yoWkCFg_XF WDua4Iqr4qvrZ5X3y0kFW3Wwn5WrWF9FWFgw4DCr4jyr13tFWYgr9rJw47W3yrZ34vgryD AF4DJrZrJr92vjkaLaAFLSUrUUUUjb8apTn2vfkv8UJUUUU8Yxn0WfASr-VFAUDa7-sFnT 9fnUUvcSsGvfC2KfnxnUUI43ZEXa7xRiaZX5UUUUU== X-Originating-IP: [36.153.54.93] X-CM-SenderInfo: pz0m23b26rjloofrz/xtbBcwaBOmSQAkkjsgABsh X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240211_081158_999305_99623E4C X-CRM114-Status: UNSURE ( 5.26 ) 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: 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.6 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: <opensbi.lists.infradead.org> List-Unsubscribe: <http://lists.infradead.org/mailman/options/opensbi>, <mailto:opensbi-request@lists.infradead.org?subject=unsubscribe> List-Archive: <http://lists.infradead.org/pipermail/opensbi/> List-Post: <mailto:opensbi@lists.infradead.org> List-Help: <mailto:opensbi-request@lists.infradead.org?subject=help> List-Subscribe: <http://lists.infradead.org/mailman/listinfo/opensbi>, <mailto:opensbi-request@lists.infradead.org?subject=subscribe> Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "opensbi" <opensbi-bounces@lists.infradead.org> Errors-To: opensbi-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org |
Series |
Improvements to fw_base.S
|
expand
|
diff --git a/firmware/fw_base.S b/firmware/fw_base.S index d418041..f0dd0da 100644 --- a/firmware/fw_base.S +++ b/firmware/fw_base.S @@ -362,22 +362,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