From nobody Sat Feb 7 08:22:13 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 2BCF4C77B6F for ; Thu, 13 Apr 2023 11:38:38 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230031AbjDMLih (ORCPT ); Thu, 13 Apr 2023 07:38:37 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39600 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229578AbjDMLie (ORCPT ); Thu, 13 Apr 2023 07:38:34 -0400 Received: from galois.linutronix.de (Galois.linutronix.de [IPv6:2a0a:51c0:0:12e:550::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 50CEF26BA; Thu, 13 Apr 2023 04:38:33 -0700 (PDT) Date: Thu, 13 Apr 2023 11:38:29 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1681385910; 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=Ar4P6FOes/2YqnqLR0lx/fCeGnBoUm/0XcPCZjCuPDI=; b=X2BwM+WYYjCLXeQhRGcKuv25IH9qr8T2hmdJtA5KgXfFpgUAQghyxvFrNxZZeqmIiK5dl7 ji8RmGmNjmYytUpbbQTdlQgtRCFxafq91tSv+xYkXdG3qrelqIk3pKl7VCjfuQgJly5RJN /gL38NwXAheptmPtC6T+xDzJ2Q0o3dvHX83z9V7xeMP7AIWuOtYfbBTDBaEHnEGziOkvUA SW6AUPzCZoda5hFZCyA/NPIqWvlT5DNcQqueff23BJf++S1Od2UC4plNh6NKVoqq5vBY5C /46sL6NpPPQQi7NDN28wzEhpp1xp/LkGg1bj59cYOeaFoiRRzy3HgP/qVvNnWA== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1681385910; 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=Ar4P6FOes/2YqnqLR0lx/fCeGnBoUm/0XcPCZjCuPDI=; b=tNFuxR8m1Gheh3StghczXrgNQnGDsUyt3qNGkkDWQe9b2CGMhLyp5Vzt96hGX5f8lR1icY ZyFcv5+rhn9VMnCQ== 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)" , 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: <168138590988.404.12145354091229728137.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: 561b081f19655a46a9690e868fa4aa516ff1b62c Gitweb: https://git.kernel.org/tip/561b081f19655a46a9690e868fa4aa516= ff1b62c Author: Uros Bizjak AuthorDate: Wed, 05 Apr 2023 16:17:09 +02:00 Committer: Peter Zijlstra CommitterDate: Wed, 12 Apr 2023 16:46:35 +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) Link: https://lore.kernel.org/r/20230405141710.3551-5-ubizjak@gmail.com --- 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".