Message ID | 20231104091615.4884-4-wuqiang.matt@bytedance.com |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:8f47:0:b0:403:3b70:6f57 with SMTP id j7csp1546471vqu; Sat, 4 Nov 2023 02:17:13 -0700 (PDT) X-Google-Smtp-Source: AGHT+IGfoxvld6sjwuQ7USbLIHVISA0aRXjDQ6eNrao2MkxhTuqaJ/jG0Z2XxvpJ8/378aiKkHCY X-Received: by 2002:a05:6a20:1383:b0:17a:fa76:805f with SMTP id hn3-20020a056a20138300b0017afa76805fmr20372355pzc.23.1699089432852; Sat, 04 Nov 2023 02:17:12 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1699089432; cv=none; d=google.com; s=arc-20160816; b=lLD6eBJ+zMC9Uwp6rpNDr7lld7XTWo+15ezMG5JrVcfvkljSb5mRlG46OPTArWnlcw doP4m96zy4OLC18tM+3+Z4s7HSoYeW1rZxztKqqRpWEalVHGtSWzOc0G8thOVNLt4VT+ ngQp7WkjLjgg59Td9ZYP41MP+/IZzx57NWIFBAwtm1vPNqJ00ftd/xd+I7BQC7ddTAog G2zoCXJLz3TJkr+7tlyqDwKDPQZdNE4C6ng42MYkCyEuxzFkwnnPB4tcpQZFc+IsCgkT rgC/gYP+WQngMkuxQtRhlqaIr0/9DRQYshVfFCJEx65XyRaIy9NTGhIcDS95Pp7SK9bb Lg4g== 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=u81VqdenU6rFeGWkxk+k7NmV751uBEWgkJJ/j9Mn6BA=; fh=5cdAk/4eKFcH/8WtTZO0ubPFYqkVoBxeWOjASEhKlHQ=; b=qDQV9gHGrdmtnOHh66Vm1DBeNywofip3UP1889tSrs2QLsW/EmGWoMazW/umG2EUQZ QI7MySd+tTeVYHnWc75fxxN/NYH7+t+OUMGXn3j5Bd22OqT/WspHhGPZu+UKR5K+9Y3n MO5RO3gl5wSagSEEL52tOO2eKLRniFKHXUZ1VF7G5dlw74ODkW/uOK/iJNV+GmNai50e ayFPQ1RVCaT1xYk8bf54prxUcv3vyA6jrSG/TZ1czNVB2qv15wYcHOD5+SuL4wjncqyJ mVqJDobJJBZhydvHJ82aYCmrst4xR3ueAjieI36gAztkWwAycx1HjKT2AY7EBzrTFLla Kheg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@bytedance.com header.s=google header.b=iXZFWWqp; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:3 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=bytedance.com Received: from lipwig.vger.email (lipwig.vger.email. [2620:137:e000::3:3]) by mx.google.com with ESMTPS id d6-20020a17090ad3c600b0027cd01b6cb0si3255309pjw.125.2023.11.04.02.17.12 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 04 Nov 2023 02:17:12 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:3 as permitted sender) client-ip=2620:137:e000::3:3; Authentication-Results: mx.google.com; dkim=pass header.i=@bytedance.com header.s=google header.b=iXZFWWqp; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:3 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=bytedance.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by lipwig.vger.email (Postfix) with ESMTP id 4AE01817890C; Sat, 4 Nov 2023 02:17:08 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at lipwig.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229600AbjKDJQ5 (ORCPT <rfc822;lhua1029@gmail.com> + 35 others); Sat, 4 Nov 2023 05:16:57 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44104 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229468AbjKDJQv (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Sat, 4 Nov 2023 05:16:51 -0400 Received: from mail-pl1-x62a.google.com (mail-pl1-x62a.google.com [IPv6:2607:f8b0:4864:20::62a]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E06E8D48 for <linux-kernel@vger.kernel.org>; Sat, 4 Nov 2023 02:16:48 -0700 (PDT) Received: by mail-pl1-x62a.google.com with SMTP id d9443c01a7336-1cc3bb32b5dso25593865ad.3 for <linux-kernel@vger.kernel.org>; Sat, 04 Nov 2023 02:16:48 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bytedance.com; s=google; t=1699089408; x=1699694208; darn=vger.kernel.org; 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=u81VqdenU6rFeGWkxk+k7NmV751uBEWgkJJ/j9Mn6BA=; b=iXZFWWqpaH4lrEjLLgW4xKnBoKhtVmWVQ6o192cCZsu/A2WluT+/ABCn+FH76UY9wb mFug182r1PZt5hqvYxYgHaDoWHWl+nZODIOs1iUxm4mFRK5Yw2fQlVPpesAool2Pb9oO cHYSJnr1t8t05HRzYt5Z6Y6rHJ8L+clIozV5ooPGIvnqOUzCcwDMFR9iurKTHioFouyi Hb2HDSwecBtNY705+VUJWX4n5NU3AvBuoZbHslPdjyJTs93/nMSwwvwjEAhPD2ldY2oE gMrElQcY49bYFh8CoVy0aot1xFBZlMXzDoRAP5K0kLIwy5ryavHTJq6LmA2Fl2CW8NoT nVPQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1699089408; x=1699694208; 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=u81VqdenU6rFeGWkxk+k7NmV751uBEWgkJJ/j9Mn6BA=; b=mpY5mk8cEiOSDq5P+QOa5ebb5gqml4ggydqW8DFJjLcWRHIMJdpjSt0j04PgLcDlFo fij/lNzCB0jcOm3J7+FnFSqplafB6fiJUNrSdR1RZwUua+Oov8a+OpCQdVjXdvMxbXYf WsiVEJjf3ydFt3tYgc+GPeytEyOCTonM9vSV4Za7UM8x+YJ9QQaM0Hsg4rNMKGFUINjL Em1lfQ5jEl2D0THeNNs4G5WtdR3op44109yzbBWmhPCfxR3g4YSpoaCjphm97SW9aOtw eXfJfEslwZ6TLK8Yb8BRxxtto39DOES0+zThqi+f5HWUP0oN/Wy/B8OgSsRAwd/5Kh8f gRDA== X-Gm-Message-State: AOJu0Yw/fhTME8BrvgZi7nvqzo6qKSHBVTqcV1cJPT6kZAqFVFaP2fxH WWEHdxR6I+DxGOVrI+y3ZY8IZA== X-Received: by 2002:a17:902:ea0d:b0:1cc:4f55:db72 with SMTP id s13-20020a170902ea0d00b001cc4f55db72mr20756805plg.0.1699089408468; Sat, 04 Nov 2023 02:16:48 -0700 (PDT) Received: from devz1.bytedance.net ([203.208.167.147]) by smtp.gmail.com with ESMTPSA id d4-20020a170903230400b001cc54202429sm2585127plh.288.2023.11.04.02.16.41 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 04 Nov 2023 02:16:48 -0700 (PDT) From: "wuqiang.matt" <wuqiang.matt@bytedance.com> To: vgupta@kernel.org, bcain@quicinc.com, jonas@southpole.se, stefan.kristiansson@saunalahti.fi, shorne@gmail.com, geert@linux-m68k.org, andi.shyti@linux.intel.com, mingo@kernel.org, palmer@rivosinc.com, andrzej.hajda@intel.com, arnd@arndb.de, peterz@infradead.orgm, mhiramat@kernel.org Cc: linux-snps-arc@lists.infradead.org, linux-kernel@vger.kernel.org, linux-hexagon@vger.kernel.org, linux-openrisc@vger.kernel.org, linux-trace-kernel@vger.kernel.org, mattwu@163.com, linux@roeck-us.ne, "wuqiang.matt" <wuqiang.matt@bytedance.com> Subject: [PATCH v2 3/4] locking/atomic: openrisc: arch_cmpxchg[64]_local undefined Date: Sat, 4 Nov 2023 17:16:14 +0800 Message-Id: <20231104091615.4884-4-wuqiang.matt@bytedance.com> X-Mailer: git-send-email 2.40.1 In-Reply-To: <20231104091615.4884-1-wuqiang.matt@bytedance.com> References: <20231104091615.4884-1-wuqiang.matt@bytedance.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-0.9 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE,URIBL_BLOCKED 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: <linux-kernel.vger.kernel.org> 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, 04 Nov 2023 02:17:08 -0700 (PDT) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1781624400978774755 X-GMAIL-MSGID: 1781624400978774755 |
Series |
locking/atomic: arch_cmpxchg[64]_local undefined
|
|
Commit Message
wuqiang.matt
Nov. 4, 2023, 9:16 a.m. UTC
For architectures that support native cmpxchg, we'd like to
implement arch_cmpxchg[64]_local with the native variants of
supported data size. If not, the generci_cmpxchg[64]_local
will be used.
Signed-off-by: wuqiang.matt <wuqiang.matt@bytedance.com>
---
arch/openrisc/include/asm/cmpxchg.h | 6 ++++++
1 file changed, 6 insertions(+)
Comments
On Sat, 4 Nov 2023 17:16:14 +0800 "wuqiang.matt" <wuqiang.matt@bytedance.com> wrote: > For architectures that support native cmpxchg, we'd like to > implement arch_cmpxchg[64]_local with the native variants of > supported data size. If not, the generci_cmpxchg[64]_local > will be used. Looks good to me. Reviewed-by: Masami Hiramatsu (Google) <mhiramat@kernel.org> > > Signed-off-by: wuqiang.matt <wuqiang.matt@bytedance.com> > --- > arch/openrisc/include/asm/cmpxchg.h | 6 ++++++ > 1 file changed, 6 insertions(+) > > diff --git a/arch/openrisc/include/asm/cmpxchg.h b/arch/openrisc/include/asm/cmpxchg.h > index 8ee151c072e4..f1ffe8b6f5ef 100644 > --- a/arch/openrisc/include/asm/cmpxchg.h > +++ b/arch/openrisc/include/asm/cmpxchg.h > @@ -139,6 +139,12 @@ static inline unsigned long __cmpxchg(volatile void *ptr, unsigned long old, > (unsigned long)(n), \ > sizeof(*(ptr))); \ > }) > +#define arch_cmpxchg_local arch_cmpxchg > + > +/* always make arch_cmpxchg64_local available for openrisc */ > +#include <asm-generic/cmpxchg-local.h> > + > +#define arch_cmpxchg64_local(ptr, o, n) __generic_cmpxchg64_local((ptr), (o), (n)) > > /* > * This function doesn't exist, so you'll get a linker error if > -- > 2.40.1 >
diff --git a/arch/openrisc/include/asm/cmpxchg.h b/arch/openrisc/include/asm/cmpxchg.h index 8ee151c072e4..f1ffe8b6f5ef 100644 --- a/arch/openrisc/include/asm/cmpxchg.h +++ b/arch/openrisc/include/asm/cmpxchg.h @@ -139,6 +139,12 @@ static inline unsigned long __cmpxchg(volatile void *ptr, unsigned long old, (unsigned long)(n), \ sizeof(*(ptr))); \ }) +#define arch_cmpxchg_local arch_cmpxchg + +/* always make arch_cmpxchg64_local available for openrisc */ +#include <asm-generic/cmpxchg-local.h> + +#define arch_cmpxchg64_local(ptr, o, n) __generic_cmpxchg64_local((ptr), (o), (n)) /* * This function doesn't exist, so you'll get a linker error if