Received: by 2002:a05:6a10:d5a5:0:0:0:0 with SMTP id gn37csp2135767pxb; Fri, 8 Oct 2021 01:21:33 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwmcqmZEyGz2dFx4gDskw/0UpZM25oPgcazIW1xymH07sAWUDjaR8NddnkSuwR1cNnSTOKs X-Received: by 2002:a17:902:ba8e:b0:13e:c690:5acb with SMTP id k14-20020a170902ba8e00b0013ec6905acbmr8405445pls.63.1633681292966; Fri, 08 Oct 2021 01:21:32 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1633681292; cv=none; d=google.com; s=arc-20160816; b=Orcq2p3cLZ8ppn3JomVid3sK6iXgJonC53T4meXfOI/F1Nv288Q380a2EQgQ4IbT2l S7VKARZ2g9aayEezHgApi44CLN6shwHa7CYzW0WejDr4bMAbvoCIZFS2k72GK+dG/eMl A3xxXF4KkY8b3kRYvY8WBTCmEik6/9N6QmWbjcOTMfXq5BN7fj8Wm8Mt/y0n1ktf42V3 px/M8cGfumwOXQ7yJcYzH6fZI5uqkZrLfbXkR/2tGG7AUr/bY+xd3qtYnqCxgJ8bYn1Y L+e+TNU9yqdgLnm9FtP0LVYpjJIxIn7w5lpxhCvGAIlTevMCAZb0LiuQNr2H+75ARlgh U2Fg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version; bh=gg7lBTIPit3lUNNJVWOU9jnb+0tJG1WIFFCc1E/oFJ4=; b=BOA6yxyGMCueFeXqgGXrA/f7oTopKDk2jas9WvKnSWD+iZjHOHAaNPkh4E+s1kgPP3 UUmcn1huIFsOn4ZE5wWKBV6Kw8fxSY0aMmhc0HojkTjOxv7pAIBA18bmTpXJEK6tVES+ wAFmj/U8D/EyQ05qhxBh7wH4ZmKbTh9aSYOfUfd+yMaRIgt454g0D00cIj7YuV7Gt7VB a/6moNqHVYxo8fGAFXaK8HuXQkK+nmfB1MDFQ+y5DBN+0ucP31x7MpS14mXHh5SbyBM5 Yh+lDG6sGRKXN4Hy0ozTpIkcbsydXUBbpY3vT/Jp781f/DV1XOhvNQ/8+vOrMamnexRo zvRw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id z15si2435825pgu.52.2021.10.08.01.21.18; Fri, 08 Oct 2021 01:21:32 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233610AbhJHIVV (ORCPT + 99 others); Fri, 8 Oct 2021 04:21:21 -0400 Received: from mail-vs1-f49.google.com ([209.85.217.49]:39906 "EHLO mail-vs1-f49.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233595AbhJHIVH (ORCPT ); Fri, 8 Oct 2021 04:21:07 -0400 Received: by mail-vs1-f49.google.com with SMTP id o124so9657108vsc.6 for ; Fri, 08 Oct 2021 01:19:12 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=gg7lBTIPit3lUNNJVWOU9jnb+0tJG1WIFFCc1E/oFJ4=; b=ztljTJMo239shqhDlpLvNhsQWBCFqrEbaZoIGCfkFmR4EfbPYIntEPYeSZ+sBH4w0Z mJ93swCyb5LXKdWrEauHXM2AVsxU0Hb/3/BI3XewLU3wbh6C0PIWSbTDsccRAr8fWAqo S5/JYsOHhKP3hXbsVM5pLKTL4sh2mkvMwMgdjR+7keEWeCTmfDssCwzG7i6J1s2T1dc+ ILkUzOStTsvBCyYdgiHtXQCdiz0jlfOoiNtchSDzO62sEKKlgcPj+qPWbIb0lpok159R m11RfAP6cChgkaQyic43tQBBLxeq5VO42MSqsC9B8jOZ/7jlJ6gsuFAv8NDTh8EQZgeU o/mA== X-Gm-Message-State: AOAM533mmpy/f0oEVA8iIwTyxFpGzeuXHtGtNzILBGPBcbRmqKJOWToR W5OdqGMkM7ZUQ7hmaVPxOZe3qBrtzkX6BXx4TDRLBM7lLws= X-Received: by 2002:a67:ac04:: with SMTP id v4mr9270948vse.50.1633681152262; Fri, 08 Oct 2021 01:19:12 -0700 (PDT) MIME-Version: 1.0 References: <202110080434.YH6r4WZv-lkp@intel.com> In-Reply-To: <202110080434.YH6r4WZv-lkp@intel.com> From: Geert Uytterhoeven Date: Fri, 8 Oct 2021 10:19:00 +0200 Message-ID: Subject: Re: [axboe-block:nvme-passthru-wip 10/19] drivers/nvme/host/ioctl.c:47:19: error: cast to pointer from integer of different size To: kernel test robot Cc: Kanchan Joshi , kbuild-all@lists.01.org, Linux Kernel Mailing List , Jens Axboe , Anuj Gupta Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Oct 8, 2021 at 12:12 AM kernel test robot 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 > > 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