From nobody Sun Dec 01 04:57:24 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Y1F5d0pFpz5gDK2; Sun, 01 Dec 2024 04:57:25 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Y1F5c58J7z49j0; Sun, 1 Dec 2024 04:57:24 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1733029044; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=EnzM8BJCOib4Lu6H3jxIlVZhtvSySOvBpCMfsZS1M6E=; b=KFTO7JqgLNgowaNSlBDB71wFYs/Vpxzkh1+Cb5746TiGqLMzmyT3aLePAT7whJMUrkaZS4 sUkilNdO8a5YvZtDFKjSxd94BotuZ9GrhLU/rN6L8HU6A9COCWfK/onpckjU4sLm3sT3bC gkIb4ldbwBr2tTK2XrhYk+oezois8zvdDLvhf+UlI9pkvpmasIKf78oLA/CrXKgNn+HSWn L098NVvH/YdB42wu+7bJaA3xg/kUfDABwaoevQOYmmVY3bHRUuknOpwsDAYuQJXBDcloMa kXpGlLeTAfbUyW7qcVHB5A9l2NN6D8W1OVXpOcqHgsGTb0QkndSNDq0f09wTsw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1733029044; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=EnzM8BJCOib4Lu6H3jxIlVZhtvSySOvBpCMfsZS1M6E=; b=d5NsT9rpuDs7Xc6Ny0/ffpVi9Z+ruHNYIgR32g5bVUkzgs7xA6g4gCYK9vrvtRmjRJ7Fa1 UyDh4+11XutWeJzwUf6Fbs4VFXqu8IMSaoq4+ixD3PNX7bioopVXpVAzM90ti2CUUGyzGI EF/sL1Dpals9UcGuaXP3EDOR9JCF8M7U4jf9PiBTVioTA1Zx6ei3PYblmQj5w29LS8ZctY h6e3+Ngs+zQowYEM5kPTtBBTWGaPdFjtCw8XCN9cqb1yrYPvTaY3+k0BbwXjiIuEV6m6hV 7KB18plih8+CDXv48Z0u5YXGu2b5XQ2TDCZ5fpA/g8VyYz4F+Neh+u5NP9FcTA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1733029044; a=rsa-sha256; cv=none; b=uYHZHHlUDEPqwHimDv74LXCubMTLHnLiupyieZfLjcAMxrMkio7StjXUPX0o+n/tq7n7PR W8ieaqDNAizM8/wgePytdVcuRJLn/r28fmVxNAEmAfKVn9d6iGojOsP2U2n3GyrQd4z2Pl psOgPHHqzCKjfqrOY3kAhJ0BCvAGQvPG55DEKTF0/pge57+QDoGSCORNvdRLbBBVTjToZD lvJkPCBqL8yrhWExpL2L0XQTqExyjT+rv6cfqfDx2n0f1EZicp/5zqiYJ75IoATsjC7L12 MP5O1qgL4eIlQNJFIVe8w5upUKxZ5ixWZxDOEjOvx2hEqJw6kNDqHOu/xMOGPQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Y1F5c4mkRzdwb; Sun, 1 Dec 2024 04:57:24 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 4B14vOrD095861; Sun, 1 Dec 2024 04:57:24 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 4B14vOC1095858; Sun, 1 Dec 2024 04:57:24 GMT (envelope-from git) Date: Sun, 1 Dec 2024 04:57:24 GMT Message-Id: <202412010457.4B14vOC1095858@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: John Baldwin Subject: git: f72d503330a4 - stable/14 - atomic(9): Remove fcmpset-based fallback for atomic_testand(clear|set) List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jhb X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: f72d503330a4d904c3423ebd5fa20606ebe9c7d9 Auto-Submitted: auto-generated The branch stable/14 has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=f72d503330a4d904c3423ebd5fa20606ebe9c7d9 commit f72d503330a4d904c3423ebd5fa20606ebe9c7d9 Author: John Baldwin AuthorDate: 2024-11-19 15:23:15 +0000 Commit: John Baldwin CommitDate: 2024-12-01 02:46:07 +0000 atomic(9): Remove fcmpset-based fallback for atomic_testand(clear|set) All architectures implement a MD version Reviewed by: kib Sponsored by: AFRL, DARPA Differential Revision: https://reviews.freebsd.org/D47629 (cherry picked from commit fa2091d7571ffbae82dfc828f554745f283adeb0) --- sys/arm/include/atomic.h | 4 --- sys/powerpc/include/atomic.h | 6 ----- sys/sys/_atomic_subword.h | 64 -------------------------------------------- 3 files changed, 74 deletions(-) diff --git a/sys/arm/include/atomic.h b/sys/arm/include/atomic.h index dd2ad47e9bed..d632a6db89df 100644 --- a/sys/arm/include/atomic.h +++ b/sys/arm/include/atomic.h @@ -898,8 +898,6 @@ atomic_testandclear_long(volatile u_long *p, u_int v) return (atomic_testandclear_32((volatile uint32_t *)p, v)); } -#define atomic_testandclear_long atomic_testandclear_long - static __inline int atomic_testandclear_64(volatile uint64_t *p, u_int v) @@ -958,7 +956,6 @@ atomic_testandset_long(volatile u_long *p, u_int v) return (atomic_testandset_32((volatile uint32_t *)p, v)); } -#define atomic_testandset_long atomic_testandset_long static __inline int atomic_testandset_acq_long(volatile u_long *p, u_int v) @@ -969,7 +966,6 @@ atomic_testandset_acq_long(volatile u_long *p, u_int v) dmb(); return (ret); } -#define atomic_testandset_acq_long atomic_testandset_acq_long static __inline int atomic_testandset_64(volatile uint64_t *p, u_int v) diff --git a/sys/powerpc/include/atomic.h b/sys/powerpc/include/atomic.h index 77ee5d8c6d46..47fd9ce30fd6 100644 --- a/sys/powerpc/include/atomic.h +++ b/sys/powerpc/include/atomic.h @@ -1093,12 +1093,6 @@ atomic_testandset_acq_long(volatile u_long *p, u_int v) return (a); } -#define atomic_testandclear_int atomic_testandclear_int -#define atomic_testandset_int atomic_testandset_int -#define atomic_testandclear_long atomic_testandclear_long -#define atomic_testandset_long atomic_testandset_long -#define atomic_testandset_acq_long atomic_testandset_acq_long - static __inline void atomic_thread_fence_acq(void) { diff --git a/sys/sys/_atomic_subword.h b/sys/sys/_atomic_subword.h index dc1b2f23e731..dad23383f642 100644 --- a/sys/sys/_atomic_subword.h +++ b/sys/sys/_atomic_subword.h @@ -205,68 +205,4 @@ atomic_load_acq_16(volatile uint16_t *p) #undef _ATOMIC_BYTE_SHIFT #undef _ATOMIC_HWORD_SHIFT -/* - * Provide generic testandset_long implementation based on fcmpset long - * primitive. It may not be ideal for any given arch, so machine/atomic.h - * should define the macro atomic_testandset_long to override with an - * MD-specific version. - * - * (Organizationally, this isn't really subword atomics. But atomic_common is - * included too early in machine/atomic.h, so it isn't a good place for derived - * primitives like this.) - */ -#ifndef atomic_testandset_acq_long -static __inline int -atomic_testandset_acq_long(volatile u_long *p, u_int v) -{ - u_long bit, old; - bool ret; - - bit = (1ul << (v % (sizeof(*p) * NBBY))); - - old = atomic_load_acq_long(p); - ret = false; - while (!ret && (old & bit) == 0) - ret = atomic_fcmpset_acq_long(p, &old, old | bit); - - return (!ret); -} -#endif - -#ifndef atomic_testandset_long -static __inline int -atomic_testandset_long(volatile u_long *p, u_int v) -{ - u_long bit, old; - bool ret; - - bit = (1ul << (v % (sizeof(*p) * NBBY))); - - old = atomic_load_long(p); - ret = false; - while (!ret && (old & bit) == 0) - ret = atomic_fcmpset_long(p, &old, old | bit); - - return (!ret); -} -#endif - -#ifndef atomic_testandclear_long -static __inline int -atomic_testandclear_long(volatile u_long *p, u_int v) -{ - u_long bit, old; - bool ret; - - bit = (1ul << (v % (sizeof(*p) * NBBY))); - - old = atomic_load_long(p); - ret = false; - while (!ret && (old & bit) != 0) - ret = atomic_fcmpset_long(p, &old, old & ~bit); - - return (ret); -} -#endif - #endif /* _SYS__ATOMIC_SUBWORD_H_ */