linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
* Re: [PATCH v2 3/4] Use generic io memcpy functions on the csky architecture
       [not found] <20240909133159.2024688-4-jvetter@kalrayinc.com>
@ 2024-09-10  7:27 ` kernel test robot
  2024-09-10  9:15   ` Arnd Bergmann
  0 siblings, 1 reply; 3+ messages in thread
From: kernel test robot @ 2024-09-10  7:27 UTC (permalink / raw)
  To: Julian Vetter, Arnd Bergmann, Catalin Marinas, Will Deacon,
	Guo Ren, Huacai Chen, WANG Xuerui, Andrew Morton
  Cc: oe-kbuild-all, Linux Memory Management List, linux-arm-kernel,
	linux-kernel, linux-csky, loongarch, Yann Sionneau,
	Julian Vetter

Hi Julian,

kernel test robot noticed the following build errors:

[auto build test ERROR on akpm-mm/mm-nonmm-unstable]
[also build test ERROR on arm64/for-next/core soc/for-next linus/master v6.11-rc7 next-20240909]
[If your patch is applied to the wrong git tree, kindly drop us a note.
And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch#_base_tree_information]

url:    https://github.com/intel-lab-lkp/linux/commits/Julian-Vetter/Consolidate-__memcpy_-to-from-io-and-__memset_io-into-a-single-lib/20240909-213659
base:   https://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm.git mm-nonmm-unstable
patch link:    https://lore.kernel.org/r/20240909133159.2024688-4-jvetter%40kalrayinc.com
patch subject: [PATCH v2 3/4] Use generic io memcpy functions on the csky architecture
config: csky-allnoconfig (https://download.01.org/0day-ci/archive/20240910/202409101549.CyV0mJ2S-lkp@intel.com/config)
compiler: csky-linux-gcc (GCC) 14.1.0
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20240910/202409101549.CyV0mJ2S-lkp@intel.com/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 <lkp@intel.com>
| Closes: https://lore.kernel.org/oe-kbuild-all/202409101549.CyV0mJ2S-lkp@intel.com/

All error/warnings (new ones prefixed by >>):

   In file included from ./arch/csky/include/generated/asm/unaligned.h:1,
                    from lib/io_copy.c:9:
   lib/io_copy.c: In function '__memcpy_fromio':
>> lib/io_copy.c:28:39: error: implicit declaration of function '__raw_readq'; did you mean '__raw_readl'? [-Wimplicit-function-declaration]
      28 |                         put_unaligned(__raw_readq(from), (uintptr_t *)to);
         |                                       ^~~~~~~~~~~
   include/asm-generic/unaligned.h:19:22: note: in definition of macro '__put_unaligned_t'
      19 |         __pptr->x = (val);                                                      \
         |                      ^~~
   lib/io_copy.c:28:25: note: in expansion of macro 'put_unaligned'
      28 |                         put_unaligned(__raw_readq(from), (uintptr_t *)to);
         |                         ^~~~~~~~~~~~~
   lib/io_copy.c: In function '__memcpy_toio':
>> lib/io_copy.c:57:25: error: implicit declaration of function '__raw_writeq'; did you mean '__raw_writel'? [-Wimplicit-function-declaration]
      57 |                         __raw_writeq(get_unaligned((uintptr_t *)from), to);
         |                         ^~~~~~~~~~~~
         |                         __raw_writel
   lib/io_copy.c: In function '__memset_io':
>> lib/io_copy.c:83:26: warning: left shift count >= width of type [-Wshift-count-overflow]
      83 |                 qc |= qc << 32;
         |                          ^~


vim +28 lib/io_copy.c

6a9bfa83709a84e Julian Vetter 2024-09-09  16  
6a9bfa83709a84e Julian Vetter 2024-09-09  17  void __memcpy_fromio(void *to, const volatile void __iomem *from, size_t count)
6a9bfa83709a84e Julian Vetter 2024-09-09  18  {
6a9bfa83709a84e Julian Vetter 2024-09-09  19  	while (count && !IS_ALIGNED((unsigned long)from, NATIVE_STORE_SIZE)) {
6a9bfa83709a84e Julian Vetter 2024-09-09  20  		*(u8 *)to = __raw_readb(from);
6a9bfa83709a84e Julian Vetter 2024-09-09  21  		from++;
6a9bfa83709a84e Julian Vetter 2024-09-09  22  		to++;
6a9bfa83709a84e Julian Vetter 2024-09-09  23  		count--;
6a9bfa83709a84e Julian Vetter 2024-09-09  24  	}
6a9bfa83709a84e Julian Vetter 2024-09-09  25  
6a9bfa83709a84e Julian Vetter 2024-09-09  26  	while (count >= NATIVE_STORE_SIZE) {
6a9bfa83709a84e Julian Vetter 2024-09-09  27  		if (IS_ENABLED(CONFIG_64BIT))
6a9bfa83709a84e Julian Vetter 2024-09-09 @28  			put_unaligned(__raw_readq(from), (uintptr_t *)to);
6a9bfa83709a84e Julian Vetter 2024-09-09  29  		else
6a9bfa83709a84e Julian Vetter 2024-09-09  30  			put_unaligned(__raw_readl(from), (uintptr_t *)to);
6a9bfa83709a84e Julian Vetter 2024-09-09  31  
6a9bfa83709a84e Julian Vetter 2024-09-09  32  		from += NATIVE_STORE_SIZE;
6a9bfa83709a84e Julian Vetter 2024-09-09  33  		to += NATIVE_STORE_SIZE;
6a9bfa83709a84e Julian Vetter 2024-09-09  34  		count -= NATIVE_STORE_SIZE;
6a9bfa83709a84e Julian Vetter 2024-09-09  35  	}
6a9bfa83709a84e Julian Vetter 2024-09-09  36  
6a9bfa83709a84e Julian Vetter 2024-09-09  37  	while (count) {
6a9bfa83709a84e Julian Vetter 2024-09-09  38  		*(u8 *)to = __raw_readb(from);
6a9bfa83709a84e Julian Vetter 2024-09-09  39  		from++;
6a9bfa83709a84e Julian Vetter 2024-09-09  40  		to++;
6a9bfa83709a84e Julian Vetter 2024-09-09  41  		count--;
6a9bfa83709a84e Julian Vetter 2024-09-09  42  	}
6a9bfa83709a84e Julian Vetter 2024-09-09  43  }
6a9bfa83709a84e Julian Vetter 2024-09-09  44  EXPORT_SYMBOL(__memcpy_fromio);
6a9bfa83709a84e Julian Vetter 2024-09-09  45  
6a9bfa83709a84e Julian Vetter 2024-09-09  46  void __memcpy_toio(volatile void __iomem *to, const void *from, size_t count)
6a9bfa83709a84e Julian Vetter 2024-09-09  47  {
6a9bfa83709a84e Julian Vetter 2024-09-09  48  	while (count && !IS_ALIGNED((unsigned long)to, NATIVE_STORE_SIZE)) {
6a9bfa83709a84e Julian Vetter 2024-09-09  49  		__raw_writeb(*(u8 *)from, to);
6a9bfa83709a84e Julian Vetter 2024-09-09  50  		from++;
6a9bfa83709a84e Julian Vetter 2024-09-09  51  		to++;
6a9bfa83709a84e Julian Vetter 2024-09-09  52  		count--;
6a9bfa83709a84e Julian Vetter 2024-09-09  53  	}
6a9bfa83709a84e Julian Vetter 2024-09-09  54  
6a9bfa83709a84e Julian Vetter 2024-09-09  55  	while (count >= NATIVE_STORE_SIZE) {
6a9bfa83709a84e Julian Vetter 2024-09-09  56  		if (IS_ENABLED(CONFIG_64BIT))
6a9bfa83709a84e Julian Vetter 2024-09-09 @57  			__raw_writeq(get_unaligned((uintptr_t *)from), to);
6a9bfa83709a84e Julian Vetter 2024-09-09  58  		else
6a9bfa83709a84e Julian Vetter 2024-09-09  59  			__raw_writel(get_unaligned((uintptr_t *)from), to);
6a9bfa83709a84e Julian Vetter 2024-09-09  60  
6a9bfa83709a84e Julian Vetter 2024-09-09  61  		from += NATIVE_STORE_SIZE;
6a9bfa83709a84e Julian Vetter 2024-09-09  62  		to += NATIVE_STORE_SIZE;
6a9bfa83709a84e Julian Vetter 2024-09-09  63  		count -= NATIVE_STORE_SIZE;
6a9bfa83709a84e Julian Vetter 2024-09-09  64  	}
6a9bfa83709a84e Julian Vetter 2024-09-09  65  
6a9bfa83709a84e Julian Vetter 2024-09-09  66  	while (count) {
6a9bfa83709a84e Julian Vetter 2024-09-09  67  		__raw_writeb(*(u8 *)from, to);
6a9bfa83709a84e Julian Vetter 2024-09-09  68  		from++;
6a9bfa83709a84e Julian Vetter 2024-09-09  69  		to++;
6a9bfa83709a84e Julian Vetter 2024-09-09  70  		count--;
6a9bfa83709a84e Julian Vetter 2024-09-09  71  	}
6a9bfa83709a84e Julian Vetter 2024-09-09  72  }
6a9bfa83709a84e Julian Vetter 2024-09-09  73  EXPORT_SYMBOL(__memcpy_toio);
6a9bfa83709a84e Julian Vetter 2024-09-09  74  
6a9bfa83709a84e Julian Vetter 2024-09-09  75  void __memset_io(volatile void __iomem *dst, int c, size_t count)
6a9bfa83709a84e Julian Vetter 2024-09-09  76  {
6a9bfa83709a84e Julian Vetter 2024-09-09  77  	uintptr_t qc = (u8)c;
6a9bfa83709a84e Julian Vetter 2024-09-09  78  
6a9bfa83709a84e Julian Vetter 2024-09-09  79  	qc |= qc << 8;
6a9bfa83709a84e Julian Vetter 2024-09-09  80  	qc |= qc << 16;
6a9bfa83709a84e Julian Vetter 2024-09-09  81  
6a9bfa83709a84e Julian Vetter 2024-09-09  82  	if (IS_ENABLED(CONFIG_64BIT))
6a9bfa83709a84e Julian Vetter 2024-09-09 @83  		qc |= qc << 32;

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


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

* Re: [PATCH v2 3/4] Use generic io memcpy functions on the csky architecture
  2024-09-10  7:27 ` [PATCH v2 3/4] Use generic io memcpy functions on the csky architecture kernel test robot
@ 2024-09-10  9:15   ` Arnd Bergmann
  2024-09-18  2:26     ` Guo Ren
  0 siblings, 1 reply; 3+ messages in thread
From: Arnd Bergmann @ 2024-09-10  9:15 UTC (permalink / raw)
  To: kernel test robot, Julian Vetter, Catalin Marinas, Will Deacon,
	guoren, Huacai Chen, WANG Xuerui, Andrew Morton
  Cc: oe-kbuild-all, Linux Memory Management List, linux-arm-kernel,
	linux-kernel, linux-csky, loongarch, Yann Sionneau

On Tue, Sep 10, 2024, at 07:27, kernel test robot wrote:

> 6a9bfa83709a84e Julian Vetter 2024-09-09  55  	while (count >= 
> NATIVE_STORE_SIZE) {
> 6a9bfa83709a84e Julian Vetter 2024-09-09  56  		if 
> (IS_ENABLED(CONFIG_64BIT))
> 6a9bfa83709a84e Julian Vetter 2024-09-09 @57  
> 			__raw_writeq(get_unaligned((uintptr_t *)from), to);
> 6a9bfa83709a84e Julian Vetter 2024-09-09  58  		else

Right, this one actually has to be a preprocessor conditional
because __raw_writeq is not defined.

     Arnd


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

* Re: [PATCH v2 3/4] Use generic io memcpy functions on the csky architecture
  2024-09-10  9:15   ` Arnd Bergmann
@ 2024-09-18  2:26     ` Guo Ren
  0 siblings, 0 replies; 3+ messages in thread
From: Guo Ren @ 2024-09-18  2:26 UTC (permalink / raw)
  To: Arnd Bergmann
  Cc: kernel test robot, Julian Vetter, Catalin Marinas, Will Deacon,
	Huacai Chen, WANG Xuerui, Andrew Morton, oe-kbuild-all,
	Linux Memory Management List, linux-arm-kernel, linux-kernel,
	linux-csky, loongarch, Yann Sionneau

On Tue, Sep 10, 2024 at 5:16 PM Arnd Bergmann <arnd@arndb.de> wrote:
>
> On Tue, Sep 10, 2024, at 07:27, kernel test robot wrote:
>
> > 6a9bfa83709a84e Julian Vetter 2024-09-09  55          while (count >=
> > NATIVE_STORE_SIZE) {
> > 6a9bfa83709a84e Julian Vetter 2024-09-09  56                  if
> > (IS_ENABLED(CONFIG_64BIT))
> > 6a9bfa83709a84e Julian Vetter 2024-09-09 @57
> >                       __raw_writeq(get_unaligned((uintptr_t *)from), to);
> > 6a9bfa83709a84e Julian Vetter 2024-09-09  58                  else
>
> Right, this one actually has to be a preprocessor conditional
> because __raw_writeq is not defined.
All 32-bit ISAs didn't support __raw_writeq.

e.g.: include/asm-generic/io.h
#ifdef CONFIG_64BIT
#ifndef __raw_writeq
#define __raw_writeq __raw_writeq
static inline void __raw_writeq(u64 value, volatile void __iomem *addr)
{
        *(volatile u64 __force *)addr = value;
}
#endif
#endif /* CONFIG_64BIT */

e.g.: arch/riscv/include/asm/mmio.h
#ifdef CONFIG_64BIT
#define __raw_writeq __raw_writeq
static inline void __raw_writeq(u64 val, volatile void __iomem *addr)
{
        asm volatile("sd %0, 0(%1)" : : "r" (val), "r" (addr));
}
#endif

>
>      Arnd



-- 
Best Regards
 Guo Ren


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

end of thread, other threads:[~2024-09-18  2:26 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <20240909133159.2024688-4-jvetter@kalrayinc.com>
2024-09-10  7:27 ` [PATCH v2 3/4] Use generic io memcpy functions on the csky architecture kernel test robot
2024-09-10  9:15   ` Arnd Bergmann
2024-09-18  2:26     ` Guo Ren

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox