From nobody Thu Feb 12 03:00:58 2026 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 98480C77B7E for ; Sat, 29 Apr 2023 07:18:15 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230417AbjD2HSN (ORCPT ); Sat, 29 Apr 2023 03:18:13 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47908 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229501AbjD2HSJ (ORCPT ); Sat, 29 Apr 2023 03:18:09 -0400 Received: from galois.linutronix.de (Galois.linutronix.de [IPv6:2a0a:51c0:0:12e:550::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id CE4E01986; Sat, 29 Apr 2023 00:18:08 -0700 (PDT) Date: Sat, 29 Apr 2023 07:18:07 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1682752687; h=from:from:sender:sender:reply-to:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=DOzuSnTmxSim7dIvzyWlqGRd9comMl0rFJQ+W3TYF6c=; b=nA5wJmZe7BA+656vc7kwgAW3Lr83gzuK9BnN64sxJNUYUGruri5guG54il6r/nuL6vjw7I KsKXU7nhgLqfFj7Q5VgS/7pZqJFLHwbs48w8xI0PZ34xzZcechMSZrP/MUh+annWWc/iFo ak6YB6JANenVN6ndnRMUIItcjBWBaxc9qpUaz8kjbiSiCbI/OUgffuny4jRts56l1fm47b sutJwyj2UdJ0sLMHUuTy4NEbiZ81jbhi3lRIOxG8TLm691FA9sAR5ORubX+sWgmCecDCaQ Q90YhrSFvdYy7E3i+jCjWbgBbiqrhrywLZ1ubgxkMACGSpsIbKRpQd4QXxZB/w== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1682752687; h=from:from:sender:sender:reply-to:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=DOzuSnTmxSim7dIvzyWlqGRd9comMl0rFJQ+W3TYF6c=; b=sE3lkBWWYmhnqEukVTnfLQ7ChsT5xCdomOdpGbUQft62fOIdnz9AGhJ4Qj1ZRWSuErDRZP YzLUzgf+HUAbLIAQ== From: "tip-bot2 for Uros Bizjak" Sender: tip-bot2@linutronix.de Reply-to: linux-kernel@vger.kernel.org To: linux-tip-commits@vger.kernel.org Subject: [tip: locking/core] locking/x86: Define arch_try_cmpxchg_local() Cc: Uros Bizjak , "Peter Zijlstra (Intel)" , Ingo Molnar , Linus Torvalds , x86@kernel.org, linux-kernel@vger.kernel.org In-Reply-To: <20230405141710.3551-5-ubizjak@gmail.com> References: <20230405141710.3551-5-ubizjak@gmail.com> MIME-Version: 1.0 Message-ID: <168275268710.404.16959421973467678972.tip-bot2@tip-bot2> Robot-ID: Robot-Unsubscribe: Contact to get blacklisted from these emails Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The following commit has been merged into the locking/core branch of tip: Commit-ID: 5cd4c268412f802e71b7722c3ec4638b0fe04acd Gitweb: https://git.kernel.org/tip/5cd4c268412f802e71b7722c3ec4638b0= fe04acd Author: Uros Bizjak AuthorDate: Wed, 05 Apr 2023 16:17:09 +02:00 Committer: Ingo Molnar CommitterDate: Sat, 29 Apr 2023 09:09:23 +02:00 locking/x86: Define arch_try_cmpxchg_local() Define target specific arch_try_cmpxchg_local(). This definition overrides the generic arch_try_cmpxchg_local() fallback definition and enables target-specific implementation of try_cmpxchg_local(). Signed-off-by: Uros Bizjak Signed-off-by: Peter Zijlstra (Intel) Signed-off-by: Ingo Molnar Link: https://lore.kernel.org/r/20230405141710.3551-5-ubizjak@gmail.com Cc: Linus Torvalds --- arch/x86/include/asm/cmpxchg.h | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/arch/x86/include/asm/cmpxchg.h b/arch/x86/include/asm/cmpxchg.h index 94fbe6a..540573f 100644 --- a/arch/x86/include/asm/cmpxchg.h +++ b/arch/x86/include/asm/cmpxchg.h @@ -221,9 +221,15 @@ extern void __add_wrong_size(void) #define __try_cmpxchg(ptr, pold, new, size) \ __raw_try_cmpxchg((ptr), (pold), (new), (size), LOCK_PREFIX) =20 +#define __try_cmpxchg_local(ptr, pold, new, size) \ + __raw_try_cmpxchg((ptr), (pold), (new), (size), "") + #define arch_try_cmpxchg(ptr, pold, new) \ __try_cmpxchg((ptr), (pold), (new), sizeof(*(ptr))) =20 +#define arch_try_cmpxchg_local(ptr, pold, new) \ + __try_cmpxchg_local((ptr), (pold), (new), sizeof(*(ptr))) + /* * xadd() adds "inc" to "*ptr" and atomically returns the previous * value of "*ptr".