linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [axboe-block:nvme-passthru-wip 10/19] drivers/nvme/host/ioctl.c:47:19: error: cast to pointer from integer of different size
@ 2021-10-07 20:50 kernel test robot
  2021-10-08  8:19 ` Geert Uytterhoeven
  0 siblings, 1 reply; 4+ messages in thread
From: kernel test robot @ 2021-10-07 20:50 UTC (permalink / raw)
  To: Kanchan Joshi; +Cc: kbuild-all, linux-kernel, Jens Axboe, Anuj Gupta

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

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/axboe/linux-block.git nvme-passthru-wip
head:   9c18980ac90053bcdb21594eae48935d89bf389c
commit: 5cc445dd8df6e06f3482711aa590170450364393 [10/19] nvme: wire-up support for async-passthru on char-device.
config: m68k-allmodconfig (attached as .config)
compiler: m68k-linux-gcc (GCC) 11.2.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/axboe/linux-block.git/commit/?id=5cc445dd8df6e06f3482711aa590170450364393
        git remote add axboe-block https://git.kernel.org/pub/scm/linux/kernel/git/axboe/linux-block.git
        git fetch --no-tags axboe-block nvme-passthru-wip
        git checkout 5cc445dd8df6e06f3482711aa590170450364393
        # save the attached .config to linux build tree
        COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-11.2.0 make.cross ARCH=m68k 

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 >>):

   drivers/nvme/host/ioctl.c: In function 'nvme_pt_task_cb':
>> drivers/nvme/host/ioctl.c:47:19: error: cast to pointer from integer of different size [-Werror=int-to-pointer-cast]
      47 |         ptcmd64 = (void __user *) bcmd->unused2[0];
         |                   ^
   drivers/nvme/host/ioctl.c:62:58: error: cast to pointer from integer of different size [-Werror=int-to-pointer-cast]
      62 |                 struct nvme_passthru_cmd __user *ptcmd = (void *)bcmd->unused2[0];
         |                                                          ^
   drivers/nvme/host/ioctl.c: In function 'nvme_ns_async_ioctl':
   drivers/nvme/host/ioctl.c:472:29: error: cast to pointer from integer of different size [-Werror=int-to-pointer-cast]
     472 |         void __user *argp = (void __user *) bcmd->unused2[0];
         |                             ^
   cc1: all warnings being treated as errors


vim +47 drivers/nvme/host/ioctl.c

    39	
    40	static void nvme_pt_task_cb(struct io_uring_cmd *ioucmd)
    41	{
    42		struct uring_cmd_data *ucd;
    43		struct nvme_passthru_cmd64 __user *ptcmd64 = NULL;
    44		struct block_uring_cmd *bcmd;
    45	
    46		bcmd = (struct block_uring_cmd *) &ioucmd->pdu;
  > 47		ptcmd64 = (void __user *) bcmd->unused2[0];
    48		ucd = (struct uring_cmd_data *) nvme_ioucmd_data_addr(ioucmd);
    49	
    50		if (ucd->meta) {
    51			void __user *umeta = nvme_to_user_ptr(ptcmd64->metadata);
    52	
    53			if (!ucd->status)
    54				if (copy_to_user(umeta, ucd->meta, ptcmd64->metadata_len))
    55					ucd->status = -EFAULT;
    56			kfree(ucd->meta);
    57		}
    58		if (likely(bcmd->ioctl_cmd == NVME_IOCTL_IO64_CMD)) {
    59			if (put_user(ucd->result, &ptcmd64->result))
    60				ucd->status = -EFAULT;
    61		} else {
    62			struct nvme_passthru_cmd __user *ptcmd = (void *)bcmd->unused2[0];
    63	
    64			if (put_user(ucd->result, &ptcmd->result))
    65				ucd->status = -EFAULT;
    66		}
    67		io_uring_cmd_done(ioucmd, ucd->status);
    68	}
    69	

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

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

* Re: [axboe-block:nvme-passthru-wip 10/19] drivers/nvme/host/ioctl.c:47:19: error: cast to pointer from integer of different size
  2021-10-07 20:50 [axboe-block:nvme-passthru-wip 10/19] drivers/nvme/host/ioctl.c:47:19: error: cast to pointer from integer of different size kernel test robot
@ 2021-10-08  8:19 ` Geert Uytterhoeven
  2021-10-08 12:35   ` Jens Axboe
  0 siblings, 1 reply; 4+ messages in thread
From: Geert Uytterhoeven @ 2021-10-08  8:19 UTC (permalink / raw)
  To: kernel test robot
  Cc: Kanchan Joshi, kbuild-all, Linux Kernel Mailing List, Jens Axboe,
	Anuj Gupta

On Fri, Oct 8, 2021 at 12:12 AM kernel test robot <lkp@intel.com> wrote:
> tree:   https://git.kernel.org/pub/scm/linux/kernel/git/axboe/linux-block.git nvme-passthru-wip
> head:   9c18980ac90053bcdb21594eae48935d89bf389c
> commit: 5cc445dd8df6e06f3482711aa590170450364393 [10/19] nvme: wire-up support for async-passthru on char-device.
> config: m68k-allmodconfig (attached as .config)
> compiler: m68k-linux-gcc (GCC) 11.2.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/axboe/linux-block.git/commit/?id=5cc445dd8df6e06f3482711aa590170450364393
>         git remote add axboe-block https://git.kernel.org/pub/scm/linux/kernel/git/axboe/linux-block.git
>         git fetch --no-tags axboe-block nvme-passthru-wip
>         git checkout 5cc445dd8df6e06f3482711aa590170450364393
>         # save the attached .config to linux build tree
>         COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-11.2.0 make.cross ARCH=m68k
>
> 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 >>):
>
>    drivers/nvme/host/ioctl.c: In function 'nvme_pt_task_cb':
> >> drivers/nvme/host/ioctl.c:47:19: error: cast to pointer from integer of different size [-Werror=int-to-pointer-cast]
>       47 |         ptcmd64 = (void __user *) bcmd->unused2[0];
>          |                   ^
>    drivers/nvme/host/ioctl.c:62:58: error: cast to pointer from integer of different size [-Werror=int-to-pointer-cast]
>       62 |                 struct nvme_passthru_cmd __user *ptcmd = (void *)bcmd->unused2[0];
>          |                                                          ^
>    drivers/nvme/host/ioctl.c: In function 'nvme_ns_async_ioctl':
>    drivers/nvme/host/ioctl.c:472:29: error: cast to pointer from integer of different size [-Werror=int-to-pointer-cast]
>      472 |         void __user *argp = (void __user *) bcmd->unused2[0];
>          |                             ^
>    cc1: all warnings being treated as errors
>
>
> vim +47 drivers/nvme/host/ioctl.c
>
>     39
>     40  static void nvme_pt_task_cb(struct io_uring_cmd *ioucmd)
>     41  {
>     42          struct uring_cmd_data *ucd;
>     43          struct nvme_passthru_cmd64 __user *ptcmd64 = NULL;
>     44          struct block_uring_cmd *bcmd;
>     45
>     46          bcmd = (struct block_uring_cmd *) &ioucmd->pdu;
>   > 47          ptcmd64 = (void __user *) bcmd->unused2[0];

Casts from u64 to a pointer on 32-bit need an intermediate cast to uintptr_t:

    ptcmd64 = (void __user *)(uintptr_t)bcmd->unused2[0];

Note that you can improve on the naming, as people may be surprised
discovering "unused2" is actually used ;-)

>     48          ucd = (struct uring_cmd_data *) nvme_ioucmd_data_addr(ioucmd);
>     49
>     50          if (ucd->meta) {
>     51                  void __user *umeta = nvme_to_user_ptr(ptcmd64->metadata);
>     52
>     53                  if (!ucd->status)
>     54                          if (copy_to_user(umeta, ucd->meta, ptcmd64->metadata_len))
>     55                                  ucd->status = -EFAULT;
>     56                  kfree(ucd->meta);
>     57          }
>     58          if (likely(bcmd->ioctl_cmd == NVME_IOCTL_IO64_CMD)) {
>     59                  if (put_user(ucd->result, &ptcmd64->result))
>     60                          ucd->status = -EFAULT;
>     61          } else {
>     62                  struct nvme_passthru_cmd __user *ptcmd = (void *)bcmd->unused2[0];
>     63
>     64                  if (put_user(ucd->result, &ptcmd->result))
>     65                          ucd->status = -EFAULT;
>     66          }
>     67          io_uring_cmd_done(ioucmd, ucd->status);
>     68  }
>     69
>
> ---
> 0-DAY CI Kernel Test Service, Intel Corporation
> https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org



-- 
Gr{oetje,eeting}s,

                        Geert

-- 
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
                                -- Linus Torvalds

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

* Re: [axboe-block:nvme-passthru-wip 10/19] drivers/nvme/host/ioctl.c:47:19: error: cast to pointer from integer of different size
  2021-10-08  8:19 ` Geert Uytterhoeven
