[PATCH] gpu/drm: Use u64_to_user_pointer

kbuild test robot lkp at intel.com
Fri Mar 18 17:43:12 UTC 2016


Hi Joe,

[auto build test ERROR on drm/drm-next]
[also build test ERROR on next-20160318]
[cannot apply to v4.5]
[if your patch is applied to the wrong git tree, please drop us a note to help improving the system]

url:    https://github.com/0day-ci/linux/commits/Joe-Perches/gpu-drm-Use-u64_to_user_pointer/20160319-012749
base:   git://people.freedesktop.org/~airlied/linux.git drm-next
config: xtensa-allmodconfig (attached as .config)
reproduce:
        wget https://git.kernel.org/cgit/linux/kernel/git/wfg/lkp-tests.git/plain/sbin/make.cross -O ~/bin/make.cross
        chmod +x ~/bin/make.cross
        # save the attached .config to linux build tree
        make.cross ARCH=xtensa 

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

   drivers/gpu/drm/vc4/vc4_bo.c: In function 'vc4_create_shader_bo_ioctl':
>> drivers/gpu/drm/vc4/vc4_bo.c:502:2: error: implicit declaration of function 'u64_to_user_ptr' [-Werror=implicit-function-declaration]
     if (copy_from_user(bo->base.vaddr,
     ^
   In file included from include/linux/uaccess.h:5:0,
                    from include/linux/highmem.h:8,
                    from include/drm/drmP.h:40,
                    from drivers/gpu/drm/vc4/vc4_drv.h:9,
                    from drivers/gpu/drm/vc4/vc4_bo.c:21:
>> arch/xtensa/include/asm/uaccess.h:429:37: warning: passing argument 2 of '__generic_copy_from_user' makes pointer from integer without a cast
    #define copy_from_user(to, from, n) __generic_copy_from_user((to), (from), (n))
                                        ^
>> drivers/gpu/drm/vc4/vc4_bo.c:502:6: note: in expansion of macro 'copy_from_user'
     if (copy_from_user(bo->base.vaddr,
         ^
   arch/xtensa/include/asm/uaccess.h:418:1: note: expected 'const void *' but argument is of type 'int'
    __generic_copy_from_user(void *to, const void *from, unsigned long n)
    ^
   cc1: some warnings being treated as errors
--
   drivers/gpu/drm/vc4/vc4_gem.c: In function 'vc4_get_hang_state_ioctl':
>> drivers/gpu/drm/vc4/vc4_gem.c:123:2: error: implicit declaration of function 'u64_to_user_ptr' [-Werror=implicit-function-declaration]
     if (copy_to_user(u64_to_user_ptr(get_state->bo),
     ^
   In file included from include/linux/uaccess.h:5:0,
                    from include/linux/highmem.h:8,
                    from include/drm/drmP.h:40,
                    from drivers/gpu/drm/vc4/vc4_drv.h:9,
                    from drivers/gpu/drm/vc4/vc4_gem.c:31:
>> arch/xtensa/include/asm/uaccess.h:428:35: warning: passing argument 1 of '__generic_copy_to_user' makes pointer from integer without a cast
    #define copy_to_user(to, from, n) __generic_copy_to_user((to), (from), (n))
                                      ^
>> drivers/gpu/drm/vc4/vc4_gem.c:123:6: note: in expansion of macro 'copy_to_user'
     if (copy_to_user(u64_to_user_ptr(get_state->bo),
         ^
   arch/xtensa/include/asm/uaccess.h:409:1: note: expected 'void *' but argument is of type 'int'
    __generic_copy_to_user(void *to, const void *from, unsigned long n)
    ^
   drivers/gpu/drm/vc4/vc4_gem.c: In function 'vc4_cl_lookup_bos':
>> arch/xtensa/include/asm/uaccess.h:429:37: warning: passing argument 2 of '__generic_copy_from_user' makes pointer from integer without a cast
    #define copy_from_user(to, from, n) __generic_copy_from_user((to), (from), (n))
                                        ^
>> drivers/gpu/drm/vc4/vc4_gem.c:552:8: note: in expansion of macro 'copy_from_user'
     ret = copy_from_user(handles,
           ^
   arch/xtensa/include/asm/uaccess.h:418:1: note: expected 'const void *' but argument is of type 'int'
    __generic_copy_from_user(void *to, const void *from, unsigned long n)
    ^
   drivers/gpu/drm/vc4/vc4_gem.c: In function 'vc4_get_bcl':
>> arch/xtensa/include/asm/uaccess.h:429:37: warning: passing argument 2 of '__generic_copy_from_user' makes pointer from integer without a cast
    #define copy_from_user(to, from, n) __generic_copy_from_user((to), (from), (n))
                                        ^
   drivers/gpu/drm/vc4/vc4_gem.c:626:6: note: in expansion of macro 'copy_from_user'
     if (copy_from_user(bin,
         ^
   arch/xtensa/include/asm/uaccess.h:418:1: note: expected 'const void *' but argument is of type 'int'
    __generic_copy_from_user(void *to, const void *from, unsigned long n)
    ^
>> arch/xtensa/include/asm/uaccess.h:429:37: warning: passing argument 2 of '__generic_copy_from_user' makes pointer from integer without a cast
    #define copy_from_user(to, from, n) __generic_copy_from_user((to), (from), (n))
                                        ^
   drivers/gpu/drm/vc4/vc4_gem.c:633:6: note: in expansion of macro 'copy_from_user'
     if (copy_from_user(exec->shader_rec_u,
         ^
   arch/xtensa/include/asm/uaccess.h:418:1: note: expected 'const void *' but argument is of type 'int'
    __generic_copy_from_user(void *to, const void *from, unsigned long n)
    ^
>> arch/xtensa/include/asm/uaccess.h:429:37: warning: passing argument 2 of '__generic_copy_from_user' makes pointer from integer without a cast
    #define copy_from_user(to, from, n) __generic_copy_from_user((to), (from), (n))
                                        ^
   drivers/gpu/drm/vc4/vc4_gem.c:640:6: note: in expansion of macro 'copy_from_user'
     if (copy_from_user(exec->uniforms_u,
         ^
   arch/xtensa/include/asm/uaccess.h:418:1: note: expected 'const void *' but argument is of type 'int'
    __generic_copy_from_user(void *to, const void *from, unsigned long n)
    ^
   cc1: some warnings being treated as errors
--
   drivers/gpu/drm/virtio/virtgpu_ioctl.c: In function 'virtio_gpu_execbuffer':
>> drivers/gpu/drm/virtio/virtgpu_ioctl.c:126:3: error: implicit declaration of function 'u64_to_user_ptr' [-Werror=implicit-function-declaration]
      user_bo_handles = u64_to_user_ptr(exbuf->bo_handles);
      ^
>> drivers/gpu/drm/virtio/virtgpu_ioctl.c:126:19: warning: assignment makes pointer from integer without a cast
      user_bo_handles = u64_to_user_ptr(exbuf->bo_handles);
                      ^
   In file included from include/linux/uaccess.h:5:0,
                    from include/linux/highmem.h:8,
                    from include/drm/drmP.h:40,
                    from drivers/gpu/drm/virtio/virtgpu_ioctl.c:28:
>> arch/xtensa/include/asm/uaccess.h:429:37: warning: passing argument 2 of '__generic_copy_from_user' makes pointer from integer without a cast
    #define copy_from_user(to, from, n) __generic_copy_from_user((to), (from), (n))
                                        ^
>> drivers/gpu/drm/virtio/virtgpu_ioctl.c:161:6: note: in expansion of macro 'copy_from_user'
     if (copy_from_user(buf, u64_to_user_ptr(exbuf->command), exbuf->size)) {
         ^
   arch/xtensa/include/asm/uaccess.h:418:1: note: expected 'const void *' but argument is of type 'int'
    __generic_copy_from_user(void *to, const void *from, unsigned long n)
    ^
   cc1: some warnings being treated as errors

vim +/u64_to_user_ptr +502 drivers/gpu/drm/vc4/vc4_bo.c

463873d5 Eric Anholt   2015-11-30  496  	}
463873d5 Eric Anholt   2015-11-30  497  
463873d5 Eric Anholt   2015-11-30  498  	bo = vc4_bo_create(dev, args->size, true);
2c68f1fc Eric Anholt   2016-01-25  499  	if (IS_ERR(bo))
2c68f1fc Eric Anholt   2016-01-25  500  		return PTR_ERR(bo);
463873d5 Eric Anholt   2015-11-30  501  
585cb132 Dan Carpenter 2016-03-08 @502  	if (copy_from_user(bo->base.vaddr,
3f3044e5 Joe Perches   2016-03-18  503  			   u64_to_user_ptr(args->data),
585cb132 Dan Carpenter 2016-03-08  504  			   args->size)) {
585cb132 Dan Carpenter 2016-03-08  505  		ret = -EFAULT;

:::::: The code at line 502 was first introduced by commit
:::::: 585cb132a48190b554aecda2ebc3e2911fcbb665 drm/vc4: Return -EFAULT on copy_from_user() failure

:::::: TO: Dan Carpenter <dan.carpenter at oracle.com>
:::::: CC: Eric Anholt <eric at anholt.net>

---
0-DAY kernel test infrastructure                Open Source Technology Center
https://lists.01.org/pipermail/kbuild-all                   Intel Corporation
-------------- next part --------------
A non-text attachment was scrubbed...
Name: .config.gz
Type: application/octet-stream
Size: 43845 bytes
Desc: not available
URL: <https://lists.freedesktop.org/archives/dri-devel/attachments/20160319/7bae00c5/attachment-0001.obj>


More information about the dri-devel mailing list