mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] sparse: use static inline for __chk_{user,io}_ptr()
@ 2020-06-28  7:20 Luc Van Oostenryck
  2020-06-29 17:12 ` kernel test robot
                   ` (2 more replies)
  0 siblings, 3 replies; 6+ messages in thread
From: Luc Van Oostenryck @ 2020-06-28  7:20 UTC (permalink / raw)
  To: Andrew Morton; +Cc: linux-kernel, Luc Van Oostenryck

__chk_user_ptr() & __chk_io_ptr() are dummy extern functions which
only exist to enforce the typechecking of __user or __iomem pointers
in macros when using sparse.

This typechecking is done by inserting a call to these functions.
But the presence of these calls can inhibit some simplifications
and so influence the result of sparse's analysis of context/locking.

Fix this by changing these calls into static inline calls with
an empty body.

Signed-off-by: Luc Van Oostenryck <luc.vanoostenryck@gmail.com>
---
 include/linux/compiler_types.h | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/include/linux/compiler_types.h b/include/linux/compiler_types.h
index b67930216e45..a9b6699f3934 100644
--- a/include/linux/compiler_types.h
+++ b/include/linux/compiler_types.h
@@ -11,8 +11,8 @@
 # define __iomem	__attribute__((noderef, address_space(__iomem)))
 # define __percpu	__attribute__((noderef, address_space(__percpu)))
 # define __rcu		__attribute__((noderef, address_space(__rcu)))
-extern void __chk_user_ptr(const volatile void __user *);
-extern void __chk_io_ptr(const volatile void __iomem *);
+static inline void __chk_user_ptr(const volatile void __user *ptr) { }
+static inline void __chk_io_ptr(const volatile void __iomem *ptr) { }
 /* context/locking */
 # define __must_hold(x)	__attribute__((context(x,1,1)))
 # define __acquires(x)	__attribute__((context(x,0,1)))
-- 
2.27.0


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

* Re: [PATCH] sparse: use static inline for __chk_{user,io}_ptr()
  2020-06-28  7:20 [PATCH] sparse: use static inline for __chk_{user,io}_ptr() Luc Van Oostenryck
