mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Nathan Chancellor <nathan@kernel.org>
To: "Paul E. McKenney" <paulmck@kernel.org>
Cc: Arnd Bergmann <arnd@arndb.de>,
	Russell King <linux@armlinux.org.uk>,
	Naresh Kamboju <naresh.kamboju@linaro.org>,
	open list <linux-kernel@vger.kernel.org>,
	Linux ARM <linux-arm-kernel@lists.infradead.org>,
	lkft-triage@lists.linaro.org,
	Linux Regressions <regressions@lists.linux.dev>,
	rcu <rcu@vger.kernel.org>,
	Dan Carpenter <dan.carpenter@linaro.org>,
	Joel Fernandes <joel@joelfernandes.org>,
	neeraj.upadhyay@kernel.org,
	John Ogness <john.ogness@linutronix.de>,
	broonie@kernel.org
Subject: Re: arm-linux-gnueabihf-ld: kernel/rcu/update.o:update.c:(.text+0x1cc4): more undefined references to `__bad_cmpxchg' follow
Date: Thu, 30 May 2024 14:52:48 -0700	[thread overview]
Message-ID: <20240530215153.GA466604@thelio-3990X> (raw)
In-Reply-To: <214a33ac-d4fa-4d48-ad3c-ad8b00ae1a5e@paulmck-laptop>

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

> 							Thanx, Paul
> 
> ------------------------------------------------------------------------
> 
> commit 6e43483dd111cf1be58b02a45d0ca729ca2634ba
> Author: Paul E. McKenney <paulmck@kernel.org>
> 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.
>     
>     Reported-by: Mark Brown <broonie@kernel.org>
>     Closes: https://lore.kernel.org/all/54798f68-48f7-4c65-9cba-47c0bf175143@sirena.org.uk/
>     Reported-by: Naresh Kamboju <naresh.kamboju@linaro.org>
>     Closes: https://lore.kernel.org/all/CA+G9fYuZ+pf6p8AXMZWtdFtX-gbG8HMaBKp=XbxcdzA_QeLkxQ@mail.gmail.com/
>     Signed-off-by: Paul E. McKenney <paulmck@kernel.org>
>     Cc: "Russell King (Oracle)" <rmk+kernel@armlinux.org.uk>
>     Cc: Arnd Bergmann <arnd@arndb.de>
>     Cc: Andrew Davis <afd@ti.com>
>     Cc: Andrew Morton <akpm@linux-foundation.org>
>     Cc: Linus Walleij <linus.walleij@linaro.org>
>     Cc: Eric DeVolder <eric.devolder@oracle.com>
>     Cc: Rob Herring <robh@kernel.org>
>     Cc: <linux-arm-kernel@lists.infradead.org>
> 
> 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..fd9b99f4dca46 100644
> --- a/arch/arm/include/asm/cmpxchg.h
> +++ b/arch/arm/include/asm/cmpxchg.h
> @@ -162,7 +162,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
>  	case 1:
>  		do {
>  			asm volatile("@ __cmpxchg1\n"
> 
> _______________________________________________
> linux-arm-kernel mailing list
> linux-arm-kernel@lists.infradead.org
> http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

  parent reply	other threads:[~2024-05-30 21:52 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-05-30 12:20 Naresh Kamboju
2024-05-30 12:26 ` Russell King (Oracle)
2024-05-30 13:27   ` Arnd Bergmann
2024-05-30 16:37     ` Paul E. McKenney
2024-05-30 17:24       ` Paul E. McKenney
2024-05-30 18:05         ` Arnd Bergmann
2024-05-30 18:21           ` Paul E. McKenney
2024-05-30 21:52         ` Nathan Chancellor [this message]
2024-05-30 22:05           ` Paul E. McKenney
2024-05-30 23:30             ` Nathan Chancellor
2024-05-31  0:35               ` Paul E. McKenney
2024-05-31 16:27                 ` Nathan Chancellor
2024-05-31 19:42                   ` Paul E. McKenney

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20240530215153.GA466604@thelio-3990X \
    --to=nathan@kernel.org \
    --cc=arnd@arndb.de \
    --cc=broonie@kernel.org \
    --cc=dan.carpenter@linaro.org \
    --cc=joel@joelfernandes.org \
    --cc=john.ogness@linutronix.de \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux@armlinux.org.uk \
    --cc=lkft-triage@lists.linaro.org \
    --cc=naresh.kamboju@linaro.org \
    --cc=neeraj.upadhyay@kernel.org \
    --cc=paulmck@kernel.org \
    --cc=rcu@vger.kernel.org \
    --cc=regressions@lists.linux.dev \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®