linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [linux-stable-rc:linux-5.4.y 7045/7049] mipsel-linux-ld: decompress.c:undefined reference to `memmove'
@ 2021-07-06 17:15 kernel test robot
  2021-07-09  5:50 ` Gao Xiang
  0 siblings, 1 reply; 5+ messages in thread
From: kernel test robot @ 2021-07-06 17:15 UTC (permalink / raw)
  To: Gao Xiang
  Cc: kbuild-all, linux-kernel, Greg Kroah-Hartman, Nick Terrell,
	Andrew Morton, Linux Memory Management List

[-- Attachment #1: Type: text/plain, Size: 2234 bytes --]

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable-rc.git linux-5.4.y
head:   3909e2374335335c9504467caabc906d3f7487e4
commit: defcc2b5e54a4724fb5733f802edf5dd596018b6 [7045/7049] lib/lz4: explicitly support in-place decompression
config: mips-randconfig-r036-20210706 (attached as .config)
compiler: mipsel-linux-gcc (GCC) 9.3.0
reproduce (this is a W=1 build):
        wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
        chmod +x ~/bin/make.cross
        # https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable-rc.git/commit/?id=defcc2b5e54a4724fb5733f802edf5dd596018b6
        git remote add linux-stable-rc https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable-rc.git
        git fetch --no-tags linux-stable-rc linux-5.4.y
        git checkout defcc2b5e54a4724fb5733f802edf5dd596018b6
        # save the attached .config to linux build tree
        mkdir build_dir
        COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-9.3.0 make.cross O=build_dir ARCH=mips SHELL=/bin/bash

If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@intel.com>

All errors (new ones prefixed by >>):

   mipsel-linux-ld: arch/mips/boot/compressed/decompress.o: in function `LZ4_decompress_safe_withSmallPrefix':
   decompress.c:(.text+0x220): undefined reference to `memmove'
   mipsel-linux-ld: arch/mips/boot/compressed/decompress.o: in function `LZ4_decompress_fast_extDict':
   decompress.c:(.text+0x694): undefined reference to `memmove'
>> mipsel-linux-ld: decompress.c:(.text+0x774): undefined reference to `memmove'
   mipsel-linux-ld: arch/mips/boot/compressed/decompress.o: in function `LZ4_decompress_safe':
   decompress.c:(.text+0xb88): undefined reference to `memmove'
   mipsel-linux-ld: arch/mips/boot/compressed/decompress.o: in function `LZ4_decompress_safe_partial':
   decompress.c:(.text+0x1078): undefined reference to `memmove'
   mipsel-linux-ld: arch/mips/boot/compressed/decompress.o:decompress.c:(.text+0x12f8): more undefined references to `memmove' follow

---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org

[-- Attachment #2: .config.gz --]
[-- Type: application/gzip, Size: 21159 bytes --]

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [linux-stable-rc:linux-5.4.y 7045/7049] mipsel-linux-ld: decompress.c:undefined reference to `memmove'
  2021-07-06 17:15 [linux-stable-rc:linux-5.4.y 7045/7049] mipsel-linux-ld: decompress.c:undefined reference to `memmove' kernel test robot
@ 2021-07-09  5:50 ` Gao Xiang
  2021-07-09  7:20   ` Gao Xiang
  0 siblings, 1 reply; 5+ messages in thread
From: Gao Xiang @ 2021-07-09  5:50 UTC (permalink / raw)
  To: kernel test robot
  Cc: Gao Xiang, kbuild-all, linux-kernel, Greg Kroah-Hartman,
	Nick Terrell, Andrew Morton, Linux Memory Management List

On Wed, Jul 07, 2021 at 01:15:28AM +0800, kernel test robot wrote:
> tree:   https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable-rc.git linux-5.4.y
> head:   3909e2374335335c9504467caabc906d3f7487e4
> commit: defcc2b5e54a4724fb5733f802edf5dd596018b6 [7045/7049] lib/lz4: explicitly support in-place decompression
> config: mips-randconfig-r036-20210706 (attached as .config)
> compiler: mipsel-linux-gcc (GCC) 9.3.0
> reproduce (this is a W=1 build):
>         wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
>         chmod +x ~/bin/make.cross
>         # https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable-rc.git/commit/?id=defcc2b5e54a4724fb5733f802edf5dd596018b6
>         git remote add linux-stable-rc https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable-rc.git
>         git fetch --no-tags linux-stable-rc linux-5.4.y
>         git checkout defcc2b5e54a4724fb5733f802edf5dd596018b6
>         # save the attached .config to linux build tree
>         mkdir build_dir
>         COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-9.3.0 make.cross O=build_dir ARCH=mips SHELL=/bin/bash
> 
> If you fix the issue, kindly add following tag as appropriate
> Reported-by: kernel test robot <lkp@intel.com>

Which is weird, does the preboot environment miss memmove() on mipsel?
Just a guess, I may look into that myself later...

Thanks,
Gao Xiang

> 
> All errors (new ones prefixed by >>):
> 
>    mipsel-linux-ld: arch/mips/boot/compressed/decompress.o: in function `LZ4_decompress_safe_withSmallPrefix':
>    decompress.c:(.text+0x220): undefined reference to `memmove'
>    mipsel-linux-ld: arch/mips/boot/compressed/decompress.o: in function `LZ4_decompress_fast_extDict':
>    decompress.c:(.text+0x694): undefined reference to `memmove'
> >> mipsel-linux-ld: decompress.c:(.text+0x774): undefined reference to `memmove'
>    mipsel-linux-ld: arch/mips/boot/compressed/decompress.o: in function `LZ4_decompress_safe':
>    decompress.c:(.text+0xb88): undefined reference to `memmove'
>    mipsel-linux-ld: arch/mips/boot/compressed/decompress.o: in function `LZ4_decompress_safe_partial':
>    decompress.c:(.text+0x1078): undefined reference to `memmove'
>    mipsel-linux-ld: arch/mips/boot/compressed/decompress.o:decompress.c:(.text+0x12f8): more undefined references to `memmove' follow
> 
> ---
> 0-DAY CI Kernel Test Service, Intel Corporation
> https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org



^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [linux-stable-rc:linux-5.4.y 7045/7049] mipsel-linux-ld: decompress.c:undefined reference to `memmove'
  2021-07-09  5:50 ` Gao Xiang
@ 2021-07-09  7:20   ` Gao Xiang
  2021-07-09 10:31     ` Greg Kroah-Hartman
  0 siblings, 1 reply; 5+ messages in thread
From: Gao Xiang @ 2021-07-09  7:20 UTC (permalink / raw)
  To: stable
  Cc: kbuild-all, linux-kernel, Greg Kroah-Hartman, Nick Terrell,
	Andrew Morton, stable, kernel test robot

Hi Greg, stable all,

On Fri, Jul 09, 2021 at 01:50:16PM +0800, Gao Xiang wrote:
> On Wed, Jul 07, 2021 at 01:15:28AM +0800, kernel test robot wrote:
> > tree:   https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable-rc.git linux-5.4.y
> > head:   3909e2374335335c9504467caabc906d3f7487e4
> > commit: defcc2b5e54a4724fb5733f802edf5dd596018b6 [7045/7049] lib/lz4: explicitly support in-place decompression
> > config: mips-randconfig-r036-20210706 (attached as .config)
> > compiler: mipsel-linux-gcc (GCC) 9.3.0
> > reproduce (this is a W=1 build):
> >         wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
> >         chmod +x ~/bin/make.cross
> >         # https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable-rc.git/commit/?id=defcc2b5e54a4724fb5733f802edf5dd596018b6
> >         git remote add linux-stable-rc https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable-rc.git
> >         git fetch --no-tags linux-stable-rc linux-5.4.y
> >         git checkout defcc2b5e54a4724fb5733f802edf5dd596018b6
> >         # save the attached .config to linux build tree
> >         mkdir build_dir
> >         COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-9.3.0 make.cross O=build_dir ARCH=mips SHELL=/bin/bash
> > 
> > If you fix the issue, kindly add following tag as appropriate
> > Reported-by: kernel test robot <lkp@intel.com>
> 
> Which is weird, does the preboot environment miss memmove() on mipsel?
> Just a guess, I may look into that myself later...
> 

After manually checking, I found memmove() for the mips preboot environment
was incidentally introduced by commit a510b616131f ("MIPS: Add support for
ZSTD-compressed kernels") which wasn't included in v5.4, but included in
v5.10 as below (so v5.10.y is fine):
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/arch/mips/boot/compressed?h=v5.10&id=a510b616131f85215ba156ed67e5ed1c0701f80f

And when I applied the following patch partially from the original
commit, the compile error with the command lines mentioned above was gone:

diff --git a/arch/mips/boot/compressed/string.c b/arch/mips/boot/compressed/string.c
index 43beecc3587c..e9ab7ea592ba 100644
--- a/arch/mips/boot/compressed/string.c
+++ b/arch/mips/boot/compressed/string.c
@@ -27,3 +27,19 @@ void *memset(void *s, int c, size_t n)
 		ss[i] = c;
 	return s;
 }
+
+void * __weak memmove(void *dest, const void *src, size_t n)
+{
+	unsigned int i;
+	const char *s = src;
+	char *d = dest;
+
+	if ((uintptr_t)dest < (uintptr_t)src) {
+		for (i = 0; i < n; i++)
+			d[i] = s[i];
+	} else {
+		for (i = n; i > 0; i--)
+			d[i - 1] = s[i - 1];
+	}
+	return dest;
+}

How to backport such commit partially to the v5.4.y stable kernel?
... Also, it would be better to check other mips compile combinations
automatically since it's hard for me to check all such combinations
one-by-one...

Thanks,
Gao Xiang

> Thanks,
> Gao Xiang
> 
> > 
> > All errors (new ones prefixed by >>):
> > 
> >    mipsel-linux-ld: arch/mips/boot/compressed/decompress.o: in function `LZ4_decompress_safe_withSmallPrefix':
> >    decompress.c:(.text+0x220): undefined reference to `memmove'
> >    mipsel-linux-ld: arch/mips/boot/compressed/decompress.o: in function `LZ4_decompress_fast_extDict':
> >    decompress.c:(.text+0x694): undefined reference to `memmove'
> > >> mipsel-linux-ld: decompress.c:(.text+0x774): undefined reference to `memmove'
> >    mipsel-linux-ld: arch/mips/boot/compressed/decompress.o: in function `LZ4_decompress_safe':
> >    decompress.c:(.text+0xb88): undefined reference to `memmove'
> >    mipsel-linux-ld: arch/mips/boot/compressed/decompress.o: in function `LZ4_decompress_safe_partial':
> >    decompress.c:(.text+0x1078): undefined reference to `memmove'
> >    mipsel-linux-ld: arch/mips/boot/compressed/decompress.o:decompress.c:(.text+0x12f8): more undefined references to `memmove' follow
> > 
> > ---
> > 0-DAY CI Kernel Test Service, Intel Corporation
> > https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
> 

^ permalink raw reply related	[flat|nested] 5+ messages in thread

* Re: [linux-stable-rc:linux-5.4.y 7045/7049] mipsel-linux-ld: decompress.c:undefined reference to `memmove'
  2021-07-09  7:20   ` Gao Xiang
@ 2021-07-09 10:31     ` Greg Kroah-Hartman
  2021-07-09 13:49       ` Gao Xiang
  0 siblings, 1 reply; 5+ messages in thread
From: Greg Kroah-Hartman @ 2021-07-09 10:31 UTC (permalink / raw)
  To: Gao Xiang
  Cc: stable, kbuild-all, linux-kernel, Nick Terrell, Andrew Morton,
	kernel test robot

On Fri, Jul 09, 2021 at 03:20:41PM +0800, Gao Xiang wrote:
> Hi Greg, stable all,
> 
> On Fri, Jul 09, 2021 at 01:50:16PM +0800, Gao Xiang wrote:
> > On Wed, Jul 07, 2021 at 01:15:28AM +0800, kernel test robot wrote:
> > > tree:   https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable-rc.git linux-5.4.y
> > > head:   3909e2374335335c9504467caabc906d3f7487e4
> > > commit: defcc2b5e54a4724fb5733f802edf5dd596018b6 [7045/7049] lib/lz4: explicitly support in-place decompression
> > > config: mips-randconfig-r036-20210706 (attached as .config)
> > > compiler: mipsel-linux-gcc (GCC) 9.3.0
> > > reproduce (this is a W=1 build):
> > >         wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
> > >         chmod +x ~/bin/make.cross
> > >         # https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable-rc.git/commit/?id=defcc2b5e54a4724fb5733f802edf5dd596018b6
> > >         git remote add linux-stable-rc https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable-rc.git
> > >         git fetch --no-tags linux-stable-rc linux-5.4.y
> > >         git checkout defcc2b5e54a4724fb5733f802edf5dd596018b6
> > >         # save the attached .config to linux build tree
> > >         mkdir build_dir
> > >         COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-9.3.0 make.cross O=build_dir ARCH=mips SHELL=/bin/bash
> > > 
> > > If you fix the issue, kindly add following tag as appropriate
> > > Reported-by: kernel test robot <lkp@intel.com>
> > 
> > Which is weird, does the preboot environment miss memmove() on mipsel?
> > Just a guess, I may look into that myself later...
> > 
> 
> After manually checking, I found memmove() for the mips preboot environment
> was incidentally introduced by commit a510b616131f ("MIPS: Add support for
> ZSTD-compressed kernels") which wasn't included in v5.4, but included in
> v5.10 as below (so v5.10.y is fine):
> https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/arch/mips/boot/compressed?h=v5.10&id=a510b616131f85215ba156ed67e5ed1c0701f80f
> 
> And when I applied the following patch partially from the original
> commit, the compile error with the command lines mentioned above was gone:
> 
> diff --git a/arch/mips/boot/compressed/string.c b/arch/mips/boot/compressed/string.c
> index 43beecc3587c..e9ab7ea592ba 100644
> --- a/arch/mips/boot/compressed/string.c
> +++ b/arch/mips/boot/compressed/string.c
> @@ -27,3 +27,19 @@ void *memset(void *s, int c, size_t n)
>  		ss[i] = c;
>  	return s;
>  }
> +
> +void * __weak memmove(void *dest, const void *src, size_t n)
> +{
> +	unsigned int i;
> +	const char *s = src;
> +	char *d = dest;
> +
> +	if ((uintptr_t)dest < (uintptr_t)src) {
> +		for (i = 0; i < n; i++)
> +			d[i] = s[i];
> +	} else {
> +		for (i = n; i > 0; i--)
> +			d[i - 1] = s[i - 1];
> +	}
> +	return dest;
> +}
> 
> How to backport such commit partially to the v5.4.y stable kernel?

Please submit it in a format which we can apply it.

> ... Also, it would be better to check other mips compile combinations
> automatically since it's hard for me to check all such combinations
> one-by-one...

That's what kernelci is for, can you use that?

thanks,

greg k-h

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [linux-stable-rc:linux-5.4.y 7045/7049] mipsel-linux-ld: decompress.c:undefined reference to `memmove'
  2021-07-09 10:31     ` Greg Kroah-Hartman
@ 2021-07-09 13:49       ` Gao Xiang
  0 siblings, 0 replies; 5+ messages in thread
From: Gao Xiang @ 2021-07-09 13:49 UTC (permalink / raw)
  To: Greg Kroah-Hartman
  Cc: stable, kbuild-all, linux-kernel, Nick Terrell, Andrew Morton,
	kernel test robot

On Fri, Jul 09, 2021 at 12:31:12PM +0200, Greg Kroah-Hartman wrote:
> On Fri, Jul 09, 2021 at 03:20:41PM +0800, Gao Xiang wrote:
> > Hi Greg, stable all,
> > 
> > On Fri, Jul 09, 2021 at 01:50:16PM +0800, Gao Xiang wrote:
> > > On Wed, Jul 07, 2021 at 01:15:28AM +0800, kernel test robot wrote:
> > > > tree:   https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable-rc.git linux-5.4.y
> > > > head:   3909e2374335335c9504467caabc906d3f7487e4
> > > > commit: defcc2b5e54a4724fb5733f802edf5dd596018b6 [7045/7049] lib/lz4: explicitly support in-place decompression
> > > > config: mips-randconfig-r036-20210706 (attached as .config)
> > > > compiler: mipsel-linux-gcc (GCC) 9.3.0
> > > > reproduce (this is a W=1 build):
> > > >         wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
> > > >         chmod +x ~/bin/make.cross
> > > >         # https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable-rc.git/commit/?id=defcc2b5e54a4724fb5733f802edf5dd596018b6
> > > >         git remote add linux-stable-rc https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable-rc.git
> > > >         git fetch --no-tags linux-stable-rc linux-5.4.y
> > > >         git checkout defcc2b5e54a4724fb5733f802edf5dd596018b6
> > > >         # save the attached .config to linux build tree
> > > >         mkdir build_dir
> > > >         COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-9.3.0 make.cross O=build_dir ARCH=mips SHELL=/bin/bash
> > > > 
> > > > If you fix the issue, kindly add following tag as appropriate
> > > > Reported-by: kernel test robot <lkp@intel.com>
> > > 
> > > Which is weird, does the preboot environment miss memmove() on mipsel?
> > > Just a guess, I may look into that myself later...
> > > 
> > 
> > After manually checking, I found memmove() for the mips preboot environment
> > was incidentally introduced by commit a510b616131f ("MIPS: Add support for
> > ZSTD-compressed kernels") which wasn't included in v5.4, but included in
> > v5.10 as below (so v5.10.y is fine):
> > https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/arch/mips/boot/compressed?h=v5.10&id=a510b616131f85215ba156ed67e5ed1c0701f80f
> > 
> > And when I applied the following patch partially from the original
> > commit, the compile error with the command lines mentioned above was gone:
> > 
> > diff --git a/arch/mips/boot/compressed/string.c b/arch/mips/boot/compressed/string.c
> > index 43beecc3587c..e9ab7ea592ba 100644
> > --- a/arch/mips/boot/compressed/string.c
> > +++ b/arch/mips/boot/compressed/string.c
> > @@ -27,3 +27,19 @@ void *memset(void *s, int c, size_t n)
> >  		ss[i] = c;
> >  	return s;
> >  }
> > +
> > +void * __weak memmove(void *dest, const void *src, size_t n)
> > +{
> > +	unsigned int i;
> > +	const char *s = src;
> > +	char *d = dest;
> > +
> > +	if ((uintptr_t)dest < (uintptr_t)src) {
> > +		for (i = 0; i < n; i++)
> > +			d[i] = s[i];
> > +	} else {
> > +		for (i = n; i > 0; i--)
> > +			d[i - 1] = s[i - 1];
> > +	}
> > +	return dest;
> > +}
> > 
> > How to backport such commit partially to the v5.4.y stable kernel?
> 
> Please submit it in a format which we can apply it.

I've sent out a patch (although not sure if the exact format like this):
https://lore.kernel.org/r/20210709132408.174206-1-hsiangkao@linux.alibaba.com/

> 
> > ... Also, it would be better to check other mips compile combinations
> > automatically since it's hard for me to check all such combinations
> > one-by-one...
> 
> That's what kernelci is for, can you use that?

I'm not sure how to use kernelci myself, maybe I missed something...

Thanks,
Gao Xiang

> 
> thanks,
> 
> greg k-h

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2021-07-09 13:49 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-07-06 17:15 [linux-stable-rc:linux-5.4.y 7045/7049] mipsel-linux-ld: decompress.c:undefined reference to `memmove' kernel test robot
2021-07-09  5:50 ` Gao Xiang
2021-07-09  7:20   ` Gao Xiang
2021-07-09 10:31     ` Greg Kroah-Hartman
2021-07-09 13:49       ` Gao Xiang

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).