@ 2020-06-29 17:12 ` kernel test robot
  2020-06-29 18:08 ` kernel test robot
  2020-07-01 18:35 ` kernel test robot
  2 siblings, 0 replies; 6+ messages in thread
From: kernel test robot @ 2020-06-29 17:12 UTC (permalink / raw)
  To: Luc Van Oostenryck, Andrew Morton
  Cc: kbuild-all, Linux Memory Management List, linux-kernel,
	Luc Van Oostenryck

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

Hi Luc,

I love your patch! Perhaps something to improve:

[auto build test WARNING on next-20200626]
[cannot apply to linux/master linus/master v5.8-rc2 v5.8-rc1 v5.7 v5.8-rc3]
[If your patch is applied to the wrong git tree, kindly drop us a note.
And when submitting patch, we suggest to use  as documented in
https://git-scm.com/docs/git-format-patch]

url:    https://github.com/0day-ci/linux/commits/Luc-Van-Oostenryck/sparse-use-static-inline-for-__chk_-user-io-_ptr/20200628-152401
base:    36e3135df4d426612fc77db26a312c2531108603
config: i386-randconfig-s001-20200629 (attached as .config)
compiler: gcc-9 (Debian 9.3.0-13) 9.3.0
reproduce:
        # apt-get install sparse
        # sparse version: v0.6.2-3-gfa153962-dirty
        # save the attached .config to linux build tree
        make W=1 C= CF='-fdiagnostic-prefix -D__CHECK_ENDIAN__' ARCH=i386 

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


sparse warnings: (new ones prefixed by >>)

   arch/x86/kernel/signal.c:337:9: sparse: sparse: cast removes address space '__user' of expression
>> arch/x86/kernel/signal.c:337:9: sparse: sparse: incorrect type in argument 1 (different address spaces) @@     expected void const volatile [noderef] __user *ptr @@     got unsigned long long [usertype] * @@
>> arch/x86/kernel/signal.c:337:9: sparse:     expected void const volatile [noderef] __user *ptr
   arch/x86/kernel/signal.c:337:9: sparse:     got unsigned long long [usertype] *
   arch/x86/kernel/signal.c:337:9: sparse: sparse: cast removes address space '__user' of expression
   arch/x86/kernel/signal.c:337:9: sparse: sparse: cast removes address space '__user' of expression
   arch/x86/kernel/signal.c:337:9: sparse: sparse: cast removes address space '__user' of expression
   arch/x86/kernel/signal.c:337:9: sparse: sparse: cast removes address space '__user' of expression
   arch/x86/kernel/signal.c:337:9: sparse: sparse: cast removes address space '__user' of expression
   arch/x86/kernel/signal.c:337:9: sparse: sparse: cast removes address space '__user' of expression
   arch/x86/kernel/signal.c:337:9: sparse: sparse: cast removes address space '__user' of expression
   arch/x86/kernel/signal.c:337:9: sparse: sparse: cast removes address space '__user' of expression
   arch/x86/kernel/signal.c:337:9: sparse: sparse: cast removes address space '__user' of expression
   arch/x86/kernel/signal.c:397:9: sparse: sparse: cast removes address space '__user' of expression
   arch/x86/kernel/signal.c:397:9: sparse: sparse: incorrect type in argument 1 (different address spaces) @@     expected void const volatile [noderef] __user *ptr @@     got unsigned long long [usertype] * @@
   arch/x86/kernel/signal.c:397:9: sparse:     expected void const volatile [noderef] __user *ptr
   arch/x86/kernel/signal.c:397:9: sparse:     got unsigned long long [usertype] *
   arch/x86/kernel/signal.c:397:9: sparse: sparse: cast removes address space '__user' of expression
   arch/x86/kernel/signal.c:397:9: sparse: sparse: cast removes address space '__user' of expression
   arch/x86/kernel/signal.c:397:9: sparse: sparse: cast removes address space '__user' of expression
   arch/x86/kernel/signal.c:397:9: sparse: sparse: cast removes address space '__user' of expression
   arch/x86/kernel/signal.c:397:9: sparse: sparse: cast removes address space '__user' of expression
   arch/x86/kernel/signal.c:397:9: sparse: sparse: cast removes address space '__user' of expression
   arch/x86/kernel/signal.c:397:9: sparse: sparse: cast removes address space '__user' of expression
   arch/x86/kernel/signal.c:397:9: sparse: sparse: cast removes address space '__user' of expression
   arch/x86/kernel/signal.c:397:9: sparse: sparse: cast removes address space '__user' of expression

vim +337 arch/x86/kernel/signal.c

75779f05264b99 arch/x86/kernel/signal.c    Hiroshi Shimamoto 2009-02-27  302  
7e907f48980d66 arch/x86/kernel/signal_32.c Ingo Molnar       2008-03-06  303  static int
235b80226b986d arch/x86/kernel/signal.c    Al Viro           2012-11-09  304  __setup_frame(int sig, struct ksignal *ksig, sigset_t *set,
7e907f48980d66 arch/x86/kernel/signal_32.c Ingo Molnar       2008-03-06  305  	      struct pt_regs *regs)
^1da177e4c3f41 arch/i386/kernel/signal.c   Linus Torvalds    2005-04-16  306  {
^1da177e4c3f41 arch/i386/kernel/signal.c   Linus Torvalds    2005-04-16  307  	struct sigframe __user *frame;
7e907f48980d66 arch/x86/kernel/signal_32.c Ingo Molnar       2008-03-06  308  	void __user *restorer;
b00d8f8f0b2b39 arch/x86/kernel/signal.c    Al Viro           2020-02-15  309  	void __user *fp = NULL;
^1da177e4c3f41 arch/i386/kernel/signal.c   Linus Torvalds    2005-04-16  310  
b00d8f8f0b2b39 arch/x86/kernel/signal.c    Al Viro           2020-02-15  311  	frame = get_sigframe(&ksig->ka, regs, sizeof(*frame), &fp);
^1da177e4c3f41 arch/i386/kernel/signal.c   Linus Torvalds    2005-04-16  312  
5c1f178094631e arch/x86/kernel/signal.c    Al Viro           2020-02-15  313  	if (!user_access_begin(frame, sizeof(*frame)))
3d0aedd9538e6b arch/x86/kernel/signal_32.c Hiroshi Shimamoto 2008-09-12  314  		return -EFAULT;
^1da177e4c3f41 arch/i386/kernel/signal.c   Linus Torvalds    2005-04-16  315  
5c1f178094631e arch/x86/kernel/signal.c    Al Viro           2020-02-15  316  	unsafe_put_user(sig, &frame->sig, Efault);
b00d8f8f0b2b39 arch/x86/kernel/signal.c    Al Viro           2020-02-15  317  	unsafe_put_sigcontext(&frame->sc, fp, regs, set, Efault);
5c1f178094631e arch/x86/kernel/signal.c    Al Viro           2020-02-15  318  	unsafe_put_user(set->sig[1], &frame->extramask[0], Efault);
1a3e4ca41c5a38 arch/x86/kernel/signal_32.c Roland McGrath    2008-04-09  319  	if (current->mm->context.vdso)
6f121e548f8367 arch/x86/kernel/signal.c    Andy Lutomirski   2014-05-05  320  		restorer = current->mm->context.vdso +
0a6d1fa0d2b48f arch/x86/kernel/signal.c    Andy Lutomirski   2015-10-05  321  			vdso_image_32.sym___kernel_sigreturn;
9fbbd4dd17d071 arch/i386/kernel/signal.c   Andi Kleen        2007-02-13  322  	else
ade1af77129dea arch/x86/kernel/signal_32.c Jan Engelhardt    2008-01-30  323  		restorer = &frame->retcode;
235b80226b986d arch/x86/kernel/signal.c    Al Viro           2012-11-09  324  	if (ksig->ka.sa.sa_flags & SA_RESTORER)
235b80226b986d arch/x86/kernel/signal.c    Al Viro           2012-11-09  325  		restorer = ksig->ka.sa.sa_restorer;
^1da177e4c3f41 arch/i386/kernel/signal.c   Linus Torvalds    2005-04-16  326  
^1da177e4c3f41 arch/i386/kernel/signal.c   Linus Torvalds    2005-04-16  327  	/* Set up to return from userspace.  */
5c1f178094631e arch/x86/kernel/signal.c    Al Viro           2020-02-15  328  	unsafe_put_user(restorer, &frame->pretcode, Efault);
^1da177e4c3f41 arch/i386/kernel/signal.c   Linus Torvalds    2005-04-16  329  
^1da177e4c3f41 arch/i386/kernel/signal.c   Linus Torvalds    2005-04-16  330  	/*
7e907f48980d66 arch/x86/kernel/signal_32.c Ingo Molnar       2008-03-06  331  	 * This is popl %eax ; movl $__NR_sigreturn, %eax ; int $0x80
^1da177e4c3f41 arch/i386/kernel/signal.c   Linus Torvalds    2005-04-16  332  	 *
^1da177e4c3f41 arch/i386/kernel/signal.c   Linus Torvalds    2005-04-16  333  	 * WE DO NOT USE IT ANY MORE! It's only left here for historical
^1da177e4c3f41 arch/i386/kernel/signal.c   Linus Torvalds    2005-04-16  334  	 * reasons and because gdb uses it as a signature to notice
^1da177e4c3f41 arch/i386/kernel/signal.c   Linus Torvalds    2005-04-16  335  	 * signal handler stack frames.
^1da177e4c3f41 arch/i386/kernel/signal.c   Linus Torvalds    2005-04-16  336  	 */
5c1f178094631e arch/x86/kernel/signal.c    Al Viro           2020-02-15 @337  	unsafe_put_user(*((u64 *)&retcode), (u64 *)frame->retcode, Efault);
5c1f178094631e arch/x86/kernel/signal.c    Al Viro           2020-02-15  338  	user_access_end();
^1da177e4c3f41 arch/i386/kernel/signal.c   Linus Torvalds    2005-04-16  339  
^1da177e4c3f41 arch/i386/kernel/signal.c   Linus Torvalds    2005-04-16  340  	/* Set up registers for signal handler */
65ea5b03499035 arch/x86/kernel/signal_32.c H. Peter Anvin    2008-01-30  341  	regs->sp = (unsigned long)frame;
235b80226b986d arch/x86/kernel/signal.c    Al Viro           2012-11-09  342  	regs->ip = (unsigned long)ksig->ka.sa.sa_handler;
65ea5b03499035 arch/x86/kernel/signal_32.c H. Peter Anvin    2008-01-30  343  	regs->ax = (unsigned long)sig;
92bc2056855b32 arch/x86/kernel/signal_32.c Harvey Harrison   2008-02-08  344  	regs->dx = 0;
92bc2056855b32 arch/x86/kernel/signal_32.c Harvey Harrison   2008-02-08  345  	regs->cx = 0;
^1da177e4c3f41 arch/i386/kernel/signal.c   Linus Torvalds    2005-04-16  346  
65ea5b03499035 arch/x86/kernel/signal_32.c H. Peter Anvin    2008-01-30  347  	regs->ds = __USER_DS;
65ea5b03499035 arch/x86/kernel/signal_32.c H. Peter Anvin    2008-01-30  348  	regs->es = __USER_DS;
65ea5b03499035 arch/x86/kernel/signal_32.c H. Peter Anvin    2008-01-30  349  	regs->ss = __USER_DS;
65ea5b03499035 arch/x86/kernel/signal_32.c H. Peter Anvin    2008-01-30  350  	regs->cs = __USER_CS;
^1da177e4c3f41 arch/i386/kernel/signal.c   Linus Torvalds    2005-04-16  351  
283828f3c19ceb arch/i386/kernel/signal.c   David Howells     2006-01-18  352  	return 0;
b00d8f8f0b2b39 arch/x86/kernel/signal.c    Al Viro           2020-02-15  353  
b00d8f8f0b2b39 arch/x86/kernel/signal.c    Al Viro           2020-02-15  354  Efault:
b00d8f8f0b2b39 arch/x86/kernel/signal.c    Al Viro           2020-02-15  355  	user_access_end();
b00d8f8f0b2b39 arch/x86/kernel/signal.c    Al Viro           2020-02-15  356  	return -EFAULT;
^1da177e4c3f41 arch/i386/kernel/signal.c   Linus Torvalds    2005-04-16  357  }
^1da177e4c3f41 arch/i386/kernel/signal.c   Linus Torvalds    2005-04-16  358  

---
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: 28288 bytes --]

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

* Re: [PATCH] sparse: use static inline for __chk_{user,io}_ptr()
  2020-06-28  7:20 [PATCH] sparse: use static inline for __chk_{user,io}_ptr() Luc Van Oostenryck
  2020-06-29 17:12 ` kernel test robot
