From: kernel test robot <lkp@intel.com>
To: James Morse <james.morse@arm.com>
Cc: oe-kbuild-all@lists.linux.dev, linux-kernel@vger.kernel.org,
Catalin Marinas <catalin.marinas@arm.com>,
Jonathan Cameron <jonathan.cameron@huawei.com>,
Ben Horgan <ben.horgan@arm.com>, Fenghua Yu <fenghuay@nvidia.com>,
Gavin Shan <gshan@redhat.com>,
Shaopeng Tan <tan.shaopeng@jp.fujitsu.com>
Subject: drivers/resctrl/test_mpam_devices.c:9:42: sparse: sparse: incorrect type in initializer (different address spaces)
Date: Tue, 16 Dec 2025 01:59:47 +0800 [thread overview]
Message-ID: <202512160133.eAzPdJv2-lkp@intel.com> (raw)
tree: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head: 8f0b4cce4481fb22653697cced8d0d04027cb1e8
commit: e3565d1fd4dcf2c7ee6912094066e47c7500eaf2 arm_mpam: Add kunit test for bitmap reset
date: 4 weeks ago
config: arm64-randconfig-r133-20251215 (https://download.01.org/0day-ci/archive/20251216/202512160133.eAzPdJv2-lkp@intel.com/config)
compiler: aarch64-linux-gcc (GCC) 8.5.0
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20251216/202512160133.eAzPdJv2-lkp@intel.com/reproduce)
If you fix the issue in a separate patch/commit (i.e. not just a new version of
the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <lkp@intel.com>
| Closes: https://lore.kernel.org/oe-kbuild-all/202512160133.eAzPdJv2-lkp@intel.com/
sparse warnings: (new ones prefixed by >>)
drivers/resctrl/mpam_devices.c: note: in included file:
>> drivers/resctrl/test_mpam_devices.c:9:42: sparse: sparse: incorrect type in initializer (different address spaces) @@ expected char [noderef] __iomem *buf @@ got void * @@
drivers/resctrl/test_mpam_devices.c:9:42: sparse: expected char [noderef] __iomem *buf
drivers/resctrl/test_mpam_devices.c:9:42: sparse: got void *
>> drivers/resctrl/test_mpam_devices.c:24:24: sparse: sparse: cast removes address space '__iomem' of expression
drivers/resctrl/mpam_devices.c:271:5: sparse: sparse: context imbalance in 'mpam_register_requestor' - wrong count at exit
drivers/resctrl/mpam_devices.c:1218:9: sparse: sparse: context imbalance in '_msmon_read' - wrong count at exit
drivers/resctrl/mpam_devices.c:1281:6: sparse: sparse: context imbalance in 'mpam_msmon_reset_mbwu' - wrong count at exit
drivers/resctrl/mpam_devices.c:1632:9: sparse: sparse: context imbalance in 'mpam_cpu_online' - wrong count at exit
drivers/resctrl/mpam_devices.c:1705:9: sparse: sparse: context imbalance in 'mpam_cpu_offline' - wrong count at exit
drivers/resctrl/mpam_devices.c:2294:12: sparse: sparse: context imbalance in 'mpam_register_irqs' - wrong count at exit
drivers/resctrl/mpam_devices.c:2346:9: sparse: sparse: context imbalance in 'mpam_unregister_irqs' - wrong count at exit
drivers/resctrl/mpam_devices.c:2546:9: sparse: sparse: context imbalance in 'mpam_reset_component_locked' - wrong count at exit
drivers/resctrl/mpam_devices.c:2567:9: sparse: sparse: context imbalance in 'mpam_reset_class_locked' - wrong count at exit
drivers/resctrl/mpam_devices.c:2640:9: sparse: sparse: context imbalance in 'mpam_enable' - wrong count at exit
drivers/resctrl/mpam_devices.c:2666:5: sparse: sparse: context imbalance in 'mpam_apply_config' - wrong count at exit
vim +9 drivers/resctrl/test_mpam_devices.c
6
7 static void test_mpam_reset_msc_bitmap(struct kunit *test)
8 {
> 9 char __iomem *buf = kunit_kzalloc(test, SZ_16K, GFP_KERNEL);
10 struct mpam_msc fake_msc = {};
11 u32 *test_result;
12
13 if (!buf)
14 return;
15
16 fake_msc.mapped_hwpage = buf;
17 fake_msc.mapped_hwpage_sz = SZ_16K;
18 cpumask_copy(&fake_msc.accessibility, cpu_possible_mask);
19
20 /* Satisfy lockdep checks */
21 mutex_init(&fake_msc.part_sel_lock);
22 mutex_lock(&fake_msc.part_sel_lock);
23
> 24 test_result = (u32 *)(buf + MPAMCFG_CPBM);
25
26 mpam_reset_msc_bitmap(&fake_msc, MPAMCFG_CPBM, 0);
27 KUNIT_EXPECT_EQ(test, test_result[0], 0);
28 KUNIT_EXPECT_EQ(test, test_result[1], 0);
29 test_result[0] = 0;
30 test_result[1] = 0;
31
32 mpam_reset_msc_bitmap(&fake_msc, MPAMCFG_CPBM, 1);
33 KUNIT_EXPECT_EQ(test, test_result[0], 1);
34 KUNIT_EXPECT_EQ(test, test_result[1], 0);
35 test_result[0] = 0;
36 test_result[1] = 0;
37
38 mpam_reset_msc_bitmap(&fake_msc, MPAMCFG_CPBM, 16);
39 KUNIT_EXPECT_EQ(test, test_result[0], 0xffff);
40 KUNIT_EXPECT_EQ(test, test_result[1], 0);
41 test_result[0] = 0;
42 test_result[1] = 0;
43
44 mpam_reset_msc_bitmap(&fake_msc, MPAMCFG_CPBM, 32);
45 KUNIT_EXPECT_EQ(test, test_result[0], 0xffffffff);
46 KUNIT_EXPECT_EQ(test, test_result[1], 0);
47 test_result[0] = 0;
48 test_result[1] = 0;
49
50 mpam_reset_msc_bitmap(&fake_msc, MPAMCFG_CPBM, 33);
51 KUNIT_EXPECT_EQ(test, test_result[0], 0xffffffff);
52 KUNIT_EXPECT_EQ(test, test_result[1], 1);
53 test_result[0] = 0;
54 test_result[1] = 0;
55
56 mutex_unlock(&fake_msc.part_sel_lock);
57 }
58
--
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki
reply other threads:[~2025-12-15 18:01 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
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=202512160133.eAzPdJv2-lkp@intel.com \
--to=lkp@intel.com \
--cc=ben.horgan@arm.com \
--cc=catalin.marinas@arm.com \
--cc=fenghuay@nvidia.com \
--cc=gshan@redhat.com \
--cc=james.morse@arm.com \
--cc=jonathan.cameron@huawei.com \
--cc=linux-kernel@vger.kernel.org \
--cc=oe-kbuild-all@lists.linux.dev \
--cc=tan.shaopeng@jp.fujitsu.com \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox