Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp3368390pxj; Tue, 11 May 2021 02:58:43 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzLzke1geSGwfMCf6Q4/inrFFcQGD4X7aDehOrhjNWI1w5gPBlbejDWpXxTAhXCyf58vzqa X-Received: by 2002:a05:6e02:d53:: with SMTP id h19mr24849904ilj.232.1620727123130; Tue, 11 May 2021 02:58:43 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1620727123; cv=none; d=google.com; s=arc-20160816; b=ouHtSLhqb01agxI3ZHWFZl5utrilo50LsBIfqEJ+fPpe1/DLUlHJazFdwjnzK+q6jx HSWJ/8lViuI+erAouNwOutC37yiFBChZMO74s8CxDM1n/pFyUOs3GhYH93R7APgZ0kmt eRkeHhmV1d6ypdYgdYGAsOD7vG3d6T6I9Hcx8N2syoEaGRWgn2mo0503Xb3aQ/9D+8h2 01f/3L5z9CxYRGY6Tnh9VRM3JFH5qElEsoaC1MVpkjdBw2mUK7bdgrSIlXeuItCbwad0 z4DwNPfnEXiCMWsj5nSQbvz0GNGN1onOeB4gWzwGHHaOTQWBqAwAMLdjLpFUSsc6PCfD CZhw== 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=FSDAjStNDmXv+kbXO3kg1X2SeWfBwcOasbLFRscZs/E=; b=N7TwCzvvWcRm+s+WlBEiLMKrw1eR8jXLc9vR+PRY3HFx5iy8fk0NffkDD00h7/fN+W Y23rAnJb91T9xxrCcYxPLxzj8M7KtgcTF6PZ6J/cAcJnfHxdolYf8LyaasLzi/ED5Clc YYbkbh3jMdyHS04ZufwCaZ7rowOohieBP7S3RoBYIlG7UENKjlxv/OHcogaBwezB1KgY 16PmZpPiHRRHwQifzjhiqiTC6VffSCt141KenBW37JUQkMfMQMrMPRfEeGk4WMxd4dUN i3+KRFWNxurys4NrXB0Q8zclIRzySNjZRmZoHpufAQAw885/Q3wFiHfazV7m+JKhfpKh kNUw== 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 z14si20408677ioq.100.2021.05.11.02.58.30; Tue, 11 May 2021 02:58:43 -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 S231382AbhEKJ7F (ORCPT + 99 others); Tue, 11 May 2021 05:59:05 -0400 Received: from foss.arm.com ([217.140.110.172]:44170 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229935AbhEKJ7E (ORCPT ); Tue, 11 May 2021 05:59:04 -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 A9044168F; Tue, 11 May 2021 02:57:57 -0700 (PDT) Received: from C02TD0UTHF1T.local (unknown [10.57.29.91]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 6E9103F719; Tue, 11 May 2021 02:57:40 -0700 (PDT) Date: Tue, 11 May 2021 10:57:37 +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 27/33] locking/atomic: powerpc: move to ARCH_ATOMIC Message-ID: <20210511095737.GC6152@C02TD0UTHF1T.local> References: <20210510093753.40683-1-mark.rutland@arm.com> <20210510093753.40683-28-mark.rutland@arm.com> <20210511091621.GA6152@C02TD0UTHF1T.local> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20210511091621.GA6152@C02TD0UTHF1T.local> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, May 11, 2021 at 10:16:21AM +0100, Mark Rutland wrote: > On Mon, May 10, 2021 at 10:37:47AM +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 powerpc 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: Benjamin Herrenschmidt > > Cc: Boqun Feng > > Cc: Michael Ellerman > > Cc: Paul Mackerras > > Cc: Peter Zijlstra > > Cc: Will Deacon > > --- > > arch/powerpc/Kconfig | 1 + > > arch/powerpc/include/asm/atomic.h | 140 +++++++++++++++++++------------------ > > arch/powerpc/include/asm/cmpxchg.h | 30 ++++---- > > 3 files changed, 89 insertions(+), 82 deletions(-) > > The kbuild test robot spotted a couple of bits I'd got wrong; I've noted > those below (and both are now fixed in my kernel.org branch). > > > static __always_inline bool > > -atomic_try_cmpxchg_lock(atomic_t *v, int *old, int new) > > +arch_atomic_try_cmpxchg_lock(atomic_t *v, int *old, int new) > > Since this isn't part of the core atomic API, and is used directly by > powerpc's spinlock implementation, this should have stayed as-is (or we > should use the `arch_` prefix consitently and update the spinlock code). > > I've dropped the `arch_` prefix for now. On second thought (and having hit a similar issue on m68k), I've added the `arch_` prefix and updated the caller, to more clearly separate the common atomic API and the arch-specific bits. Thanks, Mark.