@ 2020-06-29 18:08 ` kernel test robot
  2020-06-29 18:37   ` Luc Van Oostenryck
  2020-07-01 18:35 ` kernel test robot
  2 siblings, 1 reply; 6+ messages in thread
From: kernel test robot @ 2020-06-29 18:08 UTC (permalink / raw)
  To: Luc Van Oostenryck, Andrew Morton
  Cc: kbuild-all, Linux Memory Management List, linux-kernel,
	Luc Van Oostenryck

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

Hi Luc,

I love your patch! Perhaps something to improve:

[auto build test WARNING on next-20200626]
[cannot apply to linux/master linus/master v5.8-rc2 v5.8-rc1 v5.7 v5.8-rc3]
[If your patch is applied to the wrong git tree, kindly drop us a note.
And when submitting patch, we suggest to use  as documented in
https://git-scm.com/docs/git-format-patch]

url:    https://github.com/0day-ci/linux/commits/Luc-Van-Oostenryck/sparse-use-static-inline-for-__chk_-user-io-_ptr/20200628-152401
base:    36e3135df4d426612fc77db26a312c2531108603
config: i386-randconfig-s002-20200629 (attached as .config)
compiler: gcc-9 (Debian 9.3.0-13) 9.3.0
reproduce:
        # apt-get install sparse
        # sparse version: v0.6.2-3-gfa153962-dirty
        # save the attached .config to linux build tree
        make W=1 C= CF='-fdiagnostic-prefix -D__CHECK_ENDIAN__' ARCH=i386 

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


sparse warnings: (new ones prefixed by >>)

   drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c:818:42: sparse: sparse: cast removes address space '__iomem' of expression
   drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c:2388:21: sparse: sparse: cast removes address space '__user' of expression
   drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c:2388:21: sparse: sparse: cast removes address space '__user' of expression
   drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c:2388:21: sparse: sparse: cast removes address space '__user' of expression
   drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c:2388:21: sparse: sparse: cast removes address space '__user' of expression
   drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c:2388:21: sparse: sparse: cast removes address space '__user' of expression
>> drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c:2388:21: sparse: sparse: incorrect type in argument 1 (different address spaces) @@     expected void const volatile [noderef] __user *ptr @@     got unsigned int [usertype] * @@
>> drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c:2388:21: sparse:     expected void const volatile [noderef] __user *ptr
   drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c:2388:21: sparse:     got unsigned int [usertype] *
   drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c:2388:21: sparse: sparse: cast removes address space '__user' of expression
   drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c:2388:21: sparse: sparse: cast removes address space '__user' of expression
   drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c:2388:21: sparse: sparse: cast removes address space '__user' of expression
--
   drivers/gpu/drm/amd/amdgpu/amdgpu_ring.c:384:29: sparse: sparse: cast removes address space '__user' of expression
   drivers/gpu/drm/amd/amdgpu/amdgpu_ring.c:384:29: sparse: sparse: cast removes address space '__user' of expression
>> drivers/gpu/drm/amd/amdgpu/amdgpu_ring.c:384:29: sparse: sparse: incorrect type in argument 1 (different address spaces) @@     expected void const volatile [noderef] __user *ptr @@     got unsigned int [usertype] * @@
>> drivers/gpu/drm/amd/amdgpu/amdgpu_ring.c:384:29: sparse:     expected void const volatile [noderef] __user *ptr
   drivers/gpu/drm/amd/amdgpu/amdgpu_ring.c:384:29: sparse:     got unsigned int [usertype] *
   drivers/gpu/drm/amd/amdgpu/amdgpu_ring.c:384:29: sparse: sparse: cast removes address space '__user' of expression
   drivers/gpu/drm/amd/amdgpu/amdgpu_ring.c:384:29: sparse: sparse: cast removes address space '__user' of expression
   drivers/gpu/drm/amd/amdgpu/amdgpu_ring.c:384:29: sparse: sparse: cast removes address space '__user' of expression
   drivers/gpu/drm/amd/amdgpu/amdgpu_ring.c:384:29: sparse: sparse: cast removes address space '__user' of expression
   drivers/gpu/drm/amd/amdgpu/amdgpu_ring.c:384:29: sparse: sparse: cast removes address space '__user' of expression
   drivers/gpu/drm/amd/amdgpu/amdgpu_ring.c:384:29: sparse: sparse: cast removes address space '__user' of expression
   drivers/gpu/drm/amd/amdgpu/amdgpu_ring.c:384:29: sparse: sparse: cast removes address space '__user' of expression
   drivers/gpu/drm/amd/amdgpu/amdgpu_ring.c:384:29: sparse: sparse: cast removes address space '__user' of expression
   drivers/gpu/drm/amd/amdgpu/amdgpu_ring.c:384:29: sparse: sparse: cast removes address space '__user' of expression
   drivers/gpu/drm/amd/amdgpu/amdgpu_ring.c:384:29: sparse: sparse: cast removes address space '__user' of expression
   drivers/gpu/drm/amd/amdgpu/amdgpu_ring.c:384:29: sparse: sparse: cast removes address space '__user' of expression
   drivers/gpu/drm/amd/amdgpu/amdgpu_ring.c:399:21: sparse: sparse: cast removes address space '__user' of expression
   drivers/gpu/drm/amd/amdgpu/amdgpu_ring.c:399:21: sparse: sparse: cast removes address space '__user' of expression
   drivers/gpu/drm/amd/amdgpu/amdgpu_ring.c:399:21: sparse: sparse: incorrect type in argument 1 (different address spaces) @@     expected void const volatile [noderef] __user *ptr @@     got unsigned int [usertype] * @@
   drivers/gpu/drm/amd/amdgpu/amdgpu_ring.c:399:21: sparse:     expected void const volatile [noderef] __user *ptr
   drivers/gpu/drm/amd/amdgpu/amdgpu_ring.c:399:21: sparse:     got unsigned int [usertype] *
   drivers/gpu/drm/amd/amdgpu/amdgpu_ring.c:399:21: sparse: sparse: cast removes address space '__user' of expression
   drivers/gpu/drm/amd/amdgpu/amdgpu_ring.c:399:21: sparse: sparse: cast removes address space '__user' of expression
   drivers/gpu/drm/amd/amdgpu/amdgpu_ring.c:399:21: sparse: sparse: cast removes address space '__user' of expression
   drivers/gpu/drm/amd/amdgpu/amdgpu_ring.c:399:21: sparse: sparse: cast removes address space '__user' of expression
   drivers/gpu/drm/amd/amdgpu/amdgpu_ring.c:399:21: sparse: sparse: cast removes address space '__user' of expression
   drivers/gpu/drm/amd/amdgpu/amdgpu_ring.c:399:21: sparse: sparse: cast removes address space '__user' of expression
   drivers/gpu/drm/amd/amdgpu/amdgpu_ring.c:399:21: sparse: sparse: cast removes address space '__user' of expression
   drivers/gpu/drm/amd/amdgpu/amdgpu_ring.c:399:21: sparse: sparse: cast removes address space '__user' of expression
   drivers/gpu/drm/amd/amdgpu/amdgpu_ring.c:399:21: sparse: sparse: cast removes address space '__user' of expression
   drivers/gpu/drm/amd/amdgpu/amdgpu_ring.c:399:21: sparse: sparse: cast removes address space '__user' of expression
   drivers/gpu/drm/amd/amdgpu/amdgpu_ring.c:399:21: sparse: sparse: cast removes address space '__user' of expression
--
   drivers/gpu/drm/amd/amdgpu/amdgpu_debugfs.c:138:17: sparse: sparse: incorrect type in initializer (different base types) @@     expected restricted __poll_t ( *poll )( ... ) @@     got unsigned int ( * )( ... ) @@
   drivers/gpu/drm/amd/amdgpu/amdgpu_debugfs.c:138:17: sparse:     expected restricted __poll_t ( *poll )( ... )
   drivers/gpu/drm/amd/amdgpu/amdgpu_debugfs.c:138:17: sparse:     got unsigned int ( * )( ... )
   drivers/gpu/drm/amd/amdgpu/amdgpu_debugfs.c:261:29: sparse: sparse: cast removes address space '__user' of expression
   drivers/gpu/drm/amd/amdgpu/amdgpu_debugfs.c:261:29: sparse: sparse: cast removes address space '__user' of expression
>> drivers/gpu/drm/amd/amdgpu/amdgpu_debugfs.c:261:29: sparse: sparse: incorrect type in argument 1 (different address spaces) @@     expected void const volatile [noderef] __user *ptr @@     got unsigned int [usertype] * @@
>> drivers/gpu/drm/amd/amdgpu/amdgpu_debugfs.c:261:29: sparse:     expected void const volatile [noderef] __user *ptr
   drivers/gpu/drm/amd/amdgpu/amdgpu_debugfs.c:261:29: sparse:     got unsigned int [usertype] *
   drivers/gpu/drm/amd/amdgpu/amdgpu_debugfs.c:261:29: sparse: sparse: cast removes address space '__user' of expression
   drivers/gpu/drm/amd/amdgpu/amdgpu_debugfs.c:261:29: sparse: sparse: cast removes address space '__user' of expression
   drivers/gpu/drm/amd/amdgpu/amdgpu_debugfs.c:261:29: sparse: sparse: cast removes address space '__user' of expression
   drivers/gpu/drm/amd/amdgpu/amdgpu_debugfs.c:261:29: sparse: sparse: cast removes address space '__user' of expression
   drivers/gpu/drm/amd/amdgpu/amdgpu_debugfs.c:261:29: sparse: sparse: cast removes address space '__user' of expression
   drivers/gpu/drm/amd/amdgpu/amdgpu_debugfs.c:261:29: sparse: sparse: cast removes address space '__user' of expression
   drivers/gpu/drm/amd/amdgpu/amdgpu_debugfs.c:261:29: sparse: sparse: cast removes address space '__user' of expression
   drivers/gpu/drm/amd/amdgpu/amdgpu_debugfs.c:261:29: sparse: sparse: cast removes address space '__user' of expression
   drivers/gpu/drm/amd/amdgpu/amdgpu_debugfs.c:261:29: sparse: sparse: cast removes address space '__user' of expression
   drivers/gpu/drm/amd/amdgpu/amdgpu_debugfs.c:261:29: sparse: sparse: cast removes address space '__user' of expression
   drivers/gpu/drm/amd/amdgpu/amdgpu_debugfs.c:261:29: sparse: sparse: cast removes address space '__user' of expression
   drivers/gpu/drm/amd/amdgpu/amdgpu_debugfs.c:263:29: sparse: sparse: cast removes address space '__user' of expression
   drivers/gpu/drm/amd/amdgpu/amdgpu_debugfs.c:263:29: sparse: sparse: cast removes address space '__user' of expression
   drivers/gpu/drm/amd/amdgpu/amdgpu_debugfs.c:263:29: sparse: sparse: cast removes address space '__user' of expression
   drivers/gpu/drm/amd/amdgpu/amdgpu_debugfs.c:263:29: sparse: sparse: cast removes address space '__user' of expression
   drivers/gpu/drm/amd/amdgpu/amdgpu_debugfs.c:263:29: sparse: sparse: cast removes address space '__user' of expression
   drivers/gpu/drm/amd/amdgpu/amdgpu_debugfs.c:263:29: sparse: sparse: incorrect type in argument 1 (different address spaces) @@     expected void const volatile [noderef] __user *ptr @@     got unsigned int [usertype] * @@
   drivers/gpu/drm/amd/amdgpu/amdgpu_debugfs.c:263:29: sparse:     expected void const volatile [noderef] __user *ptr
   drivers/gpu/drm/amd/amdgpu/amdgpu_debugfs.c:263:29: sparse:     got unsigned int [usertype] *
   drivers/gpu/drm/amd/amdgpu/amdgpu_debugfs.c:263:29: sparse: sparse: cast removes address space '__user' of expression
   drivers/gpu/drm/amd/amdgpu/amdgpu_debugfs.c:263:29: sparse: sparse: cast removes address space '__user' of expression
   drivers/gpu/drm/amd/amdgpu/amdgpu_debugfs.c:263:29: sparse: sparse: cast removes address space '__user' of expression
   drivers/gpu/drm/amd/amdgpu/amdgpu_debugfs.c:354:21: sparse: sparse: cast removes address space '__user' of expression
   drivers/gpu/drm/amd/amdgpu/amdgpu_debugfs.c:354:21: sparse: sparse: cast removes address space '__user' of expression
   drivers/gpu/drm/amd/amdgpu/amdgpu_debugfs.c:354:21: sparse: sparse: incorrect type in argument 1 (different address spaces) @@     expected void const volatile [noderef] __user *ptr @@     got unsigned int [usertype] * @@
   drivers/gpu/drm/amd/amdgpu/amdgpu_debugfs.c:354:21: sparse:     expected void const volatile [noderef] __user *ptr
   drivers/gpu/drm/amd/amdgpu/amdgpu_debugfs.c:354:21: sparse:     got unsigned int [usertype] *
   drivers/gpu/drm/amd/amdgpu/amdgpu_debugfs.c:354:21: sparse: sparse: cast removes address space '__user' of expression
   drivers/gpu/drm/amd/amdgpu/amdgpu_debugfs.c:354:21: sparse: sparse: cast removes address space '__user' of expression
   drivers/gpu/drm/amd/amdgpu/amdgpu_debugfs.c:354:21: sparse: sparse: cast removes address space '__user' of expression
   drivers/gpu/drm/amd/amdgpu/amdgpu_debugfs.c:354:21: sparse: sparse: cast removes address space '__user' of expression
   drivers/gpu/drm/amd/amdgpu/amdgpu_debugfs.c:354:21: sparse: sparse: cast removes address space '__user' of expression
   drivers/gpu/drm/amd/amdgpu/amdgpu_debugfs.c:354:21: sparse: sparse: cast removes address space '__user' of expression
   drivers/gpu/drm/amd/amdgpu/amdgpu_debugfs.c:354:21: sparse: sparse: cast removes address space '__user' of expression
   drivers/gpu/drm/amd/amdgpu/amdgpu_debugfs.c:354:21: sparse: sparse: cast removes address space '__user' of expression
   drivers/gpu/drm/amd/amdgpu/amdgpu_debugfs.c:354:21: sparse: sparse: cast removes address space '__user' of expression
   drivers/gpu/drm/amd/amdgpu/amdgpu_debugfs.c:354:21: sparse: sparse: cast removes address space '__user' of expression
   drivers/gpu/drm/amd/amdgpu/amdgpu_debugfs.c:354:21: sparse: sparse: cast removes address space '__user' of expression
   drivers/gpu/drm/amd/amdgpu/amdgpu_debugfs.c:412:21: sparse: sparse: cast removes address space '__user' of expression
   drivers/gpu/drm/amd/amdgpu/amdgpu_debugfs.c:412:21: sparse: sparse: cast removes address space '__user' of expression
   drivers/gpu/drm/amd/amdgpu/amdgpu_debugfs.c:412:21: sparse: sparse: cast removes address space '__user' of expression
   drivers/gpu/drm/amd/amdgpu/amdgpu_debugfs.c:412:21: sparse: sparse: cast removes address space '__user' of expression
   drivers/gpu/drm/amd/amdgpu/amdgpu_debugfs.c:412:21: sparse: sparse: cast removes address space '__user' of expression
   drivers/gpu/drm/amd/amdgpu/amdgpu_debugfs.c:412:21: sparse: sparse: incorrect type in argument 1 (different address spaces) @@     expected void const volatile [noderef] __user *ptr @@     got unsigned int [usertype] * @@
   drivers/gpu/drm/amd/amdgpu/amdgpu_debugfs.c:412:21: sparse:     expected void const volatile [noderef] __user *ptr
   drivers/gpu/drm/amd/amdgpu/amdgpu_debugfs.c:412:21: sparse:     got unsigned int [usertype] *
   drivers/gpu/drm/amd/amdgpu/amdgpu_debugfs.c:412:21: sparse: sparse: cast removes address space '__user' of expression
   drivers/gpu/drm/amd/amdgpu/amdgpu_debugfs.c:412:21: sparse: sparse: cast removes address space '__user' of expression
   drivers/gpu/drm/amd/amdgpu/amdgpu_debugfs.c:412:21: sparse: sparse: cast removes address space '__user' of expression
   drivers/gpu/drm/amd/amdgpu/amdgpu_debugfs.c:473:21: sparse: sparse: cast removes address space '__user' of expression
   drivers/gpu/drm/amd/amdgpu/amdgpu_debugfs.c:473:21: sparse: sparse: cast removes address space '__user' of expression
   drivers/gpu/drm/amd/amdgpu/amdgpu_debugfs.c:473:21: sparse: sparse: incorrect type in argument 1 (different address spaces) @@     expected void const volatile [noderef] __user *ptr @@     got unsigned int [usertype] * @@
   drivers/gpu/drm/amd/amdgpu/amdgpu_debugfs.c:473:21: sparse:     expected void const volatile [noderef] __user *ptr
   drivers/gpu/drm/amd/amdgpu/amdgpu_debugfs.c:473:21: sparse:     got unsigned int [usertype] *
   drivers/gpu/drm/amd/amdgpu/amdgpu_debugfs.c:473:21: sparse: sparse: cast removes address space '__user' of expression
   drivers/gpu/drm/amd/amdgpu/amdgpu_debugfs.c:473:21: sparse: sparse: cast removes address space '__user' of expression
   drivers/gpu/drm/amd/amdgpu/amdgpu_debugfs.c:473:21: sparse: sparse: cast removes address space '__user' of expression
   drivers/gpu/drm/amd/amdgpu/amdgpu_debugfs.c:473:21: sparse: sparse: cast removes address space '__user' of expression
   drivers/gpu/drm/amd/amdgpu/amdgpu_debugfs.c:473:21: sparse: sparse: cast removes address space '__user' of expression
   drivers/gpu/drm/amd/amdgpu/amdgpu_debugfs.c:473:21: sparse: sparse: cast removes address space '__user' of expression
   drivers/gpu/drm/amd/amdgpu/amdgpu_debugfs.c:473:21: sparse: sparse: cast removes address space '__user' of expression
   drivers/gpu/drm/amd/amdgpu/amdgpu_debugfs.c:473:21: sparse: sparse: cast removes address space '__user' of expression
   drivers/gpu/drm/amd/amdgpu/amdgpu_debugfs.c:473:21: sparse: sparse: cast removes address space '__user' of expression
   drivers/gpu/drm/amd/amdgpu/amdgpu_debugfs.c:473:21: sparse: sparse: cast removes address space '__user' of expression
   drivers/gpu/drm/amd/amdgpu/amdgpu_debugfs.c:473:21: sparse: sparse: cast removes address space '__user' of expression
   drivers/gpu/drm/amd/amdgpu/amdgpu_debugfs.c:531:21: sparse: sparse: cast removes address space '__user' of expression
   drivers/gpu/drm/amd/amdgpu/amdgpu_debugfs.c:531:21: sparse: sparse: cast removes address space '__user' of expression
   drivers/gpu/drm/amd/amdgpu/amdgpu_debugfs.c:531:21: sparse: sparse: cast removes address space '__user' of expression
   drivers/gpu/drm/amd/amdgpu/amdgpu_debugfs.c:531:21: sparse: sparse: cast removes address space '__user' of expression
   drivers/gpu/drm/amd/amdgpu/amdgpu_debugfs.c:531:21: sparse: sparse: cast removes address space '__user' of expression
   drivers/gpu/drm/amd/amdgpu/amdgpu_debugfs.c:531:21: sparse: sparse: incorrect type in argument 1 (different address spaces) @@     expected void const volatile [noderef] __user *ptr @@     got unsigned int [usertype] * @@
   drivers/gpu/drm/amd/amdgpu/amdgpu_debugfs.c:531:21: sparse:     expected void const volatile [noderef] __user *ptr
   drivers/gpu/drm/amd/amdgpu/amdgpu_debugfs.c:531:21: sparse:     got unsigned int [usertype] *
   drivers/gpu/drm/amd/amdgpu/amdgpu_debugfs.c:531:21: sparse: sparse: cast removes address space '__user' of expression
   drivers/gpu/drm/amd/amdgpu/amdgpu_debugfs.c:531:21: sparse: sparse: cast removes address space '__user' of expression
   drivers/gpu/drm/amd/amdgpu/amdgpu_debugfs.c:531:21: sparse: sparse: cast removes address space '__user' of expression
   drivers/gpu/drm/amd/amdgpu/amdgpu_debugfs.c:592:21: sparse: sparse: cast removes address space '__user' of expression
   drivers/gpu/drm/amd/amdgpu/amdgpu_debugfs.c:592:21: sparse: sparse: cast removes address space '__user' of expression
   drivers/gpu/drm/amd/amdgpu/amdgpu_debugfs.c:592:21: sparse: sparse: incorrect type in argument 1 (different address spaces) @@     expected void const volatile [noderef] __user *ptr @@     got unsigned int [usertype] * @@
   drivers/gpu/drm/amd/amdgpu/amdgpu_debugfs.c:592:21: sparse:     expected void const volatile [noderef] __user *ptr
   drivers/gpu/drm/amd/amdgpu/amdgpu_debugfs.c:592:21: sparse:     got unsigned int [usertype] *
   drivers/gpu/drm/amd/amdgpu/amdgpu_debugfs.c:592:21: sparse: sparse: cast removes address space '__user' of expression
   drivers/gpu/drm/amd/amdgpu/amdgpu_debugfs.c:592:21: sparse: sparse: cast removes address space '__user' of expression
   drivers/gpu/drm/amd/amdgpu/amdgpu_debugfs.c:592:21: sparse: sparse: cast removes address space '__user' of expression
   drivers/gpu/drm/amd/amdgpu/amdgpu_debugfs.c:592:21: sparse: sparse: cast removes address space '__user' of expression
   drivers/gpu/drm/amd/amdgpu/amdgpu_debugfs.c:592:21: sparse: sparse: cast removes address space '__user' of expression
   drivers/gpu/drm/amd/amdgpu/amdgpu_debugfs.c:592:21: sparse: sparse: cast removes address space '__user' of expression
   drivers/gpu/drm/amd/amdgpu/amdgpu_debugfs.c:592:21: sparse: sparse: cast removes address space '__user' of expression
   drivers/gpu/drm/amd/amdgpu/amdgpu_debugfs.c:592:21: sparse: sparse: cast removes address space '__user' of expression
   drivers/gpu/drm/amd/amdgpu/amdgpu_debugfs.c:592:21: sparse: sparse: cast removes address space '__user' of expression
   drivers/gpu/drm/amd/amdgpu/amdgpu_debugfs.c:592:21: sparse: sparse: cast removes address space '__user' of expression
   drivers/gpu/drm/amd/amdgpu/amdgpu_debugfs.c:592:21: sparse: sparse: cast removes address space '__user' of expression
   drivers/gpu/drm/amd/amdgpu/amdgpu_debugfs.c:650:21: sparse: sparse: cast removes address space '__user' of expression
   drivers/gpu/drm/amd/amdgpu/amdgpu_debugfs.c:650:21: sparse: sparse: cast removes address space '__user' of expression
   drivers/gpu/drm/amd/amdgpu/amdgpu_debugfs.c:650:21: sparse: sparse: cast removes address space '__user' of expression
   drivers/gpu/drm/amd/amdgpu/amdgpu_debugfs.c:650:21: sparse: sparse: cast removes address space '__user' of expression
   drivers/gpu/drm/amd/amdgpu/amdgpu_debugfs.c:650:21: sparse: sparse: cast removes address space '__user' of expression
   drivers/gpu/drm/amd/amdgpu/amdgpu_debugfs.c:650:21: sparse: sparse: incorrect type in argument 1 (different address spaces) @@     expected void const volatile [noderef] __user *ptr @@     got unsigned int [usertype] * @@
   drivers/gpu/drm/amd/amdgpu/amdgpu_debugfs.c:650:21: sparse:     expected void const volatile [noderef] __user *ptr

vim +2388 drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c

d38ceaf99ed015 Alex Deucher    2015-04-20  2362  
50da51744f005f Tom St Denis    2018-05-09  2363  /**
50da51744f005f Tom St Denis    2018-05-09  2364   * amdgpu_ttm_vram_write - Linear write access to VRAM
50da51744f005f Tom St Denis    2018-05-09  2365   *
50da51744f005f Tom St Denis    2018-05-09  2366   * Accesses VRAM via MMIO for debugging purposes.
50da51744f005f Tom St Denis    2018-05-09  2367   */
08cab989f77582 Tom St Denis    2017-08-29  2368  static ssize_t amdgpu_ttm_vram_write(struct file *f, const char __user *buf,
08cab989f77582 Tom St Denis    2017-08-29  2369  				    size_t size, loff_t *pos)
08cab989f77582 Tom St Denis    2017-08-29  2370  {
08cab989f77582 Tom St Denis    2017-08-29  2371  	struct amdgpu_device *adev = file_inode(f)->i_private;
08cab989f77582 Tom St Denis    2017-08-29  2372  	ssize_t result = 0;
08cab989f77582 Tom St Denis    2017-08-29  2373  	int r;
08cab989f77582 Tom St Denis    2017-08-29  2374  
08cab989f77582 Tom St Denis    2017-08-29  2375  	if (size & 0x3 || *pos & 0x3)
08cab989f77582 Tom St Denis    2017-08-29  2376  		return -EINVAL;
08cab989f77582 Tom St Denis    2017-08-29  2377  
770d13b19fdf36 Christian König 2018-01-12  2378  	if (*pos >= adev->gmc.mc_vram_size)
08cab989f77582 Tom St Denis    2017-08-29  2379  		return -ENXIO;
08cab989f77582 Tom St Denis    2017-08-29  2380  
08cab989f77582 Tom St Denis    2017-08-29  2381  	while (size) {
08cab989f77582 Tom St Denis    2017-08-29  2382  		unsigned long flags;
08cab989f77582 Tom St Denis    2017-08-29  2383  		uint32_t value;
08cab989f77582 Tom St Denis    2017-08-29  2384  
770d13b19fdf36 Christian König 2018-01-12  2385  		if (*pos >= adev->gmc.mc_vram_size)
08cab989f77582 Tom St Denis    2017-08-29  2386  			return result;
08cab989f77582 Tom St Denis    2017-08-29  2387  
08cab989f77582 Tom St Denis    2017-08-29 @2388  		r = get_user(value, (uint32_t *)buf);
08cab989f77582 Tom St Denis    2017-08-29  2389  		if (r)
08cab989f77582 Tom St Denis    2017-08-29  2390  			return r;
08cab989f77582 Tom St Denis    2017-08-29  2391  
08cab989f77582 Tom St Denis    2017-08-29  2392  		spin_lock_irqsave(&adev->mmio_idx_lock, flags);
c30572814df55b Tom St Denis    2017-09-13  2393  		WREG32_NO_KIQ(mmMM_INDEX, ((uint32_t)*pos) | 0x80000000);
c30572814df55b Tom St Denis    2017-09-13  2394  		WREG32_NO_KIQ(mmMM_INDEX_HI, *pos >> 31);
c30572814df55b Tom St Denis    2017-09-13  2395  		WREG32_NO_KIQ(mmMM_DATA, value);
08cab989f77582 Tom St Denis    2017-08-29  2396  		spin_unlock_irqrestore(&adev->mmio_idx_lock, flags);
08cab989f77582 Tom St Denis    2017-08-29  2397  
08cab989f77582 Tom St Denis    2017-08-29  2398  		result += 4;
08cab989f77582 Tom St Denis    2017-08-29  2399  		buf += 4;
08cab989f77582 Tom St Denis    2017-08-29  2400  		*pos += 4;
08cab989f77582 Tom St Denis    2017-08-29  2401  		size -= 4;
08cab989f77582 Tom St Denis    2017-08-29  2402  	}
08cab989f77582 Tom St Denis    2017-08-29  2403  
08cab989f77582 Tom St Denis    2017-08-29  2404  	return result;
08cab989f77582 Tom St Denis    2017-08-29  2405  }
08cab989f77582 Tom St Denis    2017-08-29  2406  

---
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: 33750 bytes --]

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

* Re: [PATCH] sparse: use static inline for __chk_{user,io}_ptr()
  2020-06-29 18:08 ` kernel test robot
