[linux-next:master 5116/5396] mm/memory.c:710:25: sparse: sparse: cast to non-scalar

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



tree:   https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git master
head:   f6b46ef27317b3441138b902689bd89e4f82c6f4
commit: ce50e82c1d69532fc05721ed7951480c8525e7fd [5116/5396] mm: device exclusive memory access
config: alpha-randconfig-s032-20210526 (attached as .config)
compiler: alpha-linux-gcc (GCC) 9.3.0
reproduce:
        wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
        chmod +x ~/bin/make.cross
        # apt-get install sparse
        # sparse version: v0.6.3-341-g8af24329-dirty
        # https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git/commit/?id=ce50e82c1d69532fc05721ed7951480c8525e7fd
        git remote add linux-next https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git
        git fetch --no-tags linux-next master
        git checkout ce50e82c1d69532fc05721ed7951480c8525e7fd
        # save the attached .config to linux build tree
        COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-9.3.0 make.cross C=1 CF='-fdiagnostic-prefix -D__CHECK_ENDIAN__' W=1 ARCH=alpha 

If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@xxxxxxxxx>


sparse warnings: (new ones prefixed by >>)
>> mm/memory.c:710:25: sparse: sparse: cast to non-scalar
>> mm/memory.c:710:25: sparse: sparse: cast from non-scalar
   mm/memory.c:1024:17: sparse: sparse: context imbalance in 'copy_pte_range' - different lock contexts for basic block
   mm/memory.c:1721:16: sparse: sparse: context imbalance in '__get_locked_pte' - different lock contexts for basic block
   mm/memory.c:1770:9: sparse: sparse: context imbalance in 'insert_page' - different lock contexts for basic block
   mm/memory.c:2272:17: sparse: sparse: context imbalance in 'remap_pte_range' - different lock contexts for basic block
   mm/memory.c:2528:17: sparse: sparse: context imbalance in 'apply_to_pte_range' - unexpected unlock
   mm/memory.c:2816:17: sparse: sparse: context imbalance in 'wp_page_copy' - unexpected unlock
   mm/memory.c:3162:17: sparse: sparse: context imbalance in 'wp_pfn_shared' - unexpected unlock
   mm/memory.c:3225:19: sparse: sparse: context imbalance in 'do_wp_page' - different lock contexts for basic block
   mm/memory.c: note: in included file (through include/linux/mm.h, arch/alpha/include/asm/io.h, include/linux/io.h, include/linux/irq.h, ...):
   include/linux/pgtable.h:257:16: sparse: sparse: cast to non-scalar
   include/linux/pgtable.h:257:16: sparse: sparse: cast from non-scalar
   mm/memory.c:4823:5: sparse: sparse: context imbalance in 'follow_invalidate_pte' - different lock contexts for basic block
   mm/memory.c:4944:9: sparse: sparse: context imbalance in 'follow_pfn' - unexpected unlock

vim +710 mm/memory.c

   702	
   703	static void restore_exclusive_pte(struct vm_area_struct *vma,
   704					  struct page *page, unsigned long address,
   705					  pte_t *ptep)
   706	{
   707		pte_t pte;
   708		swp_entry_t entry;
   709	
 > 710		pte = pte_mkold(mk_pte(page, READ_ONCE(vma->vm_page_prot)));
   711		if (pte_swp_soft_dirty(*ptep))
   712			pte = pte_mksoft_dirty(pte);
   713	
   714		entry = pte_to_swp_entry(*ptep);
   715		if (pte_swp_uffd_wp(*ptep))
   716			pte = pte_mkuffd_wp(pte);
   717		else if (is_writable_device_exclusive_entry(entry))
   718			pte = maybe_mkwrite(pte_mkdirty(pte), vma);
   719	
   720		set_pte_at(vma->vm_mm, address, ptep, pte);
   721	
   722		/*
   723		 * No need to take a page reference as one was already
   724		 * created when the swap entry was made.
   725		 */
   726		if (PageAnon(page))
   727			page_add_anon_rmap(page, vma, address, false);
   728		else
   729			/*
   730			 * Currently device exclusive access only supports anonymous
   731			 * memory so the entry shouldn't point to a filebacked page.
   732			 */
   733			WARN_ON_ONCE(!PageAnon(page));
   734	
   735		if (vma->vm_flags & VM_LOCKED)
   736			mlock_vma_page(page);
   737	
   738		/*
   739		 * No need to invalidate - it was non-present before. However
   740		 * secondary CPUs may have mappings that need invalidating.
   741		 */
   742		update_mmu_cache(vma, address, ptep);
   743	}
   744	

---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@xxxxxxxxxxxx

Attachment: .config.gz
Description: application/gzip


[Index of Archives]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Bugtraq]     [Linux OMAP]     [Linux MIPS]     [eCos]     [Asterisk Internet PBX]     [Linux API]

  Powered by Linux