@ 2021-10-08 12:35   ` Jens Axboe
  2021-10-13  5:24     ` [kbuild-all] " Chen, Rong A
  0 siblings, 1 reply; 4+ messages in thread
From: Jens Axboe @ 2021-10-08 12:35 UTC (permalink / raw)
  To: Geert Uytterhoeven, kernel test robot
  Cc: Kanchan Joshi, kbuild-all, Linux Kernel Mailing List, Anuj Gupta

On 10/8/21 2:19 AM, Geert Uytterhoeven wrote:
> On Fri, Oct 8, 2021 at 12:12 AM kernel test robot <lkp@intel.com> wrote:
>> tree:   https://git.kernel.org/pub/scm/linux/kernel/git/axboe/linux-block.git nvme-passthru-wip
>> head:   9c18980ac90053bcdb21594eae48935d89bf389c
>> commit: 5cc445dd8df6e06f3482711aa590170450364393 [10/19] nvme: wire-up support for async-passthru on char-device.
>> config: m68k-allmodconfig (attached as .config)
>> compiler: m68k-linux-gcc (GCC) 11.2.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/axboe/linux-block.git/commit/?id=5cc445dd8df6e06f3482711aa590170450364393
>>         git remote add axboe-block https://git.kernel.org/pub/scm/linux/kernel/git/axboe/linux-block.git
>>         git fetch --no-tags axboe-block nvme-passthru-wip
>>         git checkout 5cc445dd8df6e06f3482711aa590170450364393
>>         # save the attached .config to linux build tree
>>         COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-11.2.0 make.cross ARCH=m68k
>>
>> 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 >>):
>>
>>    drivers/nvme/host/ioctl.c: In function 'nvme_pt_task_cb':
>>>> drivers/nvme/host/ioctl.c:47:19: error: cast to pointer from integer of different size [-Werror=int-to-pointer-cast]
>>       47 |         ptcmd64 = (void __user *) bcmd->unused2[0];
>>          |                   ^
>>    drivers/nvme/host/ioctl.c:62:58: error: cast to pointer from integer of different size [-Werror=int-to-pointer-cast]
>>       62 |                 struct nvme_passthru_cmd __user *ptcmd = (void *)bcmd->unused2[0];
>>          |                                                          ^
>>    drivers/nvme/host/ioctl.c: In function 'nvme_ns_async_ioctl':
>>    drivers/nvme/host/ioctl.c:472:29: error: cast to pointer from integer of different size [-Werror=int-to-pointer-cast]
>>      472 |         void __user *argp = (void __user *) bcmd->unused2[0];
>>          |                             ^
>>    cc1: all warnings being treated as errors
>>
>>
>> vim +47 drivers/nvme/host/ioctl.c
>>
>>     39
>>     40  static void nvme_pt_task_cb(struct io_uring_cmd *ioucmd)
>>     41  {
>>     42          struct uring_cmd_data *ucd;
>>     43          struct nvme_passthru_cmd64 __user *ptcmd64 = NULL;
>>     44          struct block_uring_cmd *bcmd;
>>     45
>>     46          bcmd = (struct block_uring_cmd *) &ioucmd->pdu;
>>   > 47          ptcmd64 = (void __user *) bcmd->unused2[0];
> 
> Casts from u64 to a pointer on 32-bit need an intermediate cast to uintptr_t:
> 
>     ptcmd64 = (void __user *)(uintptr_t)bcmd->unused2[0];
> 
> Note that you can improve on the naming, as people may be surprised
> discovering "unused2" is actually used ;-)

