From: kernel test robot <lkp@intel.com>
To: kbuild-all@lists.01.org
Subject: arch/sh/kernel/crash_dump.c:37:61: sparse: sparse: incorrect type in argument 2 (different address spaces)
Date: Thu, 02 Dec 2021 17:24:04 +0800 [thread overview]
Message-ID: <202112021718.p7G5HuSW-lkp@intel.com> (raw)
[-- Attachment #1: Type: text/plain, Size: 3500 bytes --]
tree: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head: 58e1100fdc5990b0cc0d4beaf2562a92e621ac7d
commit: 12285ff8667bf06c168113c10d3619834e423ae6 sh: kdump: add some attribute to function
date: 3 months ago
config: sh-randconfig-s032-20211202 (https://download.01.org/0day-ci/archive/20211202/202112021718.p7G5HuSW-lkp(a)intel.com/config)
compiler: sh4-linux-gcc (GCC) 11.2.0
reproduce:
wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
chmod +x ~/bin/make.cross
# apt-get install sparse
# sparse version: v0.6.4-dirty
# https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=12285ff8667bf06c168113c10d3619834e423ae6
git remote add linus https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
git fetch --no-tags linus master
git checkout 12285ff8667bf06c168113c10d3619834e423ae6
# save the config file to linux build tree
mkdir build_dir
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-11.2.0 make.cross C=1 CF='-fdiagnostic-prefix -D__CHECK_ENDIAN__' O=build_dir ARCH=sh SHELL=/bin/bash arch/sh/kernel/ fs/proc/
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/sh/kernel/crash_dump.c:37:61: sparse: sparse: incorrect type in argument 2 (different address spaces) @@ expected void const *from @@ got void [noderef] __iomem * @@
arch/sh/kernel/crash_dump.c:37:61: sparse: expected void const *from
arch/sh/kernel/crash_dump.c:37:61: sparse: got void [noderef] __iomem *
>> arch/sh/kernel/crash_dump.c:42:28: sparse: sparse: incorrect type in argument 2 (different address spaces) @@ expected void const *__from @@ got void [noderef] __iomem * @@
arch/sh/kernel/crash_dump.c:42:28: sparse: expected void const *__from
arch/sh/kernel/crash_dump.c:42:28: sparse: got void [noderef] __iomem *
vim +37 arch/sh/kernel/crash_dump.c
12
13 /**
14 * copy_oldmem_page - copy one page from "oldmem"
15 * @pfn: page frame number to be copied
16 * @buf: target memory address for the copy; this can be in kernel address
17 * space or user address space (see @userbuf)
18 * @csize: number of bytes to copy
19 * @offset: offset in bytes into the page (based on pfn) to begin the copy
20 * @userbuf: if set, @buf is in user address space, use copy_to_user(),
21 * otherwise @buf is in kernel address space, use memcpy().
22 *
23 * Copy a page from "oldmem". For this page, there is no pte mapped
24 * in the current kernel. We stitch up a pte, similar to kmap_atomic.
25 */
26 ssize_t copy_oldmem_page(unsigned long pfn, char *buf,
27 size_t csize, unsigned long offset, int userbuf)
28 {
29 void __iomem *vaddr;
30
31 if (!csize)
32 return 0;
33
34 vaddr = ioremap(pfn << PAGE_SHIFT, PAGE_SIZE);
35
36 if (userbuf) {
> 37 if (copy_to_user((void __user *)buf, (vaddr + offset), csize)) {
38 iounmap(vaddr);
39 return -EFAULT;
40 }
41 } else
> 42 memcpy(buf, (vaddr + offset), csize);
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all(a)lists.01.org
WARNING: multiple messages have this Message-ID (diff)
From: kernel test robot <lkp@intel.com>
To: Yejune Deng <yejune.deng@gmail.com>
Cc: kbuild-all@lists.01.org, linux-kernel@vger.kernel.org,
Rich Felker <dalias@libc.org>
Subject: arch/sh/kernel/crash_dump.c:37:61: sparse: sparse: incorrect type in argument 2 (different address spaces)
Date: Thu, 2 Dec 2021 17:24:04 +0800 [thread overview]
Message-ID: <202112021718.p7G5HuSW-lkp@intel.com> (raw)
tree: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head: 58e1100fdc5990b0cc0d4beaf2562a92e621ac7d
commit: 12285ff8667bf06c168113c10d3619834e423ae6 sh: kdump: add some attribute to function
date: 3 months ago
config: sh-randconfig-s032-20211202 (https://download.01.org/0day-ci/archive/20211202/202112021718.p7G5HuSW-lkp@intel.com/config)
compiler: sh4-linux-gcc (GCC) 11.2.0
reproduce:
wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
chmod +x ~/bin/make.cross
# apt-get install sparse
# sparse version: v0.6.4-dirty
# https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=12285ff8667bf06c168113c10d3619834e423ae6
git remote add linus https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
git fetch --no-tags linus master
git checkout 12285ff8667bf06c168113c10d3619834e423ae6
# save the config file to linux build tree
mkdir build_dir
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-11.2.0 make.cross C=1 CF='-fdiagnostic-prefix -D__CHECK_ENDIAN__' O=build_dir ARCH=sh SHELL=/bin/bash arch/sh/kernel/ fs/proc/
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/sh/kernel/crash_dump.c:37:61: sparse: sparse: incorrect type in argument 2 (different address spaces) @@ expected void const *from @@ got void [noderef] __iomem * @@
arch/sh/kernel/crash_dump.c:37:61: sparse: expected void const *from
arch/sh/kernel/crash_dump.c:37:61: sparse: got void [noderef] __iomem *
>> arch/sh/kernel/crash_dump.c:42:28: sparse: sparse: incorrect type in argument 2 (different address spaces) @@ expected void const *__from @@ got void [noderef] __iomem * @@
arch/sh/kernel/crash_dump.c:42:28: sparse: expected void const *__from
arch/sh/kernel/crash_dump.c:42:28: sparse: got void [noderef] __iomem *
vim +37 arch/sh/kernel/crash_dump.c
12
13 /**
14 * copy_oldmem_page - copy one page from "oldmem"
15 * @pfn: page frame number to be copied
16 * @buf: target memory address for the copy; this can be in kernel address
17 * space or user address space (see @userbuf)
18 * @csize: number of bytes to copy
19 * @offset: offset in bytes into the page (based on pfn) to begin the copy
20 * @userbuf: if set, @buf is in user address space, use copy_to_user(),
21 * otherwise @buf is in kernel address space, use memcpy().
22 *
23 * Copy a page from "oldmem". For this page, there is no pte mapped
24 * in the current kernel. We stitch up a pte, similar to kmap_atomic.
25 */
26 ssize_t copy_oldmem_page(unsigned long pfn, char *buf,
27 size_t csize, unsigned long offset, int userbuf)
28 {
29 void __iomem *vaddr;
30
31 if (!csize)
32 return 0;
33
34 vaddr = ioremap(pfn << PAGE_SHIFT, PAGE_SIZE);
35
36 if (userbuf) {
> 37 if (copy_to_user((void __user *)buf, (vaddr + offset), csize)) {
38 iounmap(vaddr);
39 return -EFAULT;
40 }
41 } else
> 42 memcpy(buf, (vaddr + offset), csize);
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
next reply other threads:[~2021-12-02 9:24 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-12-02 9:24 kernel test robot [this message]
2021-12-02 9:24 ` arch/sh/kernel/crash_dump.c:37:61: sparse: sparse: incorrect type in argument 2 (different address spaces) kernel test robot
-- strict thread matches above, loose matches on Subject: below --
2022-02-17 8:19 kernel test robot
2022-02-17 8:19 ` kernel test robot
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=202112021718.p7G5HuSW-lkp@intel.com \
--to=lkp@intel.com \
--cc=kbuild-all@lists.01.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.