Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp2661043pxj; Mon, 10 May 2021 08:02:00 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzRqp9qxnR/Q76ij5EDjm3CMHoO23KUa01kxksCtWg6Pgr5s9i4+XmKrFBmgIhMGUawwOgp X-Received: by 2002:a17:906:2557:: with SMTP id j23mr26696282ejb.153.1620658920206; Mon, 10 May 2021 08:02:00 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1620658920; cv=none; d=google.com; s=arc-20160816; b=YCP/aATkGchgdlKoQQ2vzuSGP5b8OD8IJa/3wt6xMb+I3lnSznYiPsEdwa+eu+U/Ct f2GdQY46PsFF0b0v9hctkHJBHJfuPa09b9UHtwgTvsUwk0O3HhvzJYgCIqUycumw0ifF dtm2z4GMLY4BpJvtvmBWb9S2Z8/qtdjYMN0wlHqofbQ0rxXexo7maRM1MosEfAKJBhwD fcD4j8WsOJ993KB7tx2SVJEbF3QX836qMD9SU92Boq7plQy7I3PCKVgTjjdsZofgTIXV jVt6arNvnNOevzCD9eELsfPJGemG1EcmNkEDc3ku3Qr42IdgrXuVSY1r0YrLGtqy8ow0 eKvw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date; bh=Ci0qty/cyV9xej/H0R87T6J6Ct7c70Vq3GN6zlW4jvk=; b=BpKVRR4nf6cLS38TcHa0APSSmPYbLCa/cyDkBxKp7XrShrkRzCEYMGcNDfgvUrh1Bf ebGKWEISgJr4qXJK54qhXUgfo2R04TB9pf4EEzx8Mcgu1FrR1hEx+ycBOI6w26y6wBxH hd74/xNkYFaMjr+fdhQO4tsLpglDG+xBft3RKpTSgDlXjpFMUlUQG/whjGN0/daYlvB1 vga0Q1kg5Psk6RiCUZM7tpCT0AOaaSLBL2Yf369SSs1p/+hSd6WJZgXCNAdiumqz1F8G GJl0ri39BahiBYrEE9arH9W8glo+GJSLcp/MCVfDZEUMIG7Xbu8qU0k9q7z210vgWrtF +osw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id z26si7397239ejr.406.2021.05.10.08.01.33; Mon, 10 May 2021 08:02:00 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S237255AbhEJPBR (ORCPT + 99 others); Mon, 10 May 2021 11:01:17 -0400 Received: from foss.arm.com ([217.140.110.172]:60390 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S237108AbhEJO73 (ORCPT ); Mon, 10 May 2021 10:59:29 -0400 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 5FFBA15BE; Mon, 10 May 2021 07:58:24 -0700 (PDT) Received: from C02TD0UTHF1T.local (unknown [10.57.4.9]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 5B8743F719; Mon, 10 May 2021 07:58:07 -0700 (PDT) Date: Mon, 10 May 2021 15:57:59 +0100 From: Mark Rutland To: linux-kernel@vger.kernel.org, will@kernel.org, boqun.feng@gmail.com, peterz@infradead.org Cc: aou@eecs.berkeley.edu, arnd@arndb.de, bcain@codeaurora.org, benh@kernel.crashing.org, chris@zankel.net, dalias@libc.org, davem@davemloft.net, deanbo422@gmail.com, deller@gmx.de, geert@linux-m68k.org, green.hu@gmail.com, guoren@kernel.org, ink@jurassic.park.msu.ru, James.Bottomley@HansenPartnership.com, jcmvbkbc@gmail.com, jonas@southpole.se, ley.foon.tan@intel.com, linux@armlinux.org.uk, mattst88@gmail.com, monstr@monstr.eu, mpe@ellerman.id.au, nickhu@andestech.com, palmer@dabbelt.com, paulus@samba.org, paul.walmsley@sifive.com, rth@twiddle.net, shorne@gmail.com, stefan.kristiansson@saunalahti.fi, tsbogend@alpha.franken.de, vgupta@synopsys.com, ysato@users.sourceforge.jp Subject: Re: [PATCH 14/33] locking/atomic: arc: move to ARCH_ATOMIC Message-ID: <20210510145759.GB92897@C02TD0UTHF1T.local> References: <20210510093753.40683-1-mark.rutland@arm.com> <20210510093753.40683-15-mark.rutland@arm.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20210510093753.40683-15-mark.rutland@arm.com> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, May 10, 2021 at 10:37:34AM +0100, Mark Rutland wrote: > We'd like all architectures to convert to ARCH_ATOMIC, as once all > architectures are converted it will be possible to make significant > cleanups to the atomics headers, and this will make it much easier to > generically enable atomic functionality (e.g. debug logic in the > instrumented wrappers). > > As a step towards that, this patch migrates arc to ARCH_ATOMIC. The arch > code provides arch_{atomic,atomic64,xchg,cmpxchg}*(), and common code > wraps these with optional instrumentation to provide the regular > functions. > > Signed-off-by: Mark Rutland > Cc: Boqun Feng > Cc: Peter Zijlstra > Cc: Vineet Gupta > Cc: Will Deacon > --- > arch/arc/Kconfig | 1 + > arch/arc/include/asm/atomic.h | 56 +++++++++++++++++++++--------------------- > arch/arc/include/asm/cmpxchg.h | 8 +++--- > 3 files changed, 33 insertions(+), 32 deletions(-) I evidently missed atomic_xchg() in asm/cmpxchg.h, so the fixup below is needed. I've pushed that to my branch on kernel.org for now. Mark. ---->8---- diff --git a/arch/arc/include/asm/cmpxchg.h b/arch/arc/include/asm/cmpxchg.h index 87666980b78a..d1781bdf6527 100644 --- a/arch/arc/include/asm/cmpxchg.h +++ b/arch/arc/include/asm/cmpxchg.h @@ -153,6 +153,6 @@ static inline unsigned long __xchg(unsigned long val, volatile void *ptr, * can't be clobbered by others. Thus no serialization required when * atomic_xchg is involved. */ -#define atomic_xchg(v, new) (xchg(&((v)->counter), new)) +#define arch_atomic_xchg(v, new) (arch_xchg(&((v)->counter), new)) #endif