There's a reason the branch is called -wip, it's just a hodge podge of
stuff. Not sure why the kernel test robot bothers reporting failures
publicly for that...

-- 
Jens Axboe


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

* Re: [kbuild-all] Re: [axboe-block:nvme-passthru-wip 10/19] drivers/nvme/host/ioctl.c:47:19: error: cast to pointer from integer of different size
  2021-10-08 12:35   ` Jens Axboe
@ 2021-10-13  5:24     ` Chen, Rong A
  0 siblings, 0 replies; 4+ messages in thread
From: Chen, Rong A @ 2021-10-13  5:24 UTC (permalink / raw)
  To: Jens Axboe, Geert Uytterhoeven, kernel test robot
  Cc: Kanchan Joshi, kbuild-all, Linux Kernel Mailing List, Anuj Gupta



On 10/8/2021 8:35 PM, Jens Axboe wrote:
> On 10/8/21 2:19 AM, Geert Uytterhoeven wrote:
>> On Fri, Oct 8, 2021 at 12:12 AM kernel test robot <lkp@intel.com> wrote:
>>> tree:   https://git.kernel.org/pub/scm/linux/kernel/git/axboe/linux-block.git nvme-passthru-wip
>>> head:   9c18980ac90053bcdb21594eae48935d89bf389c
>>> commit: 5cc445dd8df6e06f3482711aa590170450364393 [10/19] nvme: wire-up support for async-passthru on char-device.
>>> config: m68k-allmodconfig (attached as .config)
>>> compiler: m68k-linux-gcc (GCC) 11.2.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/axboe/linux-block.git/commit/?id=5cc445dd8df6e06f3482711aa590170450364393
>>>          git remote add axboe-block https://git.kernel.org/pub/scm/linux/kernel/git/axboe/linux-block.git
>>>          git fetch --no-tags axboe-block nvme-passthru-wip
>>>          git checkout 5cc445dd8df6e06f3482711aa590170450364393
>>>          # save the attached .config to linux build tree
>>>          COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-11.2.0 make.cross ARCH=m68k
>>>
>>> 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 >>):
>>>
>>>     drivers/nvme/host/ioctl.c: In function 'nvme_pt_task_cb':
>>>>> drivers/nvme/host/ioctl.c:47:19: error: cast to pointer from integer of different size [-Werror=int-to-pointer-cast]
>>>        47 |         ptcmd64 = (void __user *) bcmd->unused2[0];
>>>           |                   ^
>>>     drivers/nvme/host/ioctl.c:62:58: error: cast to pointer from integer of different size [-Werror=int-to-pointer-cast]
>>>        62 |                 struct nvme_passthru_cmd __user *ptcmd = (void *)bcmd->unused2[0];
>>>           |                                                          ^
>>>     drivers/nvme/host/ioctl.c: In function 'nvme_ns_async_ioctl':
>>>     drivers/nvme/host/ioctl.c:472:29: error: cast to pointer from integer of different size [-Werror=int-to-pointer-cast]
>>>       472 |         void __user *argp = (void __user *) bcmd->unused2[0];
>>>           |                             ^
>>>     cc1: all warnings being treated as errors
>>>
>>>
>>> vim +47 drivers/nvme/host/ioctl.c
>>>
>>>      39
>>>      40  static void nvme_pt_task_cb(struct io_uring_cmd *ioucmd)
>>>      41  {
>>>      42          struct uring_cmd_data *ucd;
>>>      43          struct nvme_passthru_cmd64 __user *ptcmd64 = NULL;
>>>      44          struct block_uring_cmd *bcmd;
>>>      45
>>>      46          bcmd = (struct block_uring_cmd *) &ioucmd->pdu;
>>>    > 47          ptcmd64 = (void __user *) bcmd->unused2[0];
>>
>> Casts from u64 to a pointer on 32-bit need an intermediate cast to uintptr_t:
>>
>>      ptcmd64 = (void __user *)(uintptr_t)bcmd->unused2[0];
>>
>> Note that you can improve on the naming, as people may be surprised
>> discovering "unused2" is actually used ;-)
> 
> There's a reason the branch is called -wip, it's just a hodge podge of
> stuff. Not sure why the kernel test robot bothers reporting failures
> publicly for that...
> 

Hi Jens,

We have changed the rule to not report the wip branches to public:

https://github.com/intel/lkp-tests/commit/f5f8d52830e342d51a200d5688b931faa0b786ea

Best Regards,
Rong Chen

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

end of thread, other threads:[~2021-10-13  5:24 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-10-07 20:50 [axboe-block:nvme-passthru-wip 10/19] drivers/nvme/host/ioctl.c:47:19: error: cast to pointer from integer of different size kernel test robot
2021-10-08  8:19 ` Geert Uytterhoeven
2021-10-08 12:35   ` Jens Axboe
2021-10-13  5:24     ` [kbuild-all] " Chen, Rong A

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).