From: kernel test robot <lkp@intel.com>
To: Huacai Chen <chenhuacai@loongson.cn>
Cc: oe-kbuild-all@lists.linux.dev,
Linux Memory Management List <linux-mm@kvack.org>,
Jiaxun Yang <jiaxun.yang@flygoat.com>
Subject: [linux-next:master 13132/13536] arch/loongarch/kernel/relocate.c:212:24: sparse: sparse: incorrect type in argument 1 (different address spaces)
Date: Tue, 23 Jul 2024 11:52:58 +0800 [thread overview]
Message-ID: <202407231154.QJTaxbpZ-lkp@intel.com> (raw)
tree: https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git master
head: dee7f101b64219f512bb2f842227bd04c14efe30
commit: 2d974d2671121272dbe8142e11c6a5ec28123d21 [13132/13536] LoongArch: Use correct API to map cmdline in relocate_kernel()
config: loongarch-randconfig-r122-20240722 (https://download.01.org/0day-ci/archive/20240723/202407231154.QJTaxbpZ-lkp@intel.com/config)
compiler: loongarch64-linux-gcc (GCC) 14.1.0
reproduce: (https://download.01.org/0day-ci/archive/20240723/202407231154.QJTaxbpZ-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/202407231154.QJTaxbpZ-lkp@intel.com/
sparse warnings: (new ones prefixed by >>)
>> arch/loongarch/kernel/relocate.c:212:24: sparse: sparse: incorrect type in argument 1 (different address spaces) @@ expected void [noderef] __iomem *addr @@ got char *cmdline @@
arch/loongarch/kernel/relocate.c:212:24: sparse: expected void [noderef] __iomem *addr
arch/loongarch/kernel/relocate.c:212:24: sparse: got char *cmdline
vim +212 arch/loongarch/kernel/relocate.c
194
195 unsigned long __init relocate_kernel(void)
196 {
197 unsigned long kernel_length;
198 unsigned long random_offset = 0;
199 void *location_new = _text; /* Default to original kernel start */
200 char *cmdline = early_memremap_ro(fw_arg1, COMMAND_LINE_SIZE); /* Boot command line is passed in fw_arg1 */
201
202 strscpy(boot_command_line, cmdline, COMMAND_LINE_SIZE);
203
204 #ifdef CONFIG_RANDOMIZE_BASE
205 location_new = determine_relocation_address();
206
207 /* Sanity check relocation address */
208 if (relocation_addr_valid(location_new))
209 random_offset = (unsigned long)location_new - (unsigned long)(_text);
210 #endif
211 reloc_offset = (unsigned long)_text - VMLINUX_LOAD_ADDRESS;
> 212 early_memunmap(cmdline, COMMAND_LINE_SIZE);
213
214 if (random_offset) {
215 kernel_length = (long)(_end) - (long)(_text);
216
217 /* Copy the kernel to it's new location */
218 memcpy(location_new, _text, kernel_length);
219
220 /* Sync the caches ready for execution of new kernel */
221 __asm__ __volatile__ (
222 "ibar 0 \t\n"
223 "dbar 0 \t\n"
224 ::: "memory");
225
226 reloc_offset += random_offset;
227
228 /* The current thread is now within the relocated kernel */
229 __current_thread_info = RELOCATED_KASLR(__current_thread_info);
230
231 update_reloc_offset(&reloc_offset, random_offset);
232 }
233
234 if (reloc_offset)
235 relocate_relative();
236
237 relocate_absolute(random_offset);
238
239 return random_offset;
240 }
241
--
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki
reply other threads:[~2024-07-23 3:53 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=202407231154.QJTaxbpZ-lkp@intel.com \
--to=lkp@intel.com \
--cc=chenhuacai@loongson.cn \
--cc=jiaxun.yang@flygoat.com \
--cc=linux-mm@kvack.org \
--cc=oe-kbuild-all@lists.linux.dev \
/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