[arm-integrator:kernel-in-vmalloc-v5.18-rc1 31/34] arch/x86/xen/enlighten_pv.c:456:27: sparse: sparse: incorrect type in argument 1 (different base types)
From: kernel test robot
Date: Sun Jun 05 2022 - 03:26:43 EST
tree: https://git.kernel.org/pub/scm/linux/kernel/git/linusw/linux-integrator.git kernel-in-vmalloc-v5.18-rc1
head: 1aafd4ba7b78b4ac0013a48a35252654852cb7ab
commit: 43bd244c8a76e91d6f02c0fc3212069609bd9645 [31/34] x86/xen: Make virt_to_pfn() a static inline
config: x86_64-randconfig-s021 (https://download.01.org/0day-ci/archive/20220605/202206051518.CDqaUSMi-lkp@xxxxxxxxx/config)
compiler: gcc-11 (Debian 11.3.0-1) 11.3.0
reproduce:
# apt-get install sparse
# sparse version: v0.6.4-18-g56afb504-dirty
# https://git.kernel.org/pub/scm/linux/kernel/git/linusw/linux-integrator.git/commit/?id=43bd244c8a76e91d6f02c0fc3212069609bd9645
git remote add arm-integrator https://git.kernel.org/pub/scm/linux/kernel/git/linusw/linux-integrator.git
git fetch --no-tags arm-integrator kernel-in-vmalloc-v5.18-rc1
git checkout 43bd244c8a76e91d6f02c0fc3212069609bd9645
# 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/
If you fix the issue, kindly add following tag where applicable
Reported-by: kernel test robot <lkp@xxxxxxxxx>
sparse warnings: (new ones prefixed by >>)
>> arch/x86/xen/enlighten_pv.c:456:27: sparse: sparse: incorrect type in argument 1 (different base types) @@ expected void const *v @@ got unsigned long va @@
arch/x86/xen/enlighten_pv.c:456:27: sparse: expected void const *v
arch/x86/xen/enlighten_pv.c:456:27: sparse: got unsigned long va
--
>> 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
arch/x86/xen/setup.c:504:20: sparse: sparse: incorrect type in argument 1 (different base types) @@ expected void const *v @@ got unsigned long buf @@
arch/x86/xen/setup.c:504:20: sparse: expected void const *v
arch/x86/xen/setup.c:504:20: sparse: got unsigned long buf
--
>> arch/x86/xen/mmu_pv.c:2196:40: sparse: sparse: incorrect type in argument 1 (different base types) @@ expected void const *v @@ got unsigned long vaddr @@
arch/x86/xen/mmu_pv.c:2196:40: sparse: expected void const *v
arch/x86/xen/mmu_pv.c:2196:40: sparse: got unsigned long vaddr
arch/x86/xen/mmu_pv.c:2199:51: sparse: sparse: incorrect type in argument 1 (different base types) @@ expected void const *v @@ got unsigned long vaddr @@
arch/x86/xen/mmu_pv.c:2199:51: sparse: expected void const *v
arch/x86/xen/mmu_pv.c:2199:51: sparse: got unsigned long vaddr
arch/x86/xen/mmu_pv.c:2202:53: sparse: sparse: incorrect type in argument 1 (different base types) @@ expected void const *v @@ got unsigned long vaddr @@
arch/x86/xen/mmu_pv.c:2202:53: sparse: expected void const *v
arch/x86/xen/mmu_pv.c:2202:53: sparse: got unsigned long vaddr
arch/x86/xen/mmu_pv.c:2244:49: sparse: sparse: incorrect type in argument 1 (different base types) @@ expected void const *v @@ got unsigned long vaddr @@
arch/x86/xen/mmu_pv.c:2244:49: sparse: expected void const *v
arch/x86/xen/mmu_pv.c:2244:49: sparse: got unsigned long vaddr
>> arch/x86/xen/mmu_pv.c:2321:33: sparse: sparse: incorrect type in argument 1 (different base types) @@ expected void const *v @@ got unsigned long vstart @@
arch/x86/xen/mmu_pv.c:2321:33: sparse: expected void const *v
arch/x86/xen/mmu_pv.c:2321:33: sparse: got unsigned long vstart
>> arch/x86/xen/mmu_pv.c:2354:20: sparse: sparse: incorrect type in argument 1 (different base types) @@ expected void const *v @@ got unsigned long [assigned] vstart @@
arch/x86/xen/mmu_pv.c:2354:20: sparse: expected void const *v
arch/x86/xen/mmu_pv.c:2354:20: sparse: got unsigned long [assigned] vstart
arch/x86/xen/mmu_pv.c:648:19: sparse: sparse: context imbalance in 'xen_pte_lock' - wrong count at exit
arch/x86/xen/mmu_pv.c:660:13: sparse: sparse: context imbalance in 'xen_pte_unlock' - unexpected unlock
vim +456 arch/x86/xen/enlighten_pv.c
e1dab14cf68d1e Vitaly Kuznetsov 2017-03-14 441
e1dab14cf68d1e Vitaly Kuznetsov 2017-03-14 442 /*
e1dab14cf68d1e Vitaly Kuznetsov 2017-03-14 443 * load_gdt for early boot, when the gdt is only mapped once
e1dab14cf68d1e Vitaly Kuznetsov 2017-03-14 444 */
e1dab14cf68d1e Vitaly Kuznetsov 2017-03-14 445 static void __init xen_load_gdt_boot(const struct desc_ptr *dtr)
e1dab14cf68d1e Vitaly Kuznetsov 2017-03-14 446 {
e1dab14cf68d1e Vitaly Kuznetsov 2017-03-14 447 unsigned long va = dtr->address;
e1dab14cf68d1e Vitaly Kuznetsov 2017-03-14 448 unsigned int size = dtr->size + 1;
eb0b4aa89cf21b Laura Abbott 2018-04-18 449 unsigned long pfn, mfn;
eb0b4aa89cf21b Laura Abbott 2018-04-18 450 pte_t pte;
e1dab14cf68d1e Vitaly Kuznetsov 2017-03-14 451
eb0b4aa89cf21b Laura Abbott 2018-04-18 452 /* @size should be at most GDT_SIZE which is smaller than PAGE_SIZE. */
eb0b4aa89cf21b Laura Abbott 2018-04-18 453 BUG_ON(size > PAGE_SIZE);
e1dab14cf68d1e Vitaly Kuznetsov 2017-03-14 454 BUG_ON(va & ~PAGE_MASK);
e1dab14cf68d1e Vitaly Kuznetsov 2017-03-14 455
e1dab14cf68d1e Vitaly Kuznetsov 2017-03-14 @456 pfn = virt_to_pfn(va);
e1dab14cf68d1e Vitaly Kuznetsov 2017-03-14 457 mfn = pfn_to_mfn(pfn);
e1dab14cf68d1e Vitaly Kuznetsov 2017-03-14 458
e1dab14cf68d1e Vitaly Kuznetsov 2017-03-14 459 pte = pfn_pte(pfn, PAGE_KERNEL_RO);
e1dab14cf68d1e Vitaly Kuznetsov 2017-03-14 460
e1dab14cf68d1e Vitaly Kuznetsov 2017-03-14 461 if (HYPERVISOR_update_va_mapping((unsigned long)va, pte, 0))
e1dab14cf68d1e Vitaly Kuznetsov 2017-03-14 462 BUG();
e1dab14cf68d1e Vitaly Kuznetsov 2017-03-14 463
eb0b4aa89cf21b Laura Abbott 2018-04-18 464 if (HYPERVISOR_set_gdt(&mfn, size / sizeof(struct desc_struct)))
e1dab14cf68d1e Vitaly Kuznetsov 2017-03-14 465 BUG();
e1dab14cf68d1e Vitaly Kuznetsov 2017-03-14 466 }
e1dab14cf68d1e Vitaly Kuznetsov 2017-03-14 467
:::::: The code at line 456 was first introduced by commit
:::::: e1dab14cf68d1e03950135969af3faf322f0db04 x86/xen: split off enlighten_pv.c
:::::: TO: Vitaly Kuznetsov <vkuznets@xxxxxxxxxx>
:::::: CC: Juergen Gross <jgross@xxxxxxxx>
--
0-DAY CI Kernel Test Service
https://01.org/lkp