2024-05-27 05:27:14

by kernel test robot

[permalink] [raw]
Subject: [paulmck-rcu:dev.2024.05.18a 44/51] update.c:undefined reference to `cmpxchg_emu_u8'

tree: https://git.kernel.org/pub/scm/linux/kernel/git/paulmck/linux-rcu.git dev.2024.05.18a
head: 0e3eb8082184e066eb389f5e6f9c7b8c2d452d66
commit: c48887df74a95090e633a29ffbcef00b71cdab66 [44/51] rcu-tasks: Remove open-coded one-byte cmpxchg() emulation
config: um-allyesconfig (https://download.01.org/0day-ci/archive/20240527/[email protected]/config)
compiler: gcc-13 (Ubuntu 13.2.0-4ubuntu3) 13.2.0
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20240527/[email protected]/reproduce)

If you fix the issue in a separate patch/commit (i.e. not just a new version of
the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <[email protected]>
| Closes: https://lore.kernel.org/oe-kbuild-all/[email protected]/

All errors (new ones prefixed by >>):

/usr/bin/ld: kernel/rcu/update.o: in function `rcu_trc_cmpxchg_need_qs':
>> update.c:(.text+0x27d5): undefined reference to `cmpxchg_emu_u8'
/usr/bin/ld: kernel/rcu/update.o: in function `trc_read_check_handler':
update.c:(.text+0x2839): undefined reference to `cmpxchg_emu_u8'
>> /usr/bin/ld: update.c:(.text+0x2882): undefined reference to `cmpxchg_emu_u8'
/usr/bin/ld: kernel/rcu/update.o: in function `trc_inspect_reader':
update.c:(.text+0x52ce): undefined reference to `cmpxchg_emu_u8'
/usr/bin/ld: update.c:(.text+0x5330): undefined reference to `cmpxchg_emu_u8'
/usr/bin/ld: kernel/rcu/update.o:update.c:(.text+0x5933): more undefined references to `cmpxchg_emu_u8' follow
>> collect2: error: ld returned 1 exit status

--
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki


2024-05-28 19:27:15

by Paul E. McKenney

[permalink] [raw]
Subject: Re: [paulmck-rcu:dev.2024.05.18a 44/51] update.c:undefined reference to `cmpxchg_emu_u8'

On Mon, May 27, 2024 at 01:25:58PM +0800, kernel test robot wrote:
> tree: https://git.kernel.org/pub/scm/linux/kernel/git/paulmck/linux-rcu.git dev.2024.05.18a
> head: 0e3eb8082184e066eb389f5e6f9c7b8c2d452d66
> commit: c48887df74a95090e633a29ffbcef00b71cdab66 [44/51] rcu-tasks: Remove open-coded one-byte cmpxchg() emulation
> config: um-allyesconfig (https://download.01.org/0day-ci/archive/20240527/[email protected]/config)
> compiler: gcc-13 (Ubuntu 13.2.0-4ubuntu3) 13.2.0
> reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20240527/[email protected]/reproduce)
>
> If you fix the issue in a separate patch/commit (i.e. not just a new version of
> the same patch/commit), kindly add following tags
> | Reported-by: kernel test robot <[email protected]>
> | Closes: https://lore.kernel.org/oe-kbuild-all/[email protected]/
>
> All errors (new ones prefixed by >>):
>
> /usr/bin/ld: kernel/rcu/update.o: in function `rcu_trc_cmpxchg_need_qs':
> >> update.c:(.text+0x27d5): undefined reference to `cmpxchg_emu_u8'
> /usr/bin/ld: kernel/rcu/update.o: in function `trc_read_check_handler':
> update.c:(.text+0x2839): undefined reference to `cmpxchg_emu_u8'
> >> /usr/bin/ld: update.c:(.text+0x2882): undefined reference to `cmpxchg_emu_u8'
> /usr/bin/ld: kernel/rcu/update.o: in function `trc_inspect_reader':
> update.c:(.text+0x52ce): undefined reference to `cmpxchg_emu_u8'
> /usr/bin/ld: update.c:(.text+0x5330): undefined reference to `cmpxchg_emu_u8'
> /usr/bin/ld: kernel/rcu/update.o:update.c:(.text+0x5933): more undefined references to `cmpxchg_emu_u8' follow
> >> collect2: error: ld returned 1 exit status

Good catch!!!

Does the patch below clear this up?

Thanx, Paul

------------------------------------------------------------------------

commit 47450c70303a11da1bd650403844ad9e688f05a4
Author: Paul E. McKenney <[email protected]>
Date: Tue May 28 12:15:06 2024 -0700

um: Emulate one-byte cmpxchg

Use the new cmpxchg_emu_u8() to emulate one-byte cmpxchg() on um.

