Received: by 2002:a05:7412:419a:b0:f3:1519:9f41 with SMTP id i26csp2181912rdh; Sat, 25 Nov 2023 17:39:54 -0800 (PST) X-Google-Smtp-Source: AGHT+IGBGrrg1ZwUbpIdgwCxyfX31OKdCiPVcgNjZP5HgENjrjMiCt4iMTeRYWehq2Q9q4B/GL5/ X-Received: by 2002:a05:6808:150c:b0:3b2:dcff:9e54 with SMTP id u12-20020a056808150c00b003b2dcff9e54mr10726518oiw.24.1700962794049; Sat, 25 Nov 2023 17:39:54 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1700962794; cv=none; d=google.com; s=arc-20160816; b=TK/VIzswEMUnM1WYFsjISiwucnmijQ0tMD8cd1a0hS2Ndycee0qXaqmblhbRNQTw5x crMCjlfr4uKYtTzFFkZdU+rfs9RXWzheDlVyhGgLpNpwCD5M5lOXQEuDT0XEmLfYT3Hy 0suXruF3HvcxCrsaUxIECU5mS0rwDecuS4Gr5OrXTKsDmwrqcsk9Dm1EYj3ruldJhlwo 56563afNGpjfryLmaw+N6oRPkeEQm0AstHZpcC2HIVInNjCb0xYtcCKicFR7HhPqXxcK axTytc4lzhp0D/fhF1/lqvTCUGc2dVeFiVpYqISPrrZQvtEDD7STpRVKOO7mr4zBxcSm fTkA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature; bh=ubXBgcN/V5uhvwm+IW79NGBs6Td6RLVY4kT4l33MlXU=; fh=APTQWjl682syqgfge5HhHyaaKaccmtrAP3HJHDWj4/U=; b=F0v16Sw10xjZKBumSqc0t46fjHIefK6jveP5gr5uG6AA2RX6McIPi5RrH2vYLdAnSn MaXfwUZfmV1lltN5GNoE64DBX+ZO5uwmwhX26NAqKxSiwkMcJNXZiPrNkqs4AQNmV3Vc /xwm9EQBLd9FH+hh4Gk7fCbnFaSUVx8wShRPhlk2VN9QeqhTXxF1BUO72vswi+ywBui+ fZu/Ws3tBf/JNEXno+Guoj1saG0enPtDR5JadnRNUIKbNKuIAJCcrCneJaVQ1Tuk2u2e Su6WtdPBCs8MwTa0wHg+/YPBoJiiieZy1Xsvw9/Gu+mQrvJroyvwSDvgKmLh/3Xkf/iC oZLA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=PNv28jjv; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.33 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from lipwig.vger.email (lipwig.vger.email. [23.128.96.33]) by mx.google.com with ESMTPS id d13-20020a056a00244d00b006cb916f7794si6866912pfj.183.2023.11.25.17.39.53 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 25 Nov 2023 17:39:54 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.33 as permitted sender) client-ip=23.128.96.33; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=PNv28jjv; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.33 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by lipwig.vger.email (Postfix) with ESMTP id B5276805FD1A; Sat, 25 Nov 2023 17:39:51 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at lipwig.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229505AbjKZBj3 (ORCPT + 99 others); Sat, 25 Nov 2023 20:39:29 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46940 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229456AbjKZBj2 (ORCPT ); Sat, 25 Nov 2023 20:39:28 -0500 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 84F9711D for ; Sat, 25 Nov 2023 17:39:33 -0800 (PST) Received: by smtp.kernel.org (Postfix) with ESMTPSA id EFD0CC433C8; Sun, 26 Nov 2023 01:39:30 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1700962773; bh=Gzo6Hsh3Ci46CKtC3ZBKQ5dZrI4nYrnZIk9M/HBJe7E=; h=From:To:Cc:Subject:Date:From; b=PNv28jjvA4pEzsf+PvzuM/HHiy+omZA5pirgSl1AZlAOpLP2ODIoUdk+SFfUoebA0 9VcgatdekVmD6Er34I2XBK0T4xHycvjGTDNqwgvJ1WeadkcSxwDxj0dXaCgYVku4uy FPnWe66KicALFh7WzHDoIl9Qzf6w1n/e/ck3HAsUAdAJxb96rJM9ae/XVC+jVAFgmc MlrkOtbqz1kyPK+ghkWqUuw36azbW51ChR1kg1gPZTarThA0SlnpOn2nOA4evK8Pub FpzuthpQIBhIN6E2UTm7R8+b3Lft5/MRqpr53i2cJlAMUPfjrILSEe/UC1PH77Cmhk 9ZqL1wOdbs28Q== From: guoren@kernel.org To: mark.rutland@arm.com, peterz@infradead.org, keescook@chromium.org, paulmck@kernel.org, ubizjak@gmail.com, tglx@linutronix.de Cc: linux-kernel@vger.kernel.org, Guo Ren , Guo Ren Subject: [PATCH V3] locking/atomic: scripts: Exclude arch_atomic(64)_read(set) mappings Date: Sat, 25 Nov 2023 20:39:21 -0500 Message-Id: <20231126013921.103133-1-guoren@kernel.org> X-Mailer: git-send-email 2.36.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-1.2 required=5.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lipwig.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (lipwig.vger.email [0.0.0.0]); Sat, 25 Nov 2023 17:39:51 -0800 (PST) From: Guo Ren The definitions of atomic(64)_read(set) are relax version, and using them for acquire and release is incorrect, so exclude these mappings. Signed-off-by: Guo Ren Signed-off-by: Guo Ren --- Changelog: v3: - Minimize modification on atomic(64)_read(set) v2: - Use gen-atomic-fallback.sh instead of header modification --- include/linux/atomic/atomic-arch-fallback.h | 10 +--------- scripts/atomic/gen-atomic-fallback.sh | 3 ++- 2 files changed, 3 insertions(+), 10 deletions(-) diff --git a/include/linux/atomic/atomic-arch-fallback.h b/include/linux/atomic/atomic-arch-fallback.h index 18f5744dfb5d..b83ef19da13d 100644 --- a/include/linux/atomic/atomic-arch-fallback.h +++ b/include/linux/atomic/atomic-arch-fallback.h @@ -459,8 +459,6 @@ raw_atomic_read_acquire(const atomic_t *v) { #if defined(arch_atomic_read_acquire) return arch_atomic_read_acquire(v); -#elif defined(arch_atomic_read) - return arch_atomic_read(v); #else int ret; @@ -508,8 +506,6 @@ raw_atomic_set_release(atomic_t *v, int i) { #if defined(arch_atomic_set_release) arch_atomic_set_release(v, i); -#elif defined(arch_atomic_set) - arch_atomic_set(v, i); #else if (__native_word(atomic_t)) { smp_store_release(&(v)->counter, i); @@ -2575,8 +2571,6 @@ raw_atomic64_read_acquire(const atomic64_t *v) { #if defined(arch_atomic64_read_acquire) return arch_atomic64_read_acquire(v); -#elif defined(arch_atomic64_read) - return arch_atomic64_read(v); #else s64 ret; @@ -2624,8 +2618,6 @@ raw_atomic64_set_release(atomic64_t *v, s64 i) { #if defined(arch_atomic64_set_release) arch_atomic64_set_release(v, i); -#elif defined(arch_atomic64_set) - arch_atomic64_set(v, i); #else if (__native_word(atomic64_t)) { smp_store_release(&(v)->counter, i); @@ -4657,4 +4649,4 @@ raw_atomic64_dec_if_positive(atomic64_t *v) } #endif /* _LINUX_ATOMIC_FALLBACK_H */ -// 202b45c7db600ce36198eb1f1fc2c2d5268ace2d +// 2fdd6702823fa842f9cea57a002e6e4476ae780c diff --git a/scripts/atomic/gen-atomic-fallback.sh b/scripts/atomic/gen-atomic-fallback.sh index c0c8a85d7c81..282a1d3c41d4 100755 --- a/scripts/atomic/gen-atomic-fallback.sh +++ b/scripts/atomic/gen-atomic-fallback.sh @@ -102,7 +102,8 @@ gen_proto_order_variant() fi # Allow ACQUIRE/RELEASE/RELAXED ops to be defined in terms of FULL ops - if [ ! -z "${order}" ]; then + # Exclude arch_atomic(64)_read(set) mappings because these are not FULL ops. + if [ ! -z "${order}" ] && [ "${name}" != "read" ] && [ "${name}" != "set" ]; then printf "#elif defined(arch_${basename})\n" printf "\t${retstmt}arch_${basename}(${args});\n" fi -- 2.36.1