From nobody Thu Feb 12 03:00:56 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 F1B2CC77B60 for ; Sat, 29 Apr 2023 07:04:49 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231174AbjD2HDR (ORCPT ); Sat, 29 Apr 2023 03:03:17 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42306 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229521AbjD2HDK (ORCPT ); Sat, 29 Apr 2023 03:03:10 -0400 Received: from galois.linutronix.de (Galois.linutronix.de [193.142.43.55]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4C76B2D46; Sat, 29 Apr 2023 00:03:07 -0700 (PDT) Date: Sat, 29 Apr 2023 07:03:04 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1682751784; 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=PHrZ9FO8myesvsT3+YKfiBq9ZFhahSfWgh6mv8erpNE=; b=0hadpFg/6/4frdgccVONIrIwdlvMXRIKC803WNmJvkcT6un3GqyWcaUsh4ZnAkYLQuBAyZ WgkqbDv+1kDfZsBT7TGMmXaM0pRYPEfXxjX11KXDL8Z2/+b5Np1hs+rJj6T3eUpkaRUHJK Y0IWsQ5ZLaV3dOvsaAPGtaaQNxUK6uleaNRNB2b9fTKTF/vOb5/Embcri3Uwk1Ko2W1Bxe arsemQWac5N+UwEwCYMN0aJz8E2rZa4og81usAO+MfHaYcACxMeYFKM/jTJsTvkwh0IJpV gGOjuILXTkh9yxdX6ZvB6WTe/dnq/hOZSKV+sEbq560HPNg8DfZFCIXkxI97vQ== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1682751784; 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=PHrZ9FO8myesvsT3+YKfiBq9ZFhahSfWgh6mv8erpNE=; b=kVoQm8EcR7ajOVRx+Pbwok/lUw1mOaSqBELR2Hx+D6vQ5l//SYrl4xgIwJt1gJxpDCNxnO 8ozeisQ4kvB4VvAw== 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: <168275178427.404.15587499708814984111.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: 1ab70804ef3f829c5a738cba8627f0a0c2486d2b Gitweb: https://git.kernel.org/tip/1ab70804ef3f829c5a738cba8627f0a0c= 2486d2b Author: Uros Bizjak AuthorDate: Wed, 05 Apr 2023 16:17:09 +02:00 Committer: Ingo Molnar CommitterDate: Sat, 29 Apr 2023 08:52:44 +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".