Reported-by: kernel test robot <[email protected]>
Closes: https://lore.kernel.org/all/[email protected]/
Signed-off-by: Paul E. McKenney <[email protected]>
Cc: Richard Weinberger <[email protected]>
Cc: Anton Ivanov <[email protected]>
Cc: Johannes Berg <[email protected]>
Cc: <[email protected]>

diff --git a/arch/um/Kconfig b/arch/um/Kconfig
index 93a5a8999b07e..5fc55e1d71122 100644
--- a/arch/um/Kconfig
+++ b/arch/um/Kconfig
@@ -11,6 +11,7 @@ config UML
select ARCH_HAS_KCOV
select ARCH_HAS_STRNCPY_FROM_USER
select ARCH_HAS_STRNLEN_USER
+ select ARCH_NEED_CMPXCHG_1_EMU
select ARCH_NO_PREEMPT
select HAVE_ARCH_AUDITSYSCALL
select HAVE_ARCH_KASAN if X86_64

2024-05-29 08:17:42

by kernel test robot

[permalink] [raw]
Subject: Re: [paulmck-rcu:dev.2024.05.18a 44/51] update.c:undefined reference to `cmpxchg_emu_u8'

On Tue, May 28, 2024 at 12:26:43PM -0700, Paul E. McKenney wrote:
> On Mon, May 27, 2024 at 01:25:58PM +0800, kernel test robot wrote:
> > tree: https://git.kernel.org/pub/scm/linux/kernel/git/paulmck/linux-rcu.git dev.2024.05.18a
> > head: 0e3eb8082184e066eb389f5e6f9c7b8c2d452d66
> > commit: c48887df74a95090e633a29ffbcef00b71cdab66 [44/51] rcu-tasks: Remove open-coded one-byte cmpxchg() emulation
> > config: um-allyesconfig (https://download.01.org/0day-ci/archive/20240527/[email protected]/config)
> > compiler: gcc-13 (Ubuntu 13.2.0-4ubuntu3) 13.2.0
> > reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20240527/[email protected]/reproduce)
> >
> > If you fix the issue in a separate patch/commit (i.e. not just a new version of
> > the same patch/commit), kindly add following tags
> > | Reported-by: kernel test robot <[email protected]>
> > | Closes: https://lore.kernel.org/oe-kbuild-all/[email protected]/
> >
> > All errors (new ones prefixed by >>):
> >
> > /usr/bin/ld: kernel/rcu/update.o: in function `rcu_trc_cmpxchg_need_qs':
> > >> update.c:(.text+0x27d5): undefined reference to `cmpxchg_emu_u8'
> > /usr/bin/ld: kernel/rcu/update.o: in function `trc_read_check_handler':
> > update.c:(.text+0x2839): undefined reference to `cmpxchg_emu_u8'
> > >> /usr/bin/ld: update.c:(.text+0x2882): undefined reference to `cmpxchg_emu_u8'
> > /usr/bin/ld: kernel/rcu/update.o: in function `trc_inspect_reader':
> > update.c:(.text+0x52ce): undefined reference to `cmpxchg_emu_u8'
> > /usr/bin/ld: update.c:(.text+0x5330): undefined reference to `cmpxchg_emu_u8'
> > /usr/bin/ld: kernel/rcu/update.o:update.c:(.text+0x5933): more undefined references to `cmpxchg_emu_u8' follow
> > >> collect2: error: ld returned 1 exit status
>
> Good catch!!!
>
> Does the patch below clear this up?

The patch below will select ARCH_NEED_CMPXCHG_1_EMU by default on um
arch, so that cmpxchg-emu.o can be built, and it fixes the link error
for me.

Tested-by: Yujie Liu <[email protected]>

>
> Thanx, Paul
>
> ------------------------------------------------------------------------
>
> commit 47450c70303a11da1bd650403844ad9e688f05a4
> Author: Paul E. McKenney <[email protected]>
> Date: Tue May 28 12:15:06 2024 -0700
>
> um: Emulate one-byte cmpxchg
>
> Use the new cmpxchg_emu_u8() to emulate one-byte cmpxchg() on um.
>
> Reported-by: kernel test robot <[email protected]>
> Closes: https://lore.kernel.org/all/[email protected]/
> Signed-off-by: Paul E. McKenney <[email protected]>
> Cc: Richard Weinberger <[email protected]>
> Cc: Anton Ivanov <[email protected]>
> Cc: Johannes Berg <[email protected]>
> Cc: <[email protected]>
>
> diff --git a/arch/um/Kconfig b/arch/um/Kconfig
> index 93a5a8999b07e..5fc55e1d71122 100644
> --- a/arch/um/Kconfig
> +++ b/arch/um/Kconfig
> @@ -11,6 +11,7 @@ config UML
> select ARCH_HAS_KCOV
> select ARCH_HAS_STRNCPY_FROM_USER
> select ARCH_HAS_STRNLEN_USER
> + select ARCH_NEED_CMPXCHG_1_EMU
> select ARCH_NO_PREEMPT
> select HAVE_ARCH_AUDITSYSCALL
> select HAVE_ARCH_KASAN if X86_64
>