@ 2020-06-29 18:37   ` Luc Van Oostenryck
  2020-06-30  0:31     ` [kbuild-all] " Rong Chen
  0 siblings, 1 reply; 6+ messages in thread
From: Luc Van Oostenryck @ 2020-06-29 18:37 UTC (permalink / raw)
  To: kernel test robot; +Cc: kbuild-all, linux-kernel

On Tue, Jun 30, 2020 at 02:08:36AM +0800, kernel test robot wrote:
> Hi Luc,
> 
> I love your patch! Perhaps something to improve:
> 
> [auto build test WARNING on next-20200626]
> [cannot apply to linux/master linus/master v5.8-rc2 v5.8-rc1 v5.7 v5.8-rc3]
> [If your patch is applied to the wrong git tree, kindly drop us a note.

This patch should be applied on top of akpm's tree or on top of next.
I'm not sure hwo I should have specified this, 'git send-mail --base=...'
is less useful for these trees.

-- Luc

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

* Re: [kbuild-all] Re: [PATCH] sparse: use static inline for __chk_{user,io}_ptr()
  2020-06-29 18:37   ` Luc Van Oostenryck
@ 2020-06-30  0:31     ` Rong Chen
  0 siblings, 0 replies; 6+ messages in thread
From: Rong Chen @ 2020-06-30  0:31 UTC (permalink / raw)
  To: Luc Van Oostenryck, kernel test robot; +Cc: kbuild-all, linux-kernel



On 6/30/20 2:37 AM, Luc Van Oostenryck wrote:
> On Tue, Jun 30, 2020 at 02:08:36AM +0800, kernel test robot wrote:
>> Hi Luc,
>>
>> I love your patch! Perhaps something to improve:
>>
>> [auto build test WARNING on next-20200626]
>> [cannot apply to linux/master linus/master v5.8-rc2 v5.8-rc1 v5.7 v5.8-rc3]
>> [If your patch is applied to the wrong git tree, kindly drop us a note.
> This patch should be applied on top of akpm's tree or on top of next.
> I'm not sure hwo I should have specified this, 'git send-mail --base=...'
> is less useful for these trees.

Hi Luc,

Thanks for the feedback, we'll fix the wrong base.

Best Regards,
Rong Chen

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

* Re: [PATCH] sparse: use static inline for __chk_{user,io}_ptr()
  2020-06-28  7:20 [PATCH] sparse: use static inline for __chk_{user,io}_ptr() Luc Van Oostenryck
  2020-06-29 17:12 ` kernel test robot
  2020-06-29 18:08 ` kernel test robot
@ 2020-07-01 18:35 ` kernel test robot
  2 siblings, 0 replies; 6+ messages in thread
From: kernel test robot @ 2020-07-01 18:35 UTC (permalink / raw)
  To: Luc Van Oostenryck, Andrew Morton
  Cc: kbuild-all, Linux Memory Management List, linux-kernel,
	Luc Van Oostenryck

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

Hi Luc,

I love your patch! Perhaps something to improve:

[auto build test WARNING on next-20200626]
[cannot apply to linux/master linus/master v5.8-rc2 v5.8-rc1 v5.7 v5.8-rc3]
[If your patch is applied to the wrong git tree, kindly drop us a note.
And when submitting patch, we suggest to use  as documented in
https://git-scm.com/docs/git-format-patch]

url:    https://github.com/0day-ci/linux/commits/Luc-Van-Oostenryck/sparse-use-static-inline-for-__chk_-user-io-_ptr/20200628-152401
base:    36e3135df4d426612fc77db26a312c2531108603
config: x86_64-randconfig-s021-20200701 (attached as .config)
compiler: gcc-9 (Debian 9.3.0-14) 9.3.0
reproduce:
        # apt-get install sparse
        # sparse version: v0.6.2-3-gfa153962-dirty
        # save the attached .config to linux build tree
        make W=1 C=1 CF='-fdiagnostic-prefix -D__CHECK_ENDIAN__' ARCH=x86_64 

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


sparse warnings: (new ones prefixed by >>)

   arch/x86/ia32/ia32_signal.c:350:9: sparse: sparse: cast removes address space '__user' of expression
>> arch/x86/ia32/ia32_signal.c:350:9: sparse: sparse: incorrect type in argument 1 (different address spaces) @@     expected void const volatile [noderef] __user *ptr @@     got unsigned long long [usertype] * @@
>> arch/x86/ia32/ia32_signal.c:350:9: sparse:     expected void const volatile [noderef] __user *ptr
   arch/x86/ia32/ia32_signal.c:350:9: sparse:     got unsigned long long [usertype] *
   arch/x86/ia32/ia32_signal.c:350:9: sparse: sparse: cast removes address space '__user' of expression
   arch/x86/ia32/ia32_signal.c:350:9: sparse: sparse: cast removes address space '__user' of expression
   arch/x86/ia32/ia32_signal.c:350:9: sparse: sparse: cast removes address space '__user' of expression
   arch/x86/ia32/ia32_signal.c:350:9: sparse: sparse: cast removes address space '__user' of expression
   arch/x86/ia32/ia32_signal.c:350:9: sparse: sparse: cast removes address space '__user' of expression
   arch/x86/ia32/ia32_signal.c:350:9: sparse: sparse: cast removes address space '__user' of expression
   arch/x86/ia32/ia32_signal.c:350:9: sparse: sparse: cast removes address space '__user' of expression
   arch/x86/ia32/ia32_signal.c:350:9: sparse: sparse: cast removes address space '__user' of expression
   arch/x86/ia32/ia32_signal.c:350:9: sparse: sparse: cast removes address space '__user' of expression
--
>> drivers/w1/slaves/w1_ds28e04.c:342:13: sparse: sparse: incorrect type in argument 1 (different address spaces) @@     expected void const volatile [noderef] __user *ptr @@     got char *buf @@
>> drivers/w1/slaves/w1_ds28e04.c:342:13: sparse:     expected void const volatile [noderef] __user *ptr
   drivers/w1/slaves/w1_ds28e04.c:342:13: sparse:     got char *buf
>> drivers/w1/slaves/w1_ds28e04.c:356:13: sparse: sparse: incorrect type in argument 1 (different address spaces) @@     expected void const volatile [noderef] __user *ptr @@     got char const *buf @@
   drivers/w1/slaves/w1_ds28e04.c:356:13: sparse:     expected void const volatile [noderef] __user *ptr
   drivers/w1/slaves/w1_ds28e04.c:356:13: sparse:     got char const *buf
--
>> drivers/watchdog/sbc_fitpc2_wdt.c:99:21: sparse: sparse: incorrect type in argument 1 (different address spaces) @@     expected void const volatile [noderef] __user *ptr @@     got char const * @@
>> drivers/watchdog/sbc_fitpc2_wdt.c:99:21: sparse:     expected void const volatile [noderef] __user *ptr
   drivers/watchdog/sbc_fitpc2_wdt.c:99:21: sparse:     got char const *
   drivers/watchdog/sbc_fitpc2_wdt.c:128:37: sparse: sparse: incorrect type in argument 1 (different address spaces) @@     expected void [noderef] __user *to @@     got struct watchdog_info * @@
   drivers/watchdog/sbc_fitpc2_wdt.c:128:37: sparse:     expected void [noderef] __user *to
   drivers/watchdog/sbc_fitpc2_wdt.c:128:37: sparse:     got struct watchdog_info *
>> drivers/watchdog/sbc_fitpc2_wdt.c:133:23: sparse: sparse: incorrect type in argument 1 (different address spaces) @@     expected void const volatile [noderef] __user *ptr @@     got int * @@
   drivers/watchdog/sbc_fitpc2_wdt.c:133:23: sparse:     expected void const volatile [noderef] __user *ptr
   drivers/watchdog/sbc_fitpc2_wdt.c:133:23: sparse:     got int *
   drivers/watchdog/sbc_fitpc2_wdt.c:137:23: sparse: sparse: incorrect type in argument 1 (different address spaces) @@     expected void const volatile [noderef] __user *ptr @@     got int * @@
   drivers/watchdog/sbc_fitpc2_wdt.c:137:23: sparse:     expected void const volatile [noderef] __user *ptr
   drivers/watchdog/sbc_fitpc2_wdt.c:137:23: sparse:     got int *
   drivers/watchdog/sbc_fitpc2_wdt.c:146:23: sparse: sparse: incorrect type in argument 1 (different address spaces) @@     expected void const volatile [noderef] __user *ptr @@     got int * @@
   drivers/watchdog/sbc_fitpc2_wdt.c:146:23: sparse:     expected void const volatile [noderef] __user *ptr
   drivers/watchdog/sbc_fitpc2_wdt.c:146:23: sparse:     got int *
   drivers/watchdog/sbc_fitpc2_wdt.c:160:23: sparse: sparse: incorrect type in argument 1 (different address spaces) @@     expected void const volatile [noderef] __user *ptr @@     got int * @@
   drivers/watchdog/sbc_fitpc2_wdt.c:160:23: sparse:     expected void const volatile [noderef] __user *ptr
   drivers/watchdog/sbc_fitpc2_wdt.c:160:23: sparse:     got int *
   drivers/watchdog/sbc_fitpc2_wdt.c:187:27: sparse: sparse: incorrect type in initializer (incompatible argument 2 (different address spaces)) @@     expected long ( *write )( ... ) @@     got long ( * )( ... ) @@
   drivers/watchdog/sbc_fitpc2_wdt.c:187:27: sparse:     expected long ( *write )( ... )
   drivers/watchdog/sbc_fitpc2_wdt.c:187:27: sparse:     got long ( * )( ... )

vim +350 arch/x86/ia32/ia32_signal.c

^1da177e4c3f41 arch/x86_64/ia32/ia32_signal.c Linus Torvalds    2005-04-16  299  
235b80226b986d arch/x86/ia32/ia32_signal.c    Al Viro           2012-11-09  300  int ia32_setup_rt_frame(int sig, struct ksignal *ksig,
^1da177e4c3f41 arch/x86_64/ia32/ia32_signal.c Linus Torvalds    2005-04-16  301  			compat_sigset_t *set, struct pt_regs *regs)
^1da177e4c3f41 arch/x86_64/ia32/ia32_signal.c Linus Torvalds    2005-04-16  302  {
3b0d29ee1c73b6 arch/x86/ia32/ia32_signal.c    Hiroshi Shimamoto 2008-12-17  303  	struct rt_sigframe_ia32 __user *frame;
af65d64845a90c arch/x86/ia32/ia32_signal.c    Roland McGrath    2008-01-30  304  	void __user *restorer;
44a1d996325982 arch/x86/ia32/ia32_signal.c    Al Viro           2020-02-15  305  	void __user *fp = NULL;
^1da177e4c3f41 arch/x86_64/ia32/ia32_signal.c Linus Torvalds    2005-04-16  306  
57d563c8292569 arch/x86/ia32/ia32_signal.c    Al Viro           2020-02-15  307  	/* unsafe_put_user optimizes that into a single 8 byte store */
99b9cdf758af70 arch/x86/ia32/ia32_signal.c    Thomas Gleixner   2008-01-30  308  	static const struct {
99b9cdf758af70 arch/x86/ia32/ia32_signal.c    Thomas Gleixner   2008-01-30  309  		u8 movl;
99b9cdf758af70 arch/x86/ia32/ia32_signal.c    Thomas Gleixner   2008-01-30  310  		u32 val;
99b9cdf758af70 arch/x86/ia32/ia32_signal.c    Thomas Gleixner   2008-01-30  311  		u16 int80;
9cc3c49ed1b1db arch/x86/ia32/ia32_signal.c    Hiroshi Shimamoto 2008-11-11  312  		u8  pad;
99b9cdf758af70 arch/x86/ia32/ia32_signal.c    Thomas Gleixner   2008-01-30  313  	} __attribute__((packed)) code = {
99b9cdf758af70 arch/x86/ia32/ia32_signal.c    Thomas Gleixner   2008-01-30  314  		0xb8,
99b9cdf758af70 arch/x86/ia32/ia32_signal.c    Thomas Gleixner   2008-01-30  315  		__NR_ia32_rt_sigreturn,
99b9cdf758af70 arch/x86/ia32/ia32_signal.c    Thomas Gleixner   2008-01-30  316  		0x80cd,
99b9cdf758af70 arch/x86/ia32/ia32_signal.c    Thomas Gleixner   2008-01-30  317  		0,
99b9cdf758af70 arch/x86/ia32/ia32_signal.c    Thomas Gleixner   2008-01-30  318  	};
99b9cdf758af70 arch/x86/ia32/ia32_signal.c    Thomas Gleixner   2008-01-30  319  
44a1d996325982 arch/x86/ia32/ia32_signal.c    Al Viro           2020-02-15  320  	frame = get_sigframe(ksig, regs, sizeof(*frame), &fp);
^1da177e4c3f41 arch/x86_64/ia32/ia32_signal.c Linus Torvalds    2005-04-16  321  
39f16c1c0f14e9 arch/x86/ia32/ia32_signal.c    Al Viro           2020-02-15  322  	if (!user_access_begin(frame, sizeof(*frame)))
3d0aedd9538e6b arch/x86/ia32/ia32_signal.c    Hiroshi Shimamoto 2008-09-12  323  		return -EFAULT;
^1da177e4c3f41 arch/x86_64/ia32/ia32_signal.c Linus Torvalds    2005-04-16  324  
39f16c1c0f14e9 arch/x86/ia32/ia32_signal.c    Al Viro           2020-02-15  325  	unsafe_put_user(sig, &frame->sig, Efault);
39f16c1c0f14e9 arch/x86/ia32/ia32_signal.c    Al Viro           2020-02-15  326  	unsafe_put_user(ptr_to_compat(&frame->info), &frame->pinfo, Efault);
39f16c1c0f14e9 arch/x86/ia32/ia32_signal.c    Al Viro           2020-02-15  327  	unsafe_put_user(ptr_to_compat(&frame->uc), &frame->puc, Efault);
^1da177e4c3f41 arch/x86_64/ia32/ia32_signal.c Linus Torvalds    2005-04-16  328  
^1da177e4c3f41 arch/x86_64/ia32/ia32_signal.c Linus Torvalds    2005-04-16  329  	/* Create the ucontext.  */
ff661350157266 arch/x86/ia32/ia32_signal.c    Marco Elver       2019-07-11  330  	if (static_cpu_has(X86_FEATURE_XSAVE))
39f16c1c0f14e9 arch/x86/ia32/ia32_signal.c    Al Viro           2020-02-15  331  		unsafe_put_user(UC_FP_XSTATE, &frame->uc.uc_flags, Efault);
c37b5efea43f9e arch/x86/ia32/ia32_signal.c    Suresh Siddha     2008-07-29  332  	else
39f16c1c0f14e9 arch/x86/ia32/ia32_signal.c    Al Viro           2020-02-15  333  		unsafe_put_user(0, &frame->uc.uc_flags, Efault);
39f16c1c0f14e9 arch/x86/ia32/ia32_signal.c    Al Viro           2020-02-15  334  	unsafe_put_user(0, &frame->uc.uc_link, Efault);
39f16c1c0f14e9 arch/x86/ia32/ia32_signal.c    Al Viro           2020-02-15  335  	unsafe_compat_save_altstack(&frame->uc.uc_stack, regs->sp, Efault);
^1da177e4c3f41 arch/x86_64/ia32/ia32_signal.c Linus Torvalds    2005-04-16  336  
235b80226b986d arch/x86/ia32/ia32_signal.c    Al Viro           2012-11-09  337  	if (ksig->ka.sa.sa_flags & SA_RESTORER)
235b80226b986d arch/x86/ia32/ia32_signal.c    Al Viro           2012-11-09  338  		restorer = ksig->ka.sa.sa_restorer;
af65d64845a90c arch/x86/ia32/ia32_signal.c    Roland McGrath    2008-01-30  339  	else
6f121e548f8367 arch/x86/ia32/ia32_signal.c    Andy Lutomirski   2014-05-05  340  		restorer = current->mm->context.vdso +
0a6d1fa0d2b48f arch/x86/ia32/ia32_signal.c    Andy Lutomirski   2015-10-05  341  			vdso_image_32.sym___kernel_rt_sigreturn;
39f16c1c0f14e9 arch/x86/ia32/ia32_signal.c    Al Viro           2020-02-15  342  	unsafe_put_user(ptr_to_compat(restorer), &frame->pretcode, Efault);
^1da177e4c3f41 arch/x86_64/ia32/ia32_signal.c Linus Torvalds    2005-04-16  343  
99b9cdf758af70 arch/x86/ia32/ia32_signal.c    Thomas Gleixner   2008-01-30  344  	/*
99b9cdf758af70 arch/x86/ia32/ia32_signal.c    Thomas Gleixner   2008-01-30  345  	 * Not actually used anymore, but left because some gdb
99b9cdf758af70 arch/x86/ia32/ia32_signal.c    Thomas Gleixner   2008-01-30  346  	 * versions need it.
99b9cdf758af70 arch/x86/ia32/ia32_signal.c    Thomas Gleixner   2008-01-30  347  	 */
39f16c1c0f14e9 arch/x86/ia32/ia32_signal.c    Al Viro           2020-02-15  348  	unsafe_put_user(*((u64 *)&code), (u64 __user *)frame->retcode, Efault);
44a1d996325982 arch/x86/ia32/ia32_signal.c    Al Viro           2020-02-15  349  	unsafe_put_sigcontext32(&frame->uc.uc_mcontext, fp, regs, set, Efault);
57d563c8292569 arch/x86/ia32/ia32_signal.c    Al Viro           2020-02-15 @350  	unsafe_put_user(*(__u64 *)set, (__u64 *)&frame->uc.uc_sigmask, Efault);

---
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: 33774 bytes --]

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

end of thread, other threads:[~2020-07-01 18:36 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-06-28  7:20 [PATCH] sparse: use static inline for __chk_{user,io}_ptr() Luc Van Oostenryck
2020-06-29 17:12 ` kernel test robot
2020-06-29 18:08 ` kernel test robot
2020-06-29 18:37   ` Luc Van Oostenryck
2020-06-30  0:31     ` [kbuild-all] " Rong Chen
2020-07-01 18:35 ` kernel test robot

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®