Message ID | 20240304121557.502655-3-wxjstz@126.com |
---|---|
State | Accepted |
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=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 <incoming@patchwork.ozlabs.org>; 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 <wxjstz@126.com> To: opensbi@lists.infradead.org Cc: Xiang W <wxjstz@126.com>, 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: <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 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