2024-05-29 17:26:31

by Paul E. McKenney

[permalink] [raw]
Subject: Re: [paulmck-rcu:dev.2024.05.18a 44/51] update.c:undefined reference to `cmpxchg_emu_u8'

On Wed, May 29, 2024 at 03:54:26PM +0800, Yujie Liu wrote:
> On Tue, May 28, 2024 at 12:26:43PM -0700, Paul E. McKenney wrote:
> > On Mon, May 27, 2024 at 01:25:58PM +0800, kernel test robot wrote:
> > > tree: https://git.kernel.org/pub/scm/linux/kernel/git/paulmck/linux-rcu.git dev.2024.05.18a
> > > head: 0e3eb8082184e066eb389f5e6f9c7b8c2d452d66
> > > commit: c48887df74a95090e633a29ffbcef00b71cdab66 [44/51] rcu-tasks: Remove open-coded one-byte cmpxchg() emulation
> > > config: um-allyesconfig (https://download.01.org/0day-ci/archive/20240527/[email protected]/config)
> > > compiler: gcc-13 (Ubuntu 13.2.0-4ubuntu3) 13.2.0
> > > reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20240527/[email protected]/reproduce)
> > >
> > > If you fix the issue in a separate patch/commit (i.e. not just a new version of
> > > the same patch/commit), kindly add following tags
> > > | Reported-by: kernel test robot <[email protected]>
> > > | Closes: https://lore.kernel.org/oe-kbuild-all/[email protected]/
> > >
> > > All errors (new ones prefixed by >>):
> > >
> > > /usr/bin/ld: kernel/rcu/update.o: in function `rcu_trc_cmpxchg_need_qs':
> > > >> update.c:(.text+0x27d5): undefined reference to `cmpxchg_emu_u8'
> > > /usr/bin/ld: kernel/rcu/update.o: in function `trc_read_check_handler':
> > > update.c:(.text+0x2839): undefined reference to `cmpxchg_emu_u8'
> > > >> /usr/bin/ld: update.c:(.text+0x2882): undefined reference to `cmpxchg_emu_u8'
> > > /usr/bin/ld: kernel/rcu/update.o: in function `trc_inspect_reader':
> > > update.c:(.text+0x52ce): undefined reference to `cmpxchg_emu_u8'
> > > /usr/bin/ld: update.c:(.text+0x5330): undefined reference to `cmpxchg_emu_u8'
> > > /usr/bin/ld: kernel/rcu/update.o:update.c:(.text+0x5933): more undefined references to `cmpxchg_emu_u8' follow
> > > >> collect2: error: ld returned 1 exit status
> >
> > Good catch!!!
> >
> > Does the patch below clear this up?
>
> The patch below will select ARCH_NEED_CMPXCHG_1_EMU by default on um
> arch, so that cmpxchg-emu.o can be built, and it fixes the link error
> for me.
>
> Tested-by: Yujie Liu <[email protected]>

Thank you! I will apply your Tested-by on my next rebase.

Thanx, Paul
> >
> > ------------------------------------------------------------------------
> >
> > commit 47450c70303a11da1bd650403844ad9e688f05a4
> > Author: Paul E. McKenney <[email protected]>
> > Date: Tue May 28 12:15:06 2024 -0700
> >
> > um: Emulate one-byte cmpxchg
> >
> > Use the new cmpxchg_emu_u8() to emulate one-byte cmpxchg() on um.
> >
> > Reported-by: kernel test robot <[email protected]>
> > Closes: https://lore.kernel.org/all/[email protected]/
> > Signed-off-by: Paul E. McKenney <[email protected]>
> > Cc: Richard Weinberger <[email protected]>
> > Cc: Anton Ivanov <[email protected]>
> > Cc: Johannes Berg <[email protected]>
> > Cc: <[email protected]>
> >
> > diff --git a/arch/um/Kconfig b/arch/um/Kconfig
> > index 93a5a8999b07e..5fc55e1d71122 100644
> > --- a/arch/um/Kconfig
> > +++ b/arch/um/Kconfig
> > @@ -11,6 +11,7 @@ config UML
> > select ARCH_HAS_KCOV
> > select ARCH_HAS_STRNCPY_FROM_USER
> > select ARCH_HAS_STRNLEN_USER
> > + select ARCH_NEED_CMPXCHG_1_EMU
> > select ARCH_NO_PREEMPT
> > select HAVE_ARCH_AUDITSYSCALL
> > select HAVE_ARCH_KASAN if X86_64
> >