drivers/edac/amd64_edac.c:3065:47: sparse: sparse: incorrect type in argument 3 (different address spaces)

From: kernel test robot
Date: Wed Aug 12 2020 - 01:32:43 EST


tree: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head: fb893de323e2d39f7a1f6df425703a2edbdf56ea
commit: 670d0a4b10704667765f7d18f7592993d02783aa sparse: use identifiers to define address spaces
date: 8 weeks ago
config: i386-randconfig-s001-20200812 (attached as .config)
compiler: gcc-9 (Debian 9.3.0-15) 9.3.0
reproduce:
# apt-get install sparse
# sparse version: v0.6.2-168-g9554805c-dirty
git checkout 670d0a4b10704667765f7d18f7592993d02783aa
# save the attached .config to linux build tree
make W=1 C=1 CF='-fdiagnostic-prefix -D__CHECK_ENDIAN__' ARCH=i386

If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@xxxxxxxxx>


sparse warnings: (new ones prefixed by >>)

>> drivers/edac/amd64_edac.c:3065:47: sparse: sparse: incorrect type in argument 3 (different address spaces) @@ expected struct msr *msrs @@ got struct msr [noderef] __percpu *static [toplevel] msrs @@
drivers/edac/amd64_edac.c:3065:47: sparse: expected struct msr *msrs
>> drivers/edac/amd64_edac.c:3065:47: sparse: got struct msr [noderef] __percpu *static [toplevel] msrs
drivers/edac/amd64_edac.c:3097:48: sparse: sparse: incorrect type in argument 3 (different address spaces) @@ expected struct msr *msrs @@ got struct msr [noderef] __percpu *static [toplevel] msrs @@
drivers/edac/amd64_edac.c:3097:48: sparse: expected struct msr *msrs
drivers/edac/amd64_edac.c:3097:48: sparse: got struct msr [noderef] __percpu *static [toplevel] msrs
drivers/edac/amd64_edac.c:3116:48: sparse: sparse: incorrect type in argument 3 (different address spaces) @@ expected struct msr *msrs @@ got struct msr [noderef] __percpu *static [toplevel] msrs @@
drivers/edac/amd64_edac.c:3116:48: sparse: expected struct msr *msrs
drivers/edac/amd64_edac.c:3116:48: sparse: got struct msr [noderef] __percpu *static [toplevel] msrs
>> drivers/edac/amd64_edac.c:3674:14: sparse: sparse: incorrect type in assignment (different address spaces) @@ expected struct msr [noderef] __percpu *static [toplevel] msrs @@ got struct msr * @@
>> drivers/edac/amd64_edac.c:3674:14: sparse: expected struct msr [noderef] __percpu *static [toplevel] msrs
drivers/edac/amd64_edac.c:3674:14: sparse: got struct msr *
drivers/edac/amd64_edac.c:3711:19: sparse: sparse: incorrect type in argument 1 (different address spaces) @@ expected struct msr *msrs @@ got struct msr [noderef] __percpu *static [toplevel] msrs @@
drivers/edac/amd64_edac.c:3711:19: sparse: expected struct msr *msrs
drivers/edac/amd64_edac.c:3711:19: sparse: got struct msr [noderef] __percpu *static [toplevel] msrs
>> drivers/edac/amd64_edac.c:3740:19: sparse: sparse: incorrect type in argument 1 (different address spaces) @@ expected struct msr *msrs @@ got struct msr [noderef] __percpu *static [assigned] [toplevel] msrs @@
drivers/edac/amd64_edac.c:3740:19: sparse: expected struct msr *msrs
>> drivers/edac/amd64_edac.c:3740:19: sparse: got struct msr [noderef] __percpu *static [assigned] [toplevel] msrs
--
>> drivers/video/fbdev/geode/suspend_gx.c:32:28: sparse: sparse: incorrect type in argument 2 (different address spaces) @@ expected void const *q @@ got void [noderef] __iomem *gp_regs @@
drivers/video/fbdev/geode/suspend_gx.c:32:28: sparse: expected void const *q
drivers/video/fbdev/geode/suspend_gx.c:32:28: sparse: got void [noderef] __iomem *gp_regs
>> drivers/video/fbdev/geode/suspend_gx.c:33:28: sparse: sparse: incorrect type in argument 2 (different address spaces) @@ expected void const *q @@ got void [noderef] __iomem *dc_regs @@
drivers/video/fbdev/geode/suspend_gx.c:33:28: sparse: expected void const *q
drivers/video/fbdev/geode/suspend_gx.c:33:28: sparse: got void [noderef] __iomem *dc_regs
>> drivers/video/fbdev/geode/suspend_gx.c:34:28: sparse: sparse: incorrect type in argument 2 (different address spaces) @@ expected void const *q @@ got void [noderef] __iomem *vid_regs @@
drivers/video/fbdev/geode/suspend_gx.c:34:28: sparse: expected void const *q
drivers/video/fbdev/geode/suspend_gx.c:34:28: sparse: got void [noderef] __iomem *vid_regs
>> drivers/video/fbdev/geode/suspend_gx.c:35:39: sparse: sparse: incorrect type in argument 2 (different address spaces) @@ expected void const *q @@ got void [noderef] __iomem * @@
drivers/video/fbdev/geode/suspend_gx.c:35:39: sparse: expected void const *q
drivers/video/fbdev/geode/suspend_gx.c:35:39: sparse: got void [noderef] __iomem *
--
drivers/net/wireless/intel/iwlwifi/mvm/mac80211.c: note: in included file (through drivers/net/wireless/intel/iwlwifi/mvm/..//fw/img.h, drivers/net/wireless/intel/iwlwifi/mvm/..//iwl-trans.h, ...):
drivers/net/wireless/intel/iwlwifi/mvm/..//fw/file.h:330:19: sparse: sparse: mixed bitwiseness
drivers/net/wireless/intel/iwlwifi/mvm/..//fw/file.h:484:19: sparse: sparse: mixed bitwiseness
>> drivers/net/wireless/intel/iwlwifi/mvm/mac80211.c:3002:63: sparse: sparse: incorrect type in argument 2 (different address spaces) @@ expected unsigned char const [usertype] *ies @@ got unsigned char const [noderef] __rcu * @@
drivers/net/wireless/intel/iwlwifi/mvm/mac80211.c:3002:63: sparse: expected unsigned char const [usertype] *ies
>> drivers/net/wireless/intel/iwlwifi/mvm/mac80211.c:3002:63: sparse: got unsigned char const [noderef] __rcu *
drivers/net/wireless/intel/iwlwifi/mvm/mac80211.c:3003:38: sparse: sparse: dereference of noderef expression
drivers/net/wireless/intel/iwlwifi/mvm/mac80211.c:3003:38: sparse: sparse: dereference of noderef expression

vim +3065 drivers/edac/amd64_edac.c

f6d6ae96576090 Borislav Petkov 2009-11-03 3050
f6d6ae96576090 Borislav Petkov 2009-11-03 3051 /* check MCG_CTL on all the cpus on this node */
d1ea71cdc9801c Borislav Petkov 2013-12-15 3052 static bool nb_mce_bank_enabled_on_node(u16 nid)
f6d6ae96576090 Borislav Petkov 2009-11-03 3053 {
f6d6ae96576090 Borislav Petkov 2009-11-03 3054 cpumask_var_t mask;
505422517d3f12 Borislav Petkov 2009-12-11 3055 int cpu, nbe;
f6d6ae96576090 Borislav Petkov 2009-11-03 3056 bool ret = false;
f6d6ae96576090 Borislav Petkov 2009-11-03 3057
f6d6ae96576090 Borislav Petkov 2009-11-03 3058 if (!zalloc_cpumask_var(&mask, GFP_KERNEL)) {
24f9a7fe3f19f3 Borislav Petkov 2010-10-07 3059 amd64_warn("%s: Error allocating mask\n", __func__);
f6d6ae96576090 Borislav Petkov 2009-11-03 3060 return false;
f6d6ae96576090 Borislav Petkov 2009-11-03 3061 }
f6d6ae96576090 Borislav Petkov 2009-11-03 3062
f6d6ae96576090 Borislav Petkov 2009-11-03 3063 get_cpus_on_this_dct_cpumask(mask, nid);
f6d6ae96576090 Borislav Petkov 2009-11-03 3064
f6d6ae96576090 Borislav Petkov 2009-11-03 @3065 rdmsr_on_cpus(mask, MSR_IA32_MCG_CTL, msrs);
f6d6ae96576090 Borislav Petkov 2009-11-03 3066
f6d6ae96576090 Borislav Petkov 2009-11-03 3067 for_each_cpu(cpu, mask) {
505422517d3f12 Borislav Petkov 2009-12-11 3068 struct msr *reg = per_cpu_ptr(msrs, cpu);
5980bb9cd88a3f Borislav Petkov 2011-01-07 3069 nbe = reg->l & MSR_MCGCTL_NBE;
f6d6ae96576090 Borislav Petkov 2009-11-03 3070
956b9ba156dbfd Joe Perches 2012-04-29 3071 edac_dbg(0, "core: %u, MCG_CTL: 0x%llx, NB MSR is %s\n",
505422517d3f12 Borislav Petkov 2009-12-11 3072 cpu, reg->q,
f6d6ae96576090 Borislav Petkov 2009-11-03 3073 (nbe ? "enabled" : "disabled"));
f6d6ae96576090 Borislav Petkov 2009-11-03 3074
f6d6ae96576090 Borislav Petkov 2009-11-03 3075 if (!nbe)
f6d6ae96576090 Borislav Petkov 2009-11-03 3076 goto out;
f6d6ae96576090 Borislav Petkov 2009-11-03 3077 }
f6d6ae96576090 Borislav Petkov 2009-11-03 3078 ret = true;
f6d6ae96576090 Borislav Petkov 2009-11-03 3079
f6d6ae96576090 Borislav Petkov 2009-11-03 3080 out:
f6d6ae96576090 Borislav Petkov 2009-11-03 3081 free_cpumask_var(mask);
f6d6ae96576090 Borislav Petkov 2009-11-03 3082 return ret;
f6d6ae96576090 Borislav Petkov 2009-11-03 3083 }
f6d6ae96576090 Borislav Petkov 2009-11-03 3084

:::::: The code at line 3065 was first introduced by commit
:::::: f6d6ae965760906d79ab29bc38507608c5971549 amd64_edac: unify MCGCTL ECC switching

:::::: TO: Borislav Petkov <borislav.petkov@xxxxxxx>
:::::: CC: Borislav Petkov <borislav.petkov@xxxxxxx>

---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@xxxxxxxxxxxx

Attachment: .config.gz
Description: application/gzip