* [mchinth:sep_socwatch_linux_5_9 1/1] drivers/platform/x86/socperf/socperfdrv.c:1332:18: sparse: sparse: cast removes address space '__user' of expression
@ 2021-04-13 23:37 kernel test robot
0 siblings, 0 replies; 2+ messages in thread
From: kernel test robot @ 2021-04-13 23:37 UTC (permalink / raw)
To: kbuild-all
[-- Attachment #1: Type: text/plain, Size: 7156 bytes --]
Hi Manisha,
First bad commit (maybe != root cause):
tree: https://github.com/mchinth/linux sep_socwatch_linux_5_9
head: c859e634bf058e7963fccc4c1219c1365e925ad4
commit: c859e634bf058e7963fccc4c1219c1365e925ad4 [1/1] platform/x86: Update SEP driver for 5.9 pull
config: x86_64-randconfig-s022-20210413 (attached as .config)
compiler: gcc-9 (Debian 9.3.0-22) 9.3.0
reproduce:
# apt-get install sparse
# sparse version: v0.6.3-280-g2cd6d34e-dirty
# https://github.com/mchinth/linux/commit/c859e634bf058e7963fccc4c1219c1365e925ad4
git remote add mchinth https://github.com/mchinth/linux
git fetch --no-tags mchinth sep_socwatch_linux_5_9
git checkout c859e634bf058e7963fccc4c1219c1365e925ad4
# save the attached .config to linux build tree
make W=1 C=1 CF='-fdiagnostic-prefix -D__CHECK_ENDIAN__' ARCH=x86_64
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 >>)
drivers/platform/x86/socperf/socperfdrv.c:203:13: sparse: sparse: function 'SOCPERF_Read_Data3' with external linkage has definition
drivers/platform/x86/socperf/socperfdrv.c:885:1: sparse: sparse: function 'SOCPERF_Switch_Group3' with external linkage has definition
drivers/platform/x86/socperf/socperfdrv.c:101:22: sparse: sparse: symbol 'socperf_drv_version' was not declared. Should it be static?
drivers/platform/x86/socperf/socperfdrv.c:102:5: sparse: sparse: symbol 'read_unc_ctr_info' was not declared. Should it be static?
drivers/platform/x86/socperf/socperfdrv.c:103:10: sparse: sparse: symbol 'dispatch_uncore' was not declared. Should it be static?
drivers/platform/x86/socperf/socperfdrv.c:104:12: sparse: sparse: symbol 'socperf_drv_cfg' was not declared. Should it be static?
drivers/platform/x86/socperf/socperfdrv.c:105:14: sparse: sparse: symbol 'socperf_global_ec' was not declared. Should it be static?
drivers/platform/x86/socperf/socperfdrv.c:106:14: sparse: sparse: symbol 'socperf_abnormal_terminate' was not declared. Should it be static?
drivers/platform/x86/socperf/socperfdrv.c:107:11: sparse: sparse: symbol 'socperf_control' was not declared. Should it be static?
drivers/platform/x86/socperf/socperfdrv.c:111:8: sparse: sparse: symbol 'socperf_pcb_size' was not declared. Should it be static?
drivers/platform/x86/socperf/socperfdrv.c:984:28: sparse: sparse: Using plain integer as NULL pointer
drivers/platform/x86/socperf/socperfdrv.c:1070:6: sparse: sparse: symbol 'lwpmudrv_Stop_Mem' was not declared. Should it be static?
drivers/platform/x86/socperf/socperfdrv.c:1155:15: sparse: sparse: symbol 'socperf_Service_IOCTL' was not declared. Should it be static?
drivers/platform/x86/socperf/socperfdrv.c:1274:6: sparse: sparse: symbol 'socperf_Device_Control' was not declared. Should it be static?
>> drivers/platform/x86/socperf/socperfdrv.c:1332:18: sparse: sparse: cast removes address space '__user' of expression
drivers/platform/x86/socperf/socperfdrv.c:1334:18: sparse: sparse: cast removes address space '__user' of expression
drivers/platform/x86/socperf/socperfdrv.c:1307:6: sparse: sparse: symbol 'socperf_Device_Control_Compat' was not declared. Should it be static?
drivers/platform/x86/socperf/socperfdrv.c:1358:5: sparse: sparse: symbol 'SOCPERF_Abnormal_Terminate' was not declared. Should it be static?
vim +/__user +1332 drivers/platform/x86/socperf/socperfdrv.c
f57492d07625dd Manisha Chinthapally 2019-05-01 1305
f57492d07625dd Manisha Chinthapally 2019-05-01 1306 #if defined(CONFIG_COMPAT) && defined(DRV_EM64T)
f57492d07625dd Manisha Chinthapally 2019-05-01 1307 long socperf_Device_Control_Compat(struct file *filp, unsigned int cmd,
f57492d07625dd Manisha Chinthapally 2019-05-01 1308 unsigned long arg)
f57492d07625dd Manisha Chinthapally 2019-05-01 1309 {
f57492d07625dd Manisha Chinthapally 2019-05-01 1310 int status = OS_SUCCESS;
f57492d07625dd Manisha Chinthapally 2019-05-01 1311 IOCTL_COMPAT_ARGS_NODE local_args_compat;
f57492d07625dd Manisha Chinthapally 2019-05-01 1312 IOCTL_ARGS_NODE local_args;
f57492d07625dd Manisha Chinthapally 2019-05-01 1313
f57492d07625dd Manisha Chinthapally 2019-05-01 1314 memset(&local_args_compat, 0, sizeof(IOCTL_COMPAT_ARGS_NODE));
f57492d07625dd Manisha Chinthapally 2019-05-01 1315 SOCPERF_PRINT_DEBUG("Compat: type: %d, subcommand: %d\n",
f57492d07625dd Manisha Chinthapally 2019-05-01 1316 _IOC_TYPE(cmd), _IOC_NR(cmd));
f57492d07625dd Manisha Chinthapally 2019-05-01 1317
f57492d07625dd Manisha Chinthapally 2019-05-01 1318 if (_IOC_TYPE(cmd) != LWPMU_IOC_MAGIC) {
f57492d07625dd Manisha Chinthapally 2019-05-01 1319 SOCPERF_PRINT_ERROR("Unknown IOCTL magic:%d\n", _IOC_TYPE(cmd));
f57492d07625dd Manisha Chinthapally 2019-05-01 1320 return OS_ILLEGAL_IOCTL;
f57492d07625dd Manisha Chinthapally 2019-05-01 1321 }
f57492d07625dd Manisha Chinthapally 2019-05-01 1322
f57492d07625dd Manisha Chinthapally 2019-05-01 1323 MUTEX_LOCK(ioctl_lock);
f57492d07625dd Manisha Chinthapally 2019-05-01 1324 if (arg) {
f57492d07625dd Manisha Chinthapally 2019-05-01 1325 status = copy_from_user(&local_args_compat,
f57492d07625dd Manisha Chinthapally 2019-05-01 1326 (void __user *)arg,
f57492d07625dd Manisha Chinthapally 2019-05-01 1327 sizeof(IOCTL_COMPAT_ARGS_NODE));
f57492d07625dd Manisha Chinthapally 2019-05-01 1328 }
f57492d07625dd Manisha Chinthapally 2019-05-01 1329 local_args.len_drv_to_usr = local_args_compat.len_drv_to_usr;
f57492d07625dd Manisha Chinthapally 2019-05-01 1330 local_args.len_usr_to_drv = local_args_compat.len_usr_to_drv;
f57492d07625dd Manisha Chinthapally 2019-05-01 1331 local_args.buf_drv_to_usr =
f57492d07625dd Manisha Chinthapally 2019-05-01 @1332 (char *)compat_ptr(local_args_compat.buf_drv_to_usr);
f57492d07625dd Manisha Chinthapally 2019-05-01 1333 local_args.buf_usr_to_drv =
f57492d07625dd Manisha Chinthapally 2019-05-01 1334 (char *)compat_ptr(local_args_compat.buf_usr_to_drv);
f57492d07625dd Manisha Chinthapally 2019-05-01 1335
f57492d07625dd Manisha Chinthapally 2019-05-01 1336 status = socperf_Service_IOCTL(filp, _IOC_NR(cmd), local_args);
f57492d07625dd Manisha Chinthapally 2019-05-01 1337 MUTEX_UNLOCK(ioctl_lock);
f57492d07625dd Manisha Chinthapally 2019-05-01 1338
f57492d07625dd Manisha Chinthapally 2019-05-01 1339 return status;
f57492d07625dd Manisha Chinthapally 2019-05-01 1340 }
f57492d07625dd Manisha Chinthapally 2019-05-01 1341 #endif
f57492d07625dd Manisha Chinthapally 2019-05-01 1342
:::::: The code at line 1332 was first introduced by commit
:::::: f57492d07625dddac7920eccdb5be08c55ee16fa platform/x86: SOCPERF3 support for sep & socwatch
:::::: TO: Manisha Chinthapally <manisha.chinthapally@intel.com>
:::::: CC: Faycal Benmlih <faycal.benmlih@intel.com>
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all(a)lists.01.org
[-- Attachment #2: config.gz --]
[-- Type: application/gzip, Size: 28032 bytes --]
^ permalink raw reply [flat|nested] 2+ messages in thread
* [mchinth:sep_socwatch_linux_5_9 1/1] drivers/platform/x86/socperf/socperfdrv.c:1332:18: sparse: sparse: cast removes address space '__user' of expression
@ 2020-09-26 8:09 kernel test robot
0 siblings, 0 replies; 2+ messages in thread
From: kernel test robot @ 2020-09-26 8:09 UTC (permalink / raw)
To: kbuild-all
[-- Attachment #1: Type: text/plain, Size: 7881 bytes --]
Hi Manisha,
First bad commit (maybe != root cause):
tree: https://github.com/mchinth/linux sep_socwatch_linux_5_9
head: c859e634bf058e7963fccc4c1219c1365e925ad4
commit: c859e634bf058e7963fccc4c1219c1365e925ad4 [1/1] platform/x86: Update SEP driver for 5.9 pull
config: x86_64-randconfig-s021-20200925 (attached as .config)
compiler: gcc-9 (Debian 9.3.0-15) 9.3.0
reproduce:
# apt-get install sparse
# sparse version: v0.6.2-201-g24bdaac6-dirty
# https://github.com/mchinth/linux/commit/c859e634bf058e7963fccc4c1219c1365e925ad4
git remote add mchinth https://github.com/mchinth/linux
git fetch --no-tags mchinth sep_socwatch_linux_5_9
git checkout c859e634bf058e7963fccc4c1219c1365e925ad4
# save the attached .config to linux build tree
make W=1 C=1 CF='-fdiagnostic-prefix -D__CHECK_ENDIAN__' ARCH=x86_64
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 >>)
drivers/platform/x86/socperf/socperfdrv.c:203:13: sparse: sparse: function 'SOCPERF_Read_Data3' with external linkage has definition
drivers/platform/x86/socperf/socperfdrv.c:885:1: sparse: sparse: function 'SOCPERF_Switch_Group3' with external linkage has definition
drivers/platform/x86/socperf/socperfdrv.c:101:22: sparse: sparse: symbol 'socperf_drv_version' was not declared. Should it be static?
drivers/platform/x86/socperf/socperfdrv.c:102:5: sparse: sparse: symbol 'read_unc_ctr_info' was not declared. Should it be static?
drivers/platform/x86/socperf/socperfdrv.c:103:10: sparse: sparse: symbol 'dispatch_uncore' was not declared. Should it be static?
drivers/platform/x86/socperf/socperfdrv.c:104:12: sparse: sparse: symbol 'socperf_drv_cfg' was not declared. Should it be static?
drivers/platform/x86/socperf/socperfdrv.c:105:14: sparse: sparse: symbol 'socperf_global_ec' was not declared. Should it be static?
drivers/platform/x86/socperf/socperfdrv.c:106:14: sparse: sparse: symbol 'socperf_abnormal_terminate' was not declared. Should it be static?
drivers/platform/x86/socperf/socperfdrv.c:107:11: sparse: sparse: symbol 'socperf_control' was not declared. Should it be static?
drivers/platform/x86/socperf/socperfdrv.c:111:8: sparse: sparse: symbol 'socperf_pcb_size' was not declared. Should it be static?
drivers/platform/x86/socperf/socperfdrv.c:984:28: sparse: sparse: Using plain integer as NULL pointer
drivers/platform/x86/socperf/socperfdrv.c:1070:6: sparse: sparse: symbol 'lwpmudrv_Stop_Mem' was not declared. Should it be static?
drivers/platform/x86/socperf/socperfdrv.c:1155:15: sparse: sparse: symbol 'socperf_Service_IOCTL' was not declared. Should it be static?
drivers/platform/x86/socperf/socperfdrv.c:1274:6: sparse: sparse: symbol 'socperf_Device_Control' was not declared. Should it be static?
>> drivers/platform/x86/socperf/socperfdrv.c:1332:18: sparse: sparse: cast removes address space '__user' of expression
drivers/platform/x86/socperf/socperfdrv.c:1334:18: sparse: sparse: cast removes address space '__user' of expression
drivers/platform/x86/socperf/socperfdrv.c:1307:6: sparse: sparse: symbol 'socperf_Device_Control_Compat' was not declared. Should it be static?
drivers/platform/x86/socperf/socperfdrv.c:1358:5: sparse: sparse: symbol 'SOCPERF_Abnormal_Terminate' was not declared. Should it be static?
--
drivers/platform/x86/sepdk/sep/lwpmudrv.c: note: in included file (through drivers/platform/x86/sepdk/inc/apic.h):
/usr/lib/gcc/x86_64-linux-gnu/9/include/stddef.h:406:9: sparse: sparse: preprocessor token offsetof redefined
drivers/platform/x86/sepdk/sep/lwpmudrv.c: note: in included file (through include/uapi/linux/posix_types.h, include/uapi/linux/types.h, include/linux/types.h, ...):
include/linux/stddef.h:17:9: sparse: this was the original definition
>> drivers/platform/x86/sepdk/sep/lwpmudrv.c:7127:18: sparse: sparse: cast removes address space '__user' of expression
drivers/platform/x86/sepdk/sep/lwpmudrv.c:7129:18: sparse: sparse: cast removes address space '__user' of expression
vim +/__user +1332 drivers/platform/x86/socperf/socperfdrv.c
f57492d07625dd Manisha Chinthapally 2019-05-01 1305
f57492d07625dd Manisha Chinthapally 2019-05-01 1306 #if defined(CONFIG_COMPAT) && defined(DRV_EM64T)
f57492d07625dd Manisha Chinthapally 2019-05-01 1307 long socperf_Device_Control_Compat(struct file *filp, unsigned int cmd,
f57492d07625dd Manisha Chinthapally 2019-05-01 1308 unsigned long arg)
f57492d07625dd Manisha Chinthapally 2019-05-01 1309 {
f57492d07625dd Manisha Chinthapally 2019-05-01 1310 int status = OS_SUCCESS;
f57492d07625dd Manisha Chinthapally 2019-05-01 1311 IOCTL_COMPAT_ARGS_NODE local_args_compat;
f57492d07625dd Manisha Chinthapally 2019-05-01 1312 IOCTL_ARGS_NODE local_args;
f57492d07625dd Manisha Chinthapally 2019-05-01 1313
f57492d07625dd Manisha Chinthapally 2019-05-01 1314 memset(&local_args_compat, 0, sizeof(IOCTL_COMPAT_ARGS_NODE));
f57492d07625dd Manisha Chinthapally 2019-05-01 1315 SOCPERF_PRINT_DEBUG("Compat: type: %d, subcommand: %d\n",
f57492d07625dd Manisha Chinthapally 2019-05-01 1316 _IOC_TYPE(cmd), _IOC_NR(cmd));
f57492d07625dd Manisha Chinthapally 2019-05-01 1317
f57492d07625dd Manisha Chinthapally 2019-05-01 1318 if (_IOC_TYPE(cmd) != LWPMU_IOC_MAGIC) {
f57492d07625dd Manisha Chinthapally 2019-05-01 1319 SOCPERF_PRINT_ERROR("Unknown IOCTL magic:%d\n", _IOC_TYPE(cmd));
f57492d07625dd Manisha Chinthapally 2019-05-01 1320 return OS_ILLEGAL_IOCTL;
f57492d07625dd Manisha Chinthapally 2019-05-01 1321 }
f57492d07625dd Manisha Chinthapally 2019-05-01 1322
f57492d07625dd Manisha Chinthapally 2019-05-01 1323 MUTEX_LOCK(ioctl_lock);
f57492d07625dd Manisha Chinthapally 2019-05-01 1324 if (arg) {
f57492d07625dd Manisha Chinthapally 2019-05-01 1325 status = copy_from_user(&local_args_compat,
f57492d07625dd Manisha Chinthapally 2019-05-01 1326 (void __user *)arg,
f57492d07625dd Manisha Chinthapally 2019-05-01 1327 sizeof(IOCTL_COMPAT_ARGS_NODE));
f57492d07625dd Manisha Chinthapally 2019-05-01 1328 }
f57492d07625dd Manisha Chinthapally 2019-05-01 1329 local_args.len_drv_to_usr = local_args_compat.len_drv_to_usr;
f57492d07625dd Manisha Chinthapally 2019-05-01 1330 local_args.len_usr_to_drv = local_args_compat.len_usr_to_drv;
f57492d07625dd Manisha Chinthapally 2019-05-01 1331 local_args.buf_drv_to_usr =
f57492d07625dd Manisha Chinthapally 2019-05-01 @1332 (char *)compat_ptr(local_args_compat.buf_drv_to_usr);
f57492d07625dd Manisha Chinthapally 2019-05-01 1333 local_args.buf_usr_to_drv =
f57492d07625dd Manisha Chinthapally 2019-05-01 1334 (char *)compat_ptr(local_args_compat.buf_usr_to_drv);
f57492d07625dd Manisha Chinthapally 2019-05-01 1335
f57492d07625dd Manisha Chinthapally 2019-05-01 1336 status = socperf_Service_IOCTL(filp, _IOC_NR(cmd), local_args);
f57492d07625dd Manisha Chinthapally 2019-05-01 1337 MUTEX_UNLOCK(ioctl_lock);
f57492d07625dd Manisha Chinthapally 2019-05-01 1338
f57492d07625dd Manisha Chinthapally 2019-05-01 1339 return status;
f57492d07625dd Manisha Chinthapally 2019-05-01 1340 }
f57492d07625dd Manisha Chinthapally 2019-05-01 1341 #endif
f57492d07625dd Manisha Chinthapally 2019-05-01 1342
:::::: The code at line 1332 was first introduced by commit
:::::: f57492d07625dddac7920eccdb5be08c55ee16fa platform/x86: SOCPERF3 support for sep & socwatch
:::::: TO: Manisha Chinthapally <manisha.chinthapally@intel.com>
:::::: CC: Faycal Benmlih <faycal.benmlih@intel.com>
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all(a)lists.01.org
[-- Attachment #2: config.gz --]
[-- Type: application/gzip, Size: 28146 bytes --]
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2021-04-13 23:37 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-04-13 23:37 [mchinth:sep_socwatch_linux_5_9 1/1] drivers/platform/x86/socperf/socperfdrv.c:1332:18: sparse: sparse: cast removes address space '__user' of expression kernel test robot
-- strict thread matches above, loose matches on Subject: below --
2020-09-26 8:09 kernel test robot
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.