[arnd-playground:set_fs 6/11] lib/test_lockup.c:420:13: sparse: sparse: incorrect type in argument 1 (different address spaces)
by kernel test robot
tree: https://git.kernel.org/pub/scm/linux/kernel/git/arnd/playground.git set_fs
head: 0a081326831928b0d739bce68b8c0f9138b9c8ba
commit: a954036380ae20dbfa0c203bf6cafb21d1f3cedd [6/11] uaccess: generalize access_ok()
config: i386-randconfig-s002 (https://download.01.org/0day-ci/archive/20220213/202202131523.w4Vvi8jc-lk...)
compiler: gcc-9 (Debian 9.3.0-22) 9.3.0
reproduce:
# apt-get install sparse
# sparse version: v0.6.4-dirty
# https://git.kernel.org/pub/scm/linux/kernel/git/arnd/playground.git/commi...
git remote add arnd-playground https://git.kernel.org/pub/scm/linux/kernel/git/arnd/playground.git
git fetch --no-tags arnd-playground set_fs
git checkout a954036380ae20dbfa0c203bf6cafb21d1f3cedd
# save the config file to linux build tree
mkdir build_dir
make W=1 C=1 CF='-fdiagnostic-prefix -D__CHECK_ENDIAN__' O=build_dir ARCH=i386 SHELL=/bin/bash
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp(a)intel.com>
sparse warnings: (new ones prefixed by >>)
>> lib/test_lockup.c:420:13: sparse: sparse: incorrect type in argument 1 (different address spaces) @@ expected void const [noderef] __user *ptr @@ got void *ptr @@
lib/test_lockup.c:420:13: sparse: expected void const [noderef] __user *ptr
lib/test_lockup.c:420:13: sparse: got void *ptr
>> lib/test_lockup.c:421:13: sparse: sparse: incorrect type in argument 1 (different address spaces) @@ expected void const [noderef] __user *ptr @@ got void * @@
lib/test_lockup.c:421:13: sparse: expected void const [noderef] __user *ptr
lib/test_lockup.c:421:13: sparse: got void *
lib/test_lockup.c:230:9: sparse: sparse: context imbalance in 'test_lock' - wrong count at exit
lib/test_lockup.c:250:25: sparse: sparse: context imbalance in 'test_unlock' - unexpected unlock
vim +420 lib/test_lockup.c
30428ef5d1e8ca Konstantin Khlebnikov 2020-04-06 410
30428ef5d1e8ca Konstantin Khlebnikov 2020-04-06 411 static bool test_kernel_ptr(unsigned long addr, int size)
30428ef5d1e8ca Konstantin Khlebnikov 2020-04-06 412 {
30428ef5d1e8ca Konstantin Khlebnikov 2020-04-06 413 void *ptr = (void *)addr;
30428ef5d1e8ca Konstantin Khlebnikov 2020-04-06 414 char buf;
30428ef5d1e8ca Konstantin Khlebnikov 2020-04-06 415
30428ef5d1e8ca Konstantin Khlebnikov 2020-04-06 416 if (!addr)
30428ef5d1e8ca Konstantin Khlebnikov 2020-04-06 417 return false;
30428ef5d1e8ca Konstantin Khlebnikov 2020-04-06 418
30428ef5d1e8ca Konstantin Khlebnikov 2020-04-06 419 /* should be at least readable kernel address */
30428ef5d1e8ca Konstantin Khlebnikov 2020-04-06 @420 if (access_ok(ptr, 1) ||
30428ef5d1e8ca Konstantin Khlebnikov 2020-04-06 @421 access_ok(ptr + size - 1, 1) ||
25f12ae45fc193 Christoph Hellwig 2020-06-17 422 get_kernel_nofault(buf, ptr) ||
25f12ae45fc193 Christoph Hellwig 2020-06-17 423 get_kernel_nofault(buf, ptr + size - 1)) {
30428ef5d1e8ca Konstantin Khlebnikov 2020-04-06 424 pr_err("invalid kernel ptr: %#lx\n", addr);
30428ef5d1e8ca Konstantin Khlebnikov 2020-04-06 425 return true;
30428ef5d1e8ca Konstantin Khlebnikov 2020-04-06 426 }
30428ef5d1e8ca Konstantin Khlebnikov 2020-04-06 427
30428ef5d1e8ca Konstantin Khlebnikov 2020-04-06 428 return false;
30428ef5d1e8ca Konstantin Khlebnikov 2020-04-06 429 }
30428ef5d1e8ca Konstantin Khlebnikov 2020-04-06 430
:::::: The code at line 420 was first introduced by commit
:::::: 30428ef5d1e8caf78639cc70a802f1cb7b1cec04 lib/test_lockup: test module to generate lockups
:::::: TO: Konstantin Khlebnikov <khlebnikov(a)yandex-team.ru>
:::::: CC: Linus Torvalds <torvalds(a)linux-foundation.org>
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
7 months, 1 week
[sashal-stable:pending-5.15 125/134] net/dsa/dsa2.c:1650:2: error: implicit declaration of function 'dsa_switch_for_each_cpu_port'
by kernel test robot
tree: https://git.kernel.org/pub/scm/linux/kernel/git/sashal/linux-stable.git pending-5.15
head: c8020bc325ff1e12d98d1aa70b77afb4f40e1c5e
commit: 366646dc932a8ee5dea1a71dad1f6e06ea28ac40 [125/134] net: dsa: fix panic when DSA master device unbinds on shutdown
config: x86_64-randconfig-a005 (https://download.01.org/0day-ci/archive/20220213/202202131500.dt3gyv0s-lk...)
compiler: clang version 15.0.0 (https://github.com/llvm/llvm-project 478c237e21b2c3a83e46f26fcbeb3876682f9b14)
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/sashal/linux-stable.git/c...
git remote add sashal-stable https://git.kernel.org/pub/scm/linux/kernel/git/sashal/linux-stable.git
git fetch --no-tags sashal-stable pending-5.15
git checkout 366646dc932a8ee5dea1a71dad1f6e06ea28ac40
# save the config file to linux build tree
mkdir build_dir
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross W=1 O=build_dir ARCH=x86_64 SHELL=/bin/bash net/dsa/
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp(a)intel.com>
All errors (new ones prefixed by >>):
>> net/dsa/dsa2.c:1650:2: error: implicit declaration of function 'dsa_switch_for_each_cpu_port' [-Werror,-Wimplicit-function-declaration]
dsa_switch_for_each_cpu_port(dp, ds)
^
>> net/dsa/dsa2.c:1650:38: error: expected ';' after expression
dsa_switch_for_each_cpu_port(dp, ds)
^
;
2 errors generated.
vim +/dsa_switch_for_each_cpu_port +1650 net/dsa/dsa2.c
1620
1621 /* If the DSA master chooses to unregister its net_device on .shutdown, DSA is
1622 * blocking that operation from completion, due to the dev_hold taken inside
1623 * netdev_upper_dev_link. Unlink the DSA slave interfaces from being uppers of
1624 * the DSA master, so that the system can reboot successfully.
1625 */
1626 void dsa_switch_shutdown(struct dsa_switch *ds)
1627 {
1628 struct net_device *master, *slave_dev;
1629 struct dsa_port *dp;
1630
1631 mutex_lock(&dsa2_mutex);
1632 rtnl_lock();
1633
1634 list_for_each_entry(dp, &ds->dst->ports, list) {
1635 if (dp->ds != ds)
1636 continue;
1637
1638 if (!dsa_port_is_user(dp))
1639 continue;
1640
1641 master = dp->cpu_dp->master;
1642 slave_dev = dp->slave;
1643
1644 netdev_upper_dev_unlink(master, slave_dev);
1645 }
1646
1647 /* Disconnect from further netdevice notifiers on the master,
1648 * since netdev_uses_dsa() will now return false.
1649 */
> 1650 dsa_switch_for_each_cpu_port(dp, ds)
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
7 months, 1 week
[jimc:dyn-drm-trc 14/19] drivers/gpu/drm/drm_print.c:289:21: error: '_DPRINTK_FLAGS_PRINT' undeclared
by kernel test robot
tree: https://github.com/jimc/linux.git dyn-drm-trc
head: df426d10840ccdda8ef29b66f8df55a010836a7c
commit: 8315288913f387f0dad23819e847ae77d7991f8b [14/19] dyndbg: add _DPRINTK_FLAGS_ENABLED
config: i386-allyesconfig (https://download.01.org/0day-ci/archive/20220213/202202131417.lFsFyv0i-lk...)
compiler: gcc-9 (Debian 9.3.0-22) 9.3.0
reproduce (this is a W=1 build):
# https://github.com/jimc/linux/commit/8315288913f387f0dad23819e847ae77d799...
git remote add jimc https://github.com/jimc/linux.git
git fetch --no-tags jimc dyn-drm-trc
git checkout 8315288913f387f0dad23819e847ae77d7991f8b
# save the config file to linux build tree
mkdir build_dir
make W=1 O=build_dir ARCH=i386 SHELL=/bin/bash
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp(a)intel.com>
Note: the jimc/dyn-drm-trc HEAD df426d10840ccdda8ef29b66f8df55a010836a7c builds fine.
It only hurts bisectability.
All errors (new ones prefixed by >>):
drivers/gpu/drm/drm_print.c: In function '__drm_dev_dbg':
>> drivers/gpu/drm/drm_print.c:289:21: error: '_DPRINTK_FLAGS_PRINT' undeclared (first use in this function)
289 | if (desc->flags & _DPRINTK_FLAGS_PRINT)
| ^~~~~~~~~~~~~~~~~~~~
drivers/gpu/drm/drm_print.c:289:21: note: each undeclared identifier is reported only once for each function it appears in
vim +/_DPRINTK_FLAGS_PRINT +289 drivers/gpu/drm/drm_print.c
db87086492581c Joe Perches 2018-03-16 273
b3dababcea70ef Jim Cromie 2021-12-28 274 void __drm_dev_dbg(struct _ddebug *desc, const struct device *dev,
b3dababcea70ef Jim Cromie 2021-12-28 275 enum drm_debug_category category, const char *format, ...)
02c9656b2f0d69 Haneen Mohammed 2017-10-17 276 {
02c9656b2f0d69 Haneen Mohammed 2017-10-17 277 struct va_format vaf;
02c9656b2f0d69 Haneen Mohammed 2017-10-17 278 va_list args;
02c9656b2f0d69 Haneen Mohammed 2017-10-17 279
f1a6b74f598212 Jim Cromie 2022-01-19 280 if (!__drm_debug_enabled(category))
02c9656b2f0d69 Haneen Mohammed 2017-10-17 281 return;
02c9656b2f0d69 Haneen Mohammed 2017-10-17 282
b3dababcea70ef Jim Cromie 2021-12-28 283 /* we know we are printing for either syslog, tracefs, or both */
02c9656b2f0d69 Haneen Mohammed 2017-10-17 284 va_start(args, format);
02c9656b2f0d69 Haneen Mohammed 2017-10-17 285 vaf.fmt = format;
02c9656b2f0d69 Haneen Mohammed 2017-10-17 286 vaf.va = &args;
02c9656b2f0d69 Haneen Mohammed 2017-10-17 287
b3dababcea70ef Jim Cromie 2021-12-28 288 if (dev) {
b3dababcea70ef Jim Cromie 2021-12-28 @289 if (desc->flags & _DPRINTK_FLAGS_PRINT)
db87086492581c Joe Perches 2018-03-16 290 dev_printk(KERN_DEBUG, dev, "[" DRM_NAME ":%ps] %pV",
db87086492581c Joe Perches 2018-03-16 291 __builtin_return_address(0), &vaf);
b3dababcea70ef Jim Cromie 2021-12-28 292 } else {
b3dababcea70ef Jim Cromie 2021-12-28 293 if (desc->flags & _DPRINTK_FLAGS_PRINT)
db87086492581c Joe Perches 2018-03-16 294 printk(KERN_DEBUG "[" DRM_NAME ":%ps] %pV",
db87086492581c Joe Perches 2018-03-16 295 __builtin_return_address(0), &vaf);
b3dababcea70ef Jim Cromie 2021-12-28 296 }
02c9656b2f0d69 Haneen Mohammed 2017-10-17 297 va_end(args);
02c9656b2f0d69 Haneen Mohammed 2017-10-17 298 }
d101b390913238 Jim Cromie 2021-12-18 299 EXPORT_SYMBOL(__drm_dev_dbg);
02c9656b2f0d69 Haneen Mohammed 2017-10-17 300
:::::: The code at line 289 was first introduced by commit
:::::: b3dababcea70ef41b80e5500eef493dcc7619756 drm_print: add _ddebug desc to drm_*dbg prototypes
:::::: TO: Jim Cromie <jim.cromie(a)gmail.com>
:::::: CC: Jim Cromie <jim.cromie(a)gmail.com>
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
7 months, 1 week
[sashal-stable:pending-5.15 125/134] net/dsa/dsa2.c:1650:9: error: implicit declaration of function 'dsa_switch_for_each_cpu_port'; did you mean 'dsa_switch_touch_ports'?
by kernel test robot
tree: https://git.kernel.org/pub/scm/linux/kernel/git/sashal/linux-stable.git pending-5.15
head: c8020bc325ff1e12d98d1aa70b77afb4f40e1c5e
commit: 366646dc932a8ee5dea1a71dad1f6e06ea28ac40 [125/134] net: dsa: fix panic when DSA master device unbinds on shutdown
config: sparc-randconfig-m031-20220213 (https://download.01.org/0day-ci/archive/20220213/202202131427.SK7CctaU-lk...)
compiler: sparc-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/sashal/linux-stable.git/c...
git remote add sashal-stable https://git.kernel.org/pub/scm/linux/kernel/git/sashal/linux-stable.git
git fetch --no-tags sashal-stable pending-5.15
git checkout 366646dc932a8ee5dea1a71dad1f6e06ea28ac40
# save the config file to linux build tree
mkdir build_dir
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-11.2.0 make.cross O=build_dir ARCH=sparc SHELL=/bin/bash net/dsa/
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp(a)intel.com>
All errors (new ones prefixed by >>):
net/dsa/dsa2.c: In function 'dsa_switch_shutdown':
>> net/dsa/dsa2.c:1650:9: error: implicit declaration of function 'dsa_switch_for_each_cpu_port'; did you mean 'dsa_switch_touch_ports'? [-Werror=implicit-function-declaration]
1650 | dsa_switch_for_each_cpu_port(dp, ds)
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
| dsa_switch_touch_ports
>> net/dsa/dsa2.c:1650:45: error: expected ';' before 'dp'
1650 | dsa_switch_for_each_cpu_port(dp, ds)
| ^
| ;
1651 | dp->master->dsa_ptr = NULL;
| ~~
cc1: some warnings being treated as errors
vim +1650 net/dsa/dsa2.c
1620
1621 /* If the DSA master chooses to unregister its net_device on .shutdown, DSA is
1622 * blocking that operation from completion, due to the dev_hold taken inside
1623 * netdev_upper_dev_link. Unlink the DSA slave interfaces from being uppers of
1624 * the DSA master, so that the system can reboot successfully.
1625 */
1626 void dsa_switch_shutdown(struct dsa_switch *ds)
1627 {
1628 struct net_device *master, *slave_dev;
1629 struct dsa_port *dp;
1630
1631 mutex_lock(&dsa2_mutex);
1632 rtnl_lock();
1633
1634 list_for_each_entry(dp, &ds->dst->ports, list) {
1635 if (dp->ds != ds)
1636 continue;
1637
1638 if (!dsa_port_is_user(dp))
1639 continue;
1640
1641 master = dp->cpu_dp->master;
1642 slave_dev = dp->slave;
1643
1644 netdev_upper_dev_unlink(master, slave_dev);
1645 }
1646
1647 /* Disconnect from further netdevice notifiers on the master,
1648 * since netdev_uses_dsa() will now return false.
1649 */
> 1650 dsa_switch_for_each_cpu_port(dp, ds)
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
7 months, 1 week