Received: by 2002:a05:6500:2018:b0:1fb:9675:f89d with SMTP id t24csp672381lqh; Fri, 31 May 2024 12:42:35 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCXrTyCgVbcI4BBmJM59JdrkdBntGwd9uDzjYHjFPEGiYx1Aoi56GmNhzT1flQwDkbvwi6FNkZU/Z8VonkY6wlXkyxCoxgr9xU3SR6/kOQ== X-Google-Smtp-Source: AGHT+IF741xKvsNnkPZ+fLwwAJlso+taFNN2+sI3kxekH4ZHPkBBomERTvDQrAqh0O12NfgIjNW4 X-Received: by 2002:a0d:cd86:0:b0:627:e3a5:1884 with SMTP id 00721157ae682-62c796bf137mr28293037b3.12.1717184554139; Fri, 31 May 2024 12:42:34 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1717184554; cv=pass; d=google.com; s=arc-20160816; b=Mk70GGiXlkwf2EvlzfixoXW+5/kBcTdho2V0Q+OtLPwJ6dngN6/FjYWiOViE/lwfIX SfO3BLR/wnjS7kFJonBorOfPXvijvV0ze8h73wSr+hRbM/6rNmQifsYtpYuZ0/YZiFIp DqMC1h9T44li7DN0MH+eQ4rQg5r+j4p9nR/hpqCECv98W9mhOgc4ToH9+tPHKR/fuTNx AaB7u18TDMlPJLVVU1du8dpGYPEnD68WvH0GYi8Mzfl3TqE7gx/5CrLebuqaVEdgNS3A WCtMP7Nt26Qh2UTGR5WV8NA7KS+8pRxvG9aelHQ7WUu+EVTH2hWx+EahjOMptXokBRHS Ymxw== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=in-reply-to:content-disposition:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:reply-to:message-id :subject:cc:to:from:date:dkim-signature; bh=pcE0OfUiZZh1OgoxONMAVOrtYKyQwjLGsZuZSVHCUlY=; fh=56QjMPTUipCbHWtiEIJrxvPZ6mRr4PwGaeCNh65HYNE=; b=EGKu/dDn9hRfyOPg/vBZupESL0SNQRAZAFUf+niqVDFwdvJtO08XEhi9ss/EbUIHWC bs8vcopnig51RRYZlpZDLjNO/wDLJucdZ4gEyQJXbtxRUagOtMXJxAZSTwb+ca3woOT3 F8MSS6EQZs0SWbDtj03ansdYqUk43NNy3H88kZzWRCZZe1enfa4PwAxsTMGbXULfaimC ZemIGeuMxkWkhWuz7KmTA2wmuRZl7WYtE98DC76X6dZSJeJFInm0DWzuQw2NvXzvxJCX qxad+VMrjrdm1re8h9l2jAfAzNSm9rzt9h2tz87OrWiyNLa04Maqrd4AEG7oVt3OURdi GnnQ==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=EpsfUyDE; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-197387-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-197387-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [2604:1380:45d1:ec00::1]) by mx.google.com with ESMTPS id af79cd13be357-794f3184b03si122153385a.418.2024.05.31.12.42.33 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 31 May 2024 12:42:34 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-197387-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) client-ip=2604:1380:45d1:ec00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=EpsfUyDE; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-197387-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-197387-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ny.mirrors.kernel.org (Postfix) with ESMTPS id CB83A1C24AD7 for ; Fri, 31 May 2024 19:42:33 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 149BA17C7AA; Fri, 31 May 2024 19:42:28 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="EpsfUyDE" Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 1A8187E788; Fri, 31 May 2024 19:42:26 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717184547; cv=none; b=BPa6L/qwMkf6Vkebs3C83oCVHjl3QBnPYgOsJgvXGQajwC1Hl1J6qlzoGeCI6JlaueaDxqBQ1/p2S4Lu1qEHbt/c4bBmFXiLkmKBQw9HBElpqkIawFHY2p2I13JpN6AvAQWkcTNstbhQUF05bd2HDzTpNz4wJj9AeqB8BkxvYC4= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717184547; c=relaxed/simple; bh=IHtY4B5fyvO4/kzwdP0+z8rMYAMuQ09eRmDS4pTYFTc=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=NTHEFPv5Cs+6tRaYiTQM4PteQ4YU8O42FtqIMzYPPQtcP+uQIZShpnLZiMBmMIzw8pHWP6BTequ0wfs2JdUIYRGAx4uccVOnP+CaHF0mApiGA5rUV0umCfncDmljZyiKPh0zpJ6UI6Z+CWVJW2MAVyv+VMCKsOAN/vtebUAttug= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=EpsfUyDE; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id 9B2DCC116B1; Fri, 31 May 2024 19:42:26 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1717184546; bh=IHtY4B5fyvO4/kzwdP0+z8rMYAMuQ09eRmDS4pTYFTc=; h=Date:From:To:Cc:Subject:Reply-To:References:In-Reply-To:From; b=EpsfUyDEfoc4GlQNr5/qC/rYJf8CRPzzKGQUfTc7IU9IUTZNp1q98+3dTDuKCbEnn YhDUZX2XNqj92hNk46/RoBzz9kFPMjVDY+EcvUwnMP4zR89qq3CE6XunMvcQrA+i08 mV/cg9CuzC/VYHdMpIROINmHesTgSjKTeswUg2sqTR6wOXFQqte+LFmMIz15BWKnOv pCJpZVwn3dCxyNUVq+I/tdZGueAKlR9dS1WNaRwjnNELnVyagDeH4pzKrVKZweDhI2 tBNmnY7jP9EdESxwaMjqdzXV977X1qU04SbJEoc2oReu1WJP4nRa/rH8LKJe56WUFV ceQL5p5ID2uFA== Received: by paulmck-ThinkPad-P17-Gen-1.home (Postfix, from userid 1000) id 42BADCE3ED6; Fri, 31 May 2024 12:42:26 -0700 (PDT) Date: Fri, 31 May 2024 12:42:26 -0700 From: "Paul E. McKenney" To: Nathan Chancellor Cc: Arnd Bergmann , Russell King , Naresh Kamboju , open list , Linux ARM , lkft-triage@lists.linaro.org, Linux Regressions , rcu , Dan Carpenter , Joel Fernandes , neeraj.upadhyay@kernel.org, John Ogness , broonie@kernel.org Subject: Re: arm-linux-gnueabihf-ld: kernel/rcu/update.o:update.c:(.text+0x1cc4): more undefined references to `__bad_cmpxchg' follow Message-ID: Reply-To: paulmck@kernel.org References: <7f61cc11-7afe-46ac-9f07-62e0b9ab429f@app.fastmail.com> <5426b25f-9c25-4938-99e8-5cdea75e4d3b@paulmck-laptop> <214a33ac-d4fa-4d48-ad3c-ad8b00ae1a5e@paulmck-laptop> <20240530215153.GA466604@thelio-3990X> <583e2476-50c5-4f9c-85af-f4489a53083b@paulmck-laptop> <20240530233053.GA1601862@thelio-3990X> <3ce74da3-0b21-439b-af72-e80bfe0e9f02@paulmck-laptop> <20240531162722.GA1457604@thelio-3990X> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20240531162722.GA1457604@thelio-3990X> On Fri, May 31, 2024 at 09:27:22AM -0700, Nathan Chancellor wrote: > On Thu, May 30, 2024 at 05:35:44PM -0700, Paul E. McKenney wrote: > > On Thu, May 30, 2024 at 04:30:53PM -0700, Nathan Chancellor wrote: > > > On Thu, May 30, 2024 at 03:05:21PM -0700, Paul E. McKenney wrote: > > > > On Thu, May 30, 2024 at 02:52:48PM -0700, Nathan Chancellor wrote: > > > > > On Thu, May 30, 2024 at 10:24:05AM -0700, Paul E. McKenney wrote: > > > > > > And for an untested first attempt at a fix. > > > > > > > > > > > > What did I mess up this time? ;-) > > > > > > > > > > An include for cmpxchg-emu.h ;) > > > > > > > > > > In file included from arch/arm/include/asm/atomic.h:16, > > > > > from include/linux/atomic.h:7, > > > > > from include/asm-generic/bitops/lock.h:5, > > > > > from arch/arm/include/asm/bitops.h:245, > > > > > from include/linux/bitops.h:63, > > > > > from include/linux/log2.h:12, > > > > > from kernel/bounds.c:13: > > > > > arch/arm/include/asm/cmpxchg.h: In function '__cmpxchg': > > > > > arch/arm/include/asm/cmpxchg.h:167:26: error: implicit declaration of function 'cmpxchg_emu_u8' [-Werror=implicit-function-declaration] > > > > > 167 | oldval = cmpxchg_emu_u8((volatile u8 *)ptr, old, new); > > > > > | ^~~~~~~~~~~~~~ > > > > > cc1: some warnings being treated as errors > > > > > > > > Good catch, and thank you for testing this! Does the updated version > > > > shown below do better? > > > > > > Yes, that matches what I tested locally before I replied initially. > > > > Very good! May I please add your Tested-by? > > Sure thing. > > Tested-by: Nathan Chancellor Thank you! I will apply this on my next rebase. Thanx, Paul > > > > ------------------------------------------------------------------------ > > > > > > > > commit 74e3470afacaa9d2f37db4773a5fef887ac4ef56 > > > > Author: Paul E. McKenney > > > > Date: Thu May 30 10:11:31 2024 -0700 > > > > > > > > ARM: Emulate one-byte cmpxchg > > > > > > > > Use the new cmpxchg_emu_u8() to emulate one-byte cmpxchg() on ARM systems > > > > with ARCH < ARMv6K. > > > > > > > > [ paulmck: Apply Arnd Bergmann and Nathan Chancellor feedback. ] > > > > > > > > Reported-by: Mark Brown > > > > Closes: https://lore.kernel.org/all/54798f68-48f7-4c65-9cba-47c0bf175143@sirena.org.uk/ > > > > Reported-by: Naresh Kamboju > > > > Closes: https://lore.kernel.org/all/CA+G9fYuZ+pf6p8AXMZWtdFtX-gbG8HMaBKp=XbxcdzA_QeLkxQ@mail.gmail.com/ > > > > Signed-off-by: Paul E. McKenney > > > > Cc: "Russell King (Oracle)" > > > > Cc: Arnd Bergmann > > > > Cc: Andrew Davis > > > > Cc: Andrew Morton > > > > Cc: Linus Walleij > > > > Cc: Eric DeVolder > > > > Cc: Rob Herring > > > > Cc: > > > > > > > > diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig > > > > index ee5115252aac4..a867a7d967aa5 100644 > > > > --- a/arch/arm/Kconfig > > > > +++ b/arch/arm/Kconfig > > > > @@ -34,6 +34,7 @@ config ARM > > > > select ARCH_MIGHT_HAVE_PC_PARPORT > > > > select ARCH_OPTIONAL_KERNEL_RWX if ARCH_HAS_STRICT_KERNEL_RWX > > > > select ARCH_OPTIONAL_KERNEL_RWX_DEFAULT if CPU_V7 > > > > + select ARCH_NEED_CMPXCHG_1_EMU if CPU_V6 > > > > select ARCH_SUPPORTS_ATOMIC_RMW > > > > select ARCH_SUPPORTS_CFI_CLANG > > > > select ARCH_SUPPORTS_HUGETLBFS if ARM_LPAE > > > > diff --git a/arch/arm/include/asm/cmpxchg.h b/arch/arm/include/asm/cmpxchg.h > > > > index 44667bdb4707a..a428e06fe94ee 100644 > > > > --- a/arch/arm/include/asm/cmpxchg.h > > > > +++ b/arch/arm/include/asm/cmpxchg.h > > > > @@ -5,6 +5,7 @@ > > > > #include > > > > #include > > > > #include > > > > +#include > > > > > > > > #if defined(CONFIG_CPU_SA1100) || defined(CONFIG_CPU_SA110) > > > > /* > > > > @@ -162,7 +163,11 @@ static inline unsigned long __cmpxchg(volatile void *ptr, unsigned long old, > > > > prefetchw((const void *)ptr); > > > > > > > > switch (size) { > > > > -#ifndef CONFIG_CPU_V6 /* min ARCH >= ARMv6K */ > > > > +#ifdef CONFIG_CPU_V6 /* min ARCH < ARMv6K */ > > > > + case 1: > > > > + oldval = cmpxchg_emu_u8((volatile u8 *)ptr, old, new); > > > > + break; > > > > +#else /* min ARCH >= ARMv6K */ > > > > case 1: > > > > do { > > > > asm volatile("@ __cmpxchg1\n"