From patchwork Wed Nov 15 14:59:20 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Xiang W X-Patchwork-Id: 1864376 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=B+OJmLLE; 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=MucQ03aN; 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 4SVmZD5f90z1yRG for ; Thu, 16 Nov 2023 02:00:52 +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: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:In-Reply-To:References: List-Owner; bh=FFTIAyL6bn5Iq1uNeVPp6bcTkA34D/lELDpo7k10/aE=; b=B+OJmLLE2Ii6T4 FX3UHDD3wDP9qqhd0hNXzpEZqSEiGPM9iHRyk5jz2hA4IDkTvB0K5SKYpTajGbO8Z9N/Al7qiV9Z+ E8LEtak9L/QmPeqAwPZhVdaVV19iEHxvtJhipKIdQ2cAX/Ws5t2RNH0nCJGQhShwKydY3NmNn1BtQ lhC7kERPfIGepHZV9QIm/zM4Z7f5Kw77q7zZf0RbD4XGPoWaewnCcH2CM0jufzuWRc25eU1xtfE3+ pXSYVUdKKvzzxWBUc923reoxVMPYY/tuf2iTk0l8MiUi6/boVH0RLpYhbjgrdWY+eN2dXzOGbNpzY 1+7FR/AkAUQjTMnwk4kg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1r3HNd-0016dZ-2I; Wed, 15 Nov 2023 15:00:37 +0000 Received: from m126.mail.126.com ([220.181.12.29]) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1r3HNa-0016cZ-0Z for opensbi@lists.infradead.org; Wed, 15 Nov 2023 15:00:36 +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=ZJ4gy 44nmfFHtCxLsamvOX+6iXFHDz8kR3s9EbQa5Ko=; b=MucQ03aNn+9M22EUUrk+l p19oBO9wbcqffXWnOb03vtxMSdxLEiUx681LKJfS89F/mS63V3KaOG7T7f8mQhN/ SnnjeEFd5e76yh/hw7EK8vLKLjKAmCC6i0j6L7jFC9tirldOiYeCNazzcPOux1dT IhUV6WNdNESum+knRrkR9Q= Received: from T490.lan (unknown [112.83.183.252]) by zwqz-smtp-mta-g3-0 (Coremail) with SMTP id _____wCn6zTV3FRlI3f0Cg--.19734S2; Wed, 15 Nov 2023 22:59:34 +0800 (CST) From: Xiang W To: opensbi@lists.infradead.org Cc: Xiang W , jrtc27@jrtc27.com Subject: [PATCH v2 0/2] lib: sbi: Improved atomic bit operations Date: Wed, 15 Nov 2023 22:59:20 +0800 Message-ID: <20231115145929.488427-1-wxjstz@126.com> X-Mailer: git-send-email 2.42.0 MIME-Version: 1.0 X-CM-TRANSID: _____wCn6zTV3FRlI3f0Cg--.19734S2 X-Coremail-Antispam: 1Uf129KBjDUn29KB7ZKAUJUUUUU529EdanIXcx71UUUUU7v73 VFW2AGmfu7bjvjm3AaLaJ3UbIYCTnIWIevJa73UjIFyTuYvj4RANVkDUUUU X-Originating-IP: [112.83.183.252] X-CM-SenderInfo: pz0m23b26rjloofrz/xtbBdBgpOmSdLjx3JgAAsF X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20231115_070034_586557_2A2B5A9E X-CRM114-Status: UNSURE ( 4.89 ) 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 original atomic bit operation returns the word before modification, but under RV64, int is 32 bits and cannot accommodate one machine word. Corrected to return the value of the bit. And correct th [...] 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 The original atomic bit operation returns the word before modification, but under RV64, int is 32 bits and cannot accommodate one machine word. Corrected to return the value of the bit. And correct the comments of the function. Changed from v1: - Split patch - fix comments Xiang W (2): lib: sbi: Fix __atomic_op_bit_ord and comments lib: sbi: Replace __atomic_op_bit_ord with __atomic intrinsics include/sbi/riscv_atomic.h | 8 ++++---- lib/sbi/riscv_atomic.c | 40 ++++++++++++-------------------------- 2 files changed, 16 insertions(+), 32 deletions(-)