* [linux-next:master 13132/13536] arch/loongarch/kernel/relocate.c:212:24: sparse: sparse: incorrect type in argument 1 (different address spaces)
@ 2024-07-23 3:52 kernel test robot
0 siblings, 0 replies; only message in thread
From: kernel test robot @ 2024-07-23 3:52 UTC (permalink / raw)
To: Huacai Chen; +Cc: oe-kbuild-all, Linux Memory Management List, Jiaxun Yang
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
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2024-07-23 3:53 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-07-23 3:52 [linux-next:master 13132/13536] arch/loongarch/kernel/relocate.c:212:24: sparse: sparse: incorrect type in argument 1 (different address spaces) kernel test robot
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox