From: kernel test robot <lkp@intel.com>
To: Michael Kelley <mikelley@microsoft.com>
Cc: kbuild-all@lists.01.org, linux-kernel@vger.kernel.org,
Wei Liu <wei.liu@kernel.org>
Subject: drivers/hv/hv_common.c:61:21: sparse: sparse: incorrect type in argument 1 (different address spaces)
Date: Mon, 6 Dec 2021 16:28:49 +0800 [thread overview]
Message-ID: <202112061646.kfEhMbff-lkp@intel.com> (raw)
tree: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head: 0fcfb00b28c0b7884635dacf38e46d60bf3d4eb1
commit: afca4d95dd7d7936d46a0ff02169cc40f534a6a3 Drivers: hv: Make portions of Hyper-V init code be arch neutral
date: 5 months ago
config: x86_64-randconfig-s022-20211206 (https://download.01.org/0day-ci/archive/20211206/202112061646.kfEhMbff-lkp@intel.com/config)
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/torvalds/linux.git/commit/?id=afca4d95dd7d7936d46a0ff02169cc40f534a6a3
git remote add linus https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
git fetch --no-tags linus master
git checkout afca4d95dd7d7936d46a0ff02169cc40f534a6a3
# 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=x86_64 SHELL=/bin/bash drivers/hv/
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/hv/hv_common.c:61:21: sparse: sparse: incorrect type in argument 1 (different address spaces) @@ expected void [noderef] __percpu *__pdata @@ got void [noderef] __percpu **[addressable] [toplevel] hyperv_pcpu_output_arg @@
drivers/hv/hv_common.c:61:21: sparse: expected void [noderef] __percpu *__pdata
drivers/hv/hv_common.c:61:21: sparse: got void [noderef] __percpu **[addressable] [toplevel] hyperv_pcpu_output_arg
>> drivers/hv/hv_common.c:64:21: sparse: sparse: incorrect type in argument 1 (different address spaces) @@ expected void [noderef] __percpu *__pdata @@ got void [noderef] __percpu **[addressable] [toplevel] hyperv_pcpu_input_arg @@
drivers/hv/hv_common.c:64:21: sparse: expected void [noderef] __percpu *__pdata
drivers/hv/hv_common.c:64:21: sparse: got void [noderef] __percpu **[addressable] [toplevel] hyperv_pcpu_input_arg
>> drivers/hv/hv_common.c:78:31: sparse: sparse: incorrect type in assignment (different address spaces) @@ expected void [noderef] __percpu **[addressable] [assigned] [toplevel] hyperv_pcpu_input_arg @@ got void *[noderef] __percpu * @@
drivers/hv/hv_common.c:78:31: sparse: expected void [noderef] __percpu **[addressable] [assigned] [toplevel] hyperv_pcpu_input_arg
drivers/hv/hv_common.c:78:31: sparse: got void *[noderef] __percpu *
>> drivers/hv/hv_common.c:83:40: sparse: sparse: incorrect type in assignment (different address spaces) @@ expected void [noderef] __percpu **[addressable] [assigned] [toplevel] hyperv_pcpu_output_arg @@ got void *[noderef] __percpu * @@
drivers/hv/hv_common.c:83:40: sparse: expected void [noderef] __percpu **[addressable] [assigned] [toplevel] hyperv_pcpu_output_arg
drivers/hv/hv_common.c:83:40: sparse: got void *[noderef] __percpu *
drivers/hv/hv_common.c:116:29: sparse: sparse: incorrect type in initializer (different address spaces) @@ expected void const [noderef] __percpu *__vpp_verify @@ got void [noderef] __percpu ** @@
drivers/hv/hv_common.c:116:29: sparse: expected void const [noderef] __percpu *__vpp_verify
drivers/hv/hv_common.c:116:29: sparse: got void [noderef] __percpu **
drivers/hv/hv_common.c:122:38: sparse: sparse: incorrect type in initializer (different address spaces) @@ expected void const [noderef] __percpu *__vpp_verify @@ got void [noderef] __percpu ** @@
drivers/hv/hv_common.c:122:38: sparse: expected void const [noderef] __percpu *__vpp_verify
drivers/hv/hv_common.c:122:38: sparse: got void [noderef] __percpu **
drivers/hv/hv_common.c:144:29: sparse: sparse: incorrect type in initializer (different address spaces) @@ expected void const [noderef] __percpu *__vpp_verify @@ got void [noderef] __percpu ** @@
drivers/hv/hv_common.c:144:29: sparse: expected void const [noderef] __percpu *__vpp_verify
drivers/hv/hv_common.c:144:29: sparse: got void [noderef] __percpu **
drivers/hv/hv_common.c:149:38: sparse: sparse: incorrect type in initializer (different address spaces) @@ expected void const [noderef] __percpu *__vpp_verify @@ got void [noderef] __percpu ** @@
drivers/hv/hv_common.c:149:38: sparse: expected void const [noderef] __percpu *__vpp_verify
drivers/hv/hv_common.c:149:38: sparse: got void [noderef] __percpu **
vim +61 drivers/hv/hv_common.c
49
50 /*
51 * Hyper-V specific initialization and shutdown code that is
52 * common across all architectures. Called from architecture
53 * specific initialization functions.
54 */
55
56 void __init hv_common_free(void)
57 {
58 kfree(hv_vp_index);
59 hv_vp_index = NULL;
60
> 61 free_percpu(hyperv_pcpu_output_arg);
62 hyperv_pcpu_output_arg = NULL;
63
> 64 free_percpu(hyperv_pcpu_input_arg);
65 hyperv_pcpu_input_arg = NULL;
66 }
67
68 int __init hv_common_init(void)
69 {
70 int i;
71
72 /*
73 * Allocate the per-CPU state for the hypercall input arg.
74 * If this allocation fails, we will not be able to setup
75 * (per-CPU) hypercall input page and thus this failure is
76 * fatal on Hyper-V.
77 */
> 78 hyperv_pcpu_input_arg = alloc_percpu(void *);
79 BUG_ON(!hyperv_pcpu_input_arg);
80
81 /* Allocate the per-CPU state for output arg for root */
82 if (hv_root_partition) {
> 83 hyperv_pcpu_output_arg = alloc_percpu(void *);
84 BUG_ON(!hyperv_pcpu_output_arg);
85 }
86
87 hv_vp_index = kmalloc_array(num_possible_cpus(), sizeof(*hv_vp_index),
88 GFP_KERNEL);
89 if (!hv_vp_index) {
90 hv_common_free();
91 return -ENOMEM;
92 }
93
94 for (i = 0; i < num_possible_cpus(); i++)
95 hv_vp_index[i] = VP_INVAL;
96
97 return 0;
98 }
99
---
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-06 8:29 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-12-06 8:28 kernel test robot [this message]
-- strict thread matches above, loose matches on Subject: below --
2021-12-06 18:51 drivers/hv/hv_common.c:61:21: sparse: sparse: incorrect type in argument 1 (different address spaces) kernel test robot
2021-11-09 7:18 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=202112061646.kfEhMbff-lkp@intel.com \
--to=lkp@intel.com \
--cc=kbuild-all@lists.01.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mikelley@microsoft.com \
--cc=wei.liu@kernel.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).