Message ID | 20230405141710.3551-5-ubizjak@gmail.com |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:b0ea:0:b0:3b6:4342:cba0 with SMTP id b10csp346190vqo; Wed, 5 Apr 2023 07:22:44 -0700 (PDT) X-Google-Smtp-Source: AKy350bw62rsPeIxMMEM6vhvsUbNEI0HSH6vASx/WKFIxyYMkPj4Dq9FKNEf3Qi3ACpx4QtcRRqx X-Received: by 2002:a17:902:f28c:b0:19c:dbce:dce4 with SMTP id k12-20020a170902f28c00b0019cdbcedce4mr5393562plc.15.1680704564639; Wed, 05 Apr 2023 07:22:44 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1680704564; cv=none; d=google.com; s=arc-20160816; b=mxBHSEq4hSZxh0xbWhozDnLVeoSZ//DL7/H0xGAnMp4XVuwRh13H3DcWBbT8sYiMaG O136HJjtUnfHD91yLkFl/ClG0YJnZ/YRUjJGB03XsiybzgCoiUUy901nyBDESN8iO0Dc Eji9V2F6P8J8Rd/qlYpHkHblxRvFBBTk5AhHwszLJ4JUT+2j14yugFaWnOAFIbtfQRzl 0CuWLpFcde+tGP0AAdqp+6O/nz0cLTPUz3WoeE4t/dMI3dvnjcr+BenwIrOXr1vLloco Skp+bsk6HSCJTv9yeeLsyM0hURxra7KJ3n8MT/wOtea8/0ixaxH3V32qC6SRR0s1Zrz2 pwGw== 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 :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=fOC1m1IyvFx7hqlIu85ltj9Okdj8PWnyI3fah+Gac6o=; b=fboYJH05e5bfHPOYNKVs9seH1n+WJ6nwEQDB3/Xm0kjeWQMF6lervreCCKW2lvbpwN qb2pf5dewW1JJcY0YXUryv1yQ4Ag2ajUGhkrRug+qqNjyriuQf3tMcyEkYOzmJwoztEZ Tsy+OpFhbgjpUoJQvxIg8qTvtQcV2/CDPVqLCl9RcIPcoz/z3c9zzsRfuWrQlTfYbBbA IzV5hP/82tv39oDYihY6xG5bTmA4J9L6EI7C/UgsNbUJafKvcrXdhs6zqAIcseXljiIo ca1bwsxYbk6IPGBLPMC/8qCex9qS702VLVR3pxKs4WniLrBz+3x2aaOOnhyeYmcTMZDN onpQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=dw4QAoMp; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id y7-20020a170902864700b001a046724ae4si11936260plt.238.2023.04.05.07.22.31; Wed, 05 Apr 2023 07:22:44 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=dw4QAoMp; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S238557AbjDEOTM (ORCPT <rfc822;lkml4gm@gmail.com> + 99 others); Wed, 5 Apr 2023 10:19:12 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42898 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S238488AbjDEOSd (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Wed, 5 Apr 2023 10:18:33 -0400 Received: from mail-ed1-x535.google.com (mail-ed1-x535.google.com [IPv6:2a00:1450:4864:20::535]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 08DEE30EB; Wed, 5 Apr 2023 07:17:58 -0700 (PDT) Received: by mail-ed1-x535.google.com with SMTP id y4so141541211edo.2; Wed, 05 Apr 2023 07:17:57 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; t=1680704274; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=fOC1m1IyvFx7hqlIu85ltj9Okdj8PWnyI3fah+Gac6o=; b=dw4QAoMpVGLEOeYQ9Yo6hrg7uuDz1mqcfEuifQdcdnb1mCRfnp4USqcIZ/tj+yoqqd NuZo8Fl4HHUAk4my79oi/1gAt96ZaHSFf0NyBNIA2ujrdK0vV+BtAz9cZUh1HP/21L01 ZfOBKFtABC40OHga/xcc6LZLy5bp81QTL5BA33wmnqyDDroTbAF7IVTNrZhDCZYY5uav cpNPwfW8+ndEboG7KmpMryAu2BP5Ht2BhpnVlW+EgEVP3Hv8o6yChfq1iPaWIKJDgzD/ 9Y/9bUrxWUeU4eBT8lu+LsRKzoAiRRbIgYAetGEXNMYLkTxdyCEUikhfLAP1CktMT2oa eHBA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1680704274; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=fOC1m1IyvFx7hqlIu85ltj9Okdj8PWnyI3fah+Gac6o=; b=fskONODB1V2ldmXITXJT7s4WB7h4edhjrUT+MGQFpF0nH9IS/QkXNe5utcGDXzwRp+ w/zKKNyUEpVQ5EUupAmjs6CBx0TYYf4YF1ny0RWr42PyP+Tj5JXlKNn1nyh8isg7nlsP m2V5fX94uITi8CRYliQ0dOehfPPcV12tejLwIW878oMwViKVd7FignWve93uDqjQGFhC 4negMbRNtZg8rBYCBHEY8nvgxWFZkY3IHMF2wpdhN8t7p/Pl+AV+YK74hw0/FF233dFB 97JqOnhHJMp6ifCFLKTBOM4XWJ5+d6l1P3i7B0r0U5gmqDqqos95PmTtXzDB2RCdoGJU lyTw== X-Gm-Message-State: AAQBX9c/6ONW1L39/eVXhms6kiJNrer/BlNP0/rPShlpDjJE6ejYgQbm jcF2ePQN5VozB+5gyCrxw8E3ASVtIbnZGhXp X-Received: by 2002:a17:906:4a8b:b0:944:43e:7983 with SMTP id x11-20020a1709064a8b00b00944043e7983mr3280252eju.67.1680704274221; Wed, 05 Apr 2023 07:17:54 -0700 (PDT) Received: from localhost.localdomain ([46.248.82.114]) by smtp.gmail.com with ESMTPSA id g6-20020a170906348600b009334219656dsm7381246ejb.56.2023.04.05.07.17.53 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 05 Apr 2023 07:17:53 -0700 (PDT) From: Uros Bizjak <ubizjak@gmail.com> To: linux-alpha@vger.kernel.org, loongarch@lists.linux.dev, linux-mips@vger.kernel.org, linuxppc-dev@lists.ozlabs.org, x86@kernel.org, linux-arch@vger.kernel.org, linux-perf-users@vger.kernel.org, linux-kernel@vger.kernel.org Cc: Uros Bizjak <ubizjak@gmail.com>, Thomas Gleixner <tglx@linutronix.de>, Ingo Molnar <mingo@redhat.com>, Borislav Petkov <bp@alien8.de>, Dave Hansen <dave.hansen@linux.intel.com>, "H. Peter Anvin" <hpa@zytor.com> Subject: [PATCH v2 4/5] locking/x86: Define arch_try_cmpxchg_local Date: Wed, 5 Apr 2023 16:17:09 +0200 Message-Id: <20230405141710.3551-5-ubizjak@gmail.com> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230405141710.3551-1-ubizjak@gmail.com> References: <20230405141710.3551-1-ubizjak@gmail.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-0.2 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM,RCVD_IN_DNSWL_NONE, SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: <linux-kernel.vger.kernel.org> X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1762346469287822276?= X-GMAIL-MSGID: =?utf-8?q?1762346469287822276?= |
Series |
locking: Introduce local{,64}_try_cmpxchg
|
|
Commit Message
Uros Bizjak
April 5, 2023, 2:17 p.m. UTC
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.
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: Ingo Molnar <mingo@redhat.com>
Cc: Borislav Petkov <bp@alien8.de>
Cc: Dave Hansen <dave.hansen@linux.intel.com>
Cc: "H. Peter Anvin" <hpa@zytor.com>
Signed-off-by: Uros Bizjak <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 94fbe6ae7431..540573f515b7 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) +#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))) +#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".