lkml.org 
[lkml]   [2022]   [Aug]   [30]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
Subject[arm-integrator:virt-to-pfn-v6.0-rc1 24/24] arch/x86/xen/setup.c:341:20: sparse: sparse: incorrect type in argument 1 (different base types)
tree:   https://git.kernel.org/pub/scm/linux/kernel/git/linusw/linux-integrator.git virt-to-pfn-v6.0-rc1
head: fd7709c9f1119794e96665ae423d79d93bfe43fc
commit: fd7709c9f1119794e96665ae423d79d93bfe43fc [24/24] x86/xen: Make virt_to_pfn() a static inline
config: x86_64-randconfig-s022 (https://download.01.org/0day-ci/archive/20220830/202208301933.EfJXBgQg-lkp@intel.com/config)
compiler: gcc-11 (Debian 11.3.0-5) 11.3.0
reproduce:
# apt-get install sparse
# sparse version: v0.6.4-39-gce1a6720-dirty
# https://git.kernel.org/pub/scm/linux/kernel/git/linusw/linux-integrator.git/commit/?id=fd7709c9f1119794e96665ae423d79d93bfe43fc
git remote add arm-integrator https://git.kernel.org/pub/scm/linux/kernel/git/linusw/linux-integrator.git
git fetch --no-tags arm-integrator virt-to-pfn-v6.0-rc1
git checkout fd7709c9f1119794e96665ae423d79d93bfe43fc
# save the config file
mkdir build_dir && cp config build_dir/.config
make W=1 C=1 CF='-fdiagnostic-prefix -D__CHECK_ENDIAN__' O=build_dir ARCH=x86_64 SHELL=/bin/bash arch/x86/xen/ drivers/pci/

If you fix the issue, kindly add following tag where applicable
Reported-by: kernel test robot <lkp@intel.com>

sparse warnings: (new ones prefixed by >>)
>> arch/x86/xen/setup.c:341:20: sparse: sparse: incorrect type in argument 1 (different base types) @@ expected void const *v @@ got unsigned long buf @@
arch/x86/xen/setup.c:341:20: sparse: expected void const *v
arch/x86/xen/setup.c:341:20: sparse: got unsigned long buf

vim +341 arch/x86/xen/setup.c

83d51ab473dddd David Vrabel 2012-05-03 316
83d51ab473dddd David Vrabel 2012-05-03 317 /*
4fbb67e3c87b80 Matt Rushton 2014-08-11 318 * This function updates the p2m and m2p tables with an identity map from
1f3ac86b4c45a1 Juergen Gross 2014-11-28 319 * start_pfn to start_pfn+size and prepares remapping the underlying RAM of the
1f3ac86b4c45a1 Juergen Gross 2014-11-28 320 * original allocation at remap_pfn. The information needed for remapping is
1f3ac86b4c45a1 Juergen Gross 2014-11-28 321 * saved in the memory itself to avoid the need for allocating buffers. The
1f3ac86b4c45a1 Juergen Gross 2014-11-28 322 * complete remap information is contained in a list of MFNs each containing
1f3ac86b4c45a1 Juergen Gross 2014-11-28 323 * up to REMAP_SIZE MFNs and the start target PFN for doing the remap.
1f3ac86b4c45a1 Juergen Gross 2014-11-28 324 * This enables us to preserve the original mfn sequence while doing the
1f3ac86b4c45a1 Juergen Gross 2014-11-28 325 * remapping at a time when the memory management is capable of allocating
1f3ac86b4c45a1 Juergen Gross 2014-11-28 326 * virtual and physical memory in arbitrary amounts, see 'xen_remap_memory' and
1f3ac86b4c45a1 Juergen Gross 2014-11-28 327 * its callers.
83d51ab473dddd David Vrabel 2012-05-03 328 */
1f3ac86b4c45a1 Juergen Gross 2014-11-28 329 static void __init xen_do_set_identity_and_remap_chunk(
4fbb67e3c87b80 Matt Rushton 2014-08-11 330 unsigned long start_pfn, unsigned long size, unsigned long remap_pfn)
4fbb67e3c87b80 Matt Rushton 2014-08-11 331 {
1f3ac86b4c45a1 Juergen Gross 2014-11-28 332 unsigned long buf = (unsigned long)&xen_remap_buf;
1f3ac86b4c45a1 Juergen Gross 2014-11-28 333 unsigned long mfn_save, mfn;
4fbb67e3c87b80 Matt Rushton 2014-08-11 334 unsigned long ident_pfn_iter, remap_pfn_iter;
1f3ac86b4c45a1 Juergen Gross 2014-11-28 335 unsigned long ident_end_pfn = start_pfn + size;
4fbb67e3c87b80 Matt Rushton 2014-08-11 336 unsigned long left = size;
1f3ac86b4c45a1 Juergen Gross 2014-11-28 337 unsigned int i, chunk;
e201bfcc5c4fe6 David Vrabel 2013-07-22 338
4fbb67e3c87b80 Matt Rushton 2014-08-11 339 WARN_ON(size == 0);
e201bfcc5c4fe6 David Vrabel 2013-07-22 340
1f3ac86b4c45a1 Juergen Gross 2014-11-28 @341 mfn_save = virt_to_mfn(buf);
4fbb67e3c87b80 Matt Rushton 2014-08-11 342
1f3ac86b4c45a1 Juergen Gross 2014-11-28 343 for (ident_pfn_iter = start_pfn, remap_pfn_iter = remap_pfn;
1f3ac86b4c45a1 Juergen Gross 2014-11-28 344 ident_pfn_iter < ident_end_pfn;
1f3ac86b4c45a1 Juergen Gross 2014-11-28 345 ident_pfn_iter += REMAP_SIZE, remap_pfn_iter += REMAP_SIZE) {
1f3ac86b4c45a1 Juergen Gross 2014-11-28 346 chunk = (left < REMAP_SIZE) ? left : REMAP_SIZE;
4fbb67e3c87b80 Matt Rushton 2014-08-11 347
1f3ac86b4c45a1 Juergen Gross 2014-11-28 348 /* Map first pfn to xen_remap_buf */
1f3ac86b4c45a1 Juergen Gross 2014-11-28 349 mfn = pfn_to_mfn(ident_pfn_iter);
1f3ac86b4c45a1 Juergen Gross 2014-11-28 350 set_pte_mfn(buf, mfn, PAGE_KERNEL);
4fbb67e3c87b80 Matt Rushton 2014-08-11 351
1f3ac86b4c45a1 Juergen Gross 2014-11-28 352 /* Save mapping information in page */
1f3ac86b4c45a1 Juergen Gross 2014-11-28 353 xen_remap_buf.next_area_mfn = xen_remap_mfn;
1f3ac86b4c45a1 Juergen Gross 2014-11-28 354 xen_remap_buf.target_pfn = remap_pfn_iter;
1f3ac86b4c45a1 Juergen Gross 2014-11-28 355 xen_remap_buf.size = chunk;
1f3ac86b4c45a1 Juergen Gross 2014-11-28 356 for (i = 0; i < chunk; i++)
1f3ac86b4c45a1 Juergen Gross 2014-11-28 357 xen_remap_buf.mfns[i] = pfn_to_mfn(ident_pfn_iter + i);
4fbb67e3c87b80 Matt Rushton 2014-08-11 358
1f3ac86b4c45a1 Juergen Gross 2014-11-28 359 /* Put remap buf into list. */
1f3ac86b4c45a1 Juergen Gross 2014-11-28 360 xen_remap_mfn = mfn;
4fbb67e3c87b80 Matt Rushton 2014-08-11 361
1f3ac86b4c45a1 Juergen Gross 2014-11-28 362 /* Set identity map */
bc7142cf798ae7 David Vrabel 2015-01-07 363 set_phys_range_identity(ident_pfn_iter, ident_pfn_iter + chunk);
4fbb67e3c87b80 Matt Rushton 2014-08-11 364
1f3ac86b4c45a1 Juergen Gross 2014-11-28 365 left -= chunk;
1f3ac86b4c45a1 Juergen Gross 2014-11-28 366 }
4fbb67e3c87b80 Matt Rushton 2014-08-11 367
1f3ac86b4c45a1 Juergen Gross 2014-11-28 368 /* Restore old xen_remap_buf mapping */
1f3ac86b4c45a1 Juergen Gross 2014-11-28 369 set_pte_mfn(buf, mfn_save, PAGE_KERNEL);
4fbb67e3c87b80 Matt Rushton 2014-08-11 370 }
4fbb67e3c87b80 Matt Rushton 2014-08-11 371

:::::: The code at line 341 was first introduced by commit
:::::: 1f3ac86b4c45a146e090d24bf66c49b95e72f071 xen: Delay remapping memory of pv-domain

:::::: TO: Juergen Gross <jgross@suse.com>
:::::: CC: David Vrabel <david.vrabel@citrix.com>

--
0-DAY CI Kernel Test Service
https://01.org/lkp

\
 
 \ /
  Last update: 2022-08-30 13:40    [W:0.033 / U:0.076 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site