All of lore.kernel.org
 help / color / mirror / Atom feed
* mm/memory.c:709:25: sparse: sparse: cast to non-scalar
@ 2022-01-01  5:39 ` kernel test robot
  0 siblings, 0 replies; 8+ messages in thread
From: kernel test robot @ 2022-01-01  5:39 UTC (permalink / raw)
  To: Alistair Popple
  Cc: kbuild-all, linux-kernel, Dan Carpenter, Christoph Hellwig,
	Andrew Morton, Linux Memory Management List

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head:   8008293888188c3923f5bd8a69370dae25ed14e5
commit: b756a3b5e7ead8f6f4b03cea8ac22478ce04c8a8 mm: device exclusive memory access
date:   6 months ago
config: alpha-randconfig-s031-20211122 (https://download.01.org/0day-ci/archive/20220101/202201011331.H1OV6bX5-lkp@intel.com/config)
compiler: alpha-linux-gcc (GCC) 11.2.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.4-dirty
        # https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=b756a3b5e7ead8f6f4b03cea8ac22478ce04c8a8
        git remote add linus https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
        git fetch --no-tags linus master
        git checkout b756a3b5e7ead8f6f4b03cea8ac22478ce04c8a8
        # save the config file to linux build tree
        mkdir build_dir
        COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-11.2.0 make.cross C=1 CF='-fdiagnostic-prefix -D__CHECK_ENDIAN__' O=build_dir ARCH=alpha SHELL=/bin/bash

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


sparse warnings: (new ones prefixed by >>)
>> mm/memory.c:709:25: sparse: sparse: cast to non-scalar
>> mm/memory.c:709:25: sparse: sparse: cast from non-scalar
   mm/memory.c:1023:17: sparse: sparse: context imbalance in 'copy_pte_range' - different lock contexts for basic block
   mm/memory.c:1736:16: sparse: sparse: context imbalance in '__get_locked_pte' - different lock contexts for basic block
   mm/memory.c:1785:9: sparse: sparse: context imbalance in 'insert_page' - different lock contexts for basic block
   mm/memory.c:2287:17: sparse: sparse: context imbalance in 'remap_pte_range' - different lock contexts for basic block
   mm/memory.c:2543:17: sparse: sparse: context imbalance in 'apply_to_pte_range' - unexpected unlock
   mm/memory.c:2831:17: sparse: sparse: context imbalance in 'wp_page_copy' - unexpected unlock
   mm/memory.c:3180:17: sparse: sparse: context imbalance in 'wp_pfn_shared' - unexpected unlock
   mm/memory.c:3243: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:275:16: sparse: sparse: cast to non-scalar
   include/linux/pgtable.h:275:16: sparse: sparse: cast from non-scalar
   mm/memory.c:4874:5: sparse: sparse: context imbalance in 'follow_invalidate_pte' - different lock contexts for basic block
   mm/memory.c:4995:9: sparse: sparse: context imbalance in 'follow_pfn' - unexpected unlock

vim +709 mm/memory.c

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

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

^ permalink raw reply	[flat|nested] 8+ messages in thread

* mm/memory.c:709:25: sparse: sparse: cast to non-scalar
@ 2022-01-01  5:39 ` kernel test robot
  0 siblings, 0 replies; 8+ messages in thread
From: kernel test robot @ 2022-01-01  5:39 UTC (permalink / raw)
  To: kbuild-all

[-- Attachment #1: Type: text/plain, Size: 4504 bytes --]

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head:   8008293888188c3923f5bd8a69370dae25ed14e5
commit: b756a3b5e7ead8f6f4b03cea8ac22478ce04c8a8 mm: device exclusive memory access
date:   6 months ago
config: alpha-randconfig-s031-20211122 (https://download.01.org/0day-ci/archive/20220101/202201011331.H1OV6bX5-lkp(a)intel.com/config)
compiler: alpha-linux-gcc (GCC) 11.2.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.4-dirty
        # https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=b756a3b5e7ead8f6f4b03cea8ac22478ce04c8a8
        git remote add linus https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
        git fetch --no-tags linus master
        git checkout b756a3b5e7ead8f6f4b03cea8ac22478ce04c8a8
        # save the config file to linux build tree
        mkdir build_dir
        COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-11.2.0 make.cross C=1 CF='-fdiagnostic-prefix -D__CHECK_ENDIAN__' O=build_dir ARCH=alpha SHELL=/bin/bash

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


sparse warnings: (new ones prefixed by >>)
>> mm/memory.c:709:25: sparse: sparse: cast to non-scalar
>> mm/memory.c:709:25: sparse: sparse: cast from non-scalar
   mm/memory.c:1023:17: sparse: sparse: context imbalance in 'copy_pte_range' - different lock contexts for basic block
   mm/memory.c:1736:16: sparse: sparse: context imbalance in '__get_locked_pte' - different lock contexts for basic block
   mm/memory.c:1785:9: sparse: sparse: context imbalance in 'insert_page' - different lock contexts for basic block
   mm/memory.c:2287:17: sparse: sparse: context imbalance in 'remap_pte_range' - different lock contexts for basic block
   mm/memory.c:2543:17: sparse: sparse: context imbalance in 'apply_to_pte_range' - unexpected unlock
   mm/memory.c:2831:17: sparse: sparse: context imbalance in 'wp_page_copy' - unexpected unlock
   mm/memory.c:3180:17: sparse: sparse: context imbalance in 'wp_pfn_shared' - unexpected unlock
   mm/memory.c:3243: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:275:16: sparse: sparse: cast to non-scalar
   include/linux/pgtable.h:275:16: sparse: sparse: cast from non-scalar
   mm/memory.c:4874:5: sparse: sparse: context imbalance in 'follow_invalidate_pte' - different lock contexts for basic block
   mm/memory.c:4995:9: sparse: sparse: context imbalance in 'follow_pfn' - unexpected unlock

vim +709 mm/memory.c

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

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

^ permalink raw reply	[flat|nested] 8+ messages in thread

* mm/memory.c:709:25: sparse: sparse: cast to non-scalar
@ 2023-12-10 21:44 kernel test robot
  0 siblings, 0 replies; 8+ messages in thread
From: kernel test robot @ 2023-12-10 21:44 UTC (permalink / raw)
  To: oe-kbuild; +Cc: lkp

:::::: 
:::::: Manual check reason: "low confidence static check warning: mm/memory.c:709:25: sparse: sparse: cast to non-scalar"
:::::: 

BCC: lkp@intel.com
CC: oe-kbuild-all@lists.linux.dev
CC: linux-kernel@vger.kernel.org
TO: Alistair Popple <apopple@nvidia.com>
CC: Dan Carpenter <error27@gmail.com>
CC: Christoph Hellwig <hch@lst.de>
CC: Andrew Morton <akpm@linux-foundation.org>
CC: Linux Memory Management List <linux-mm@kvack.org>

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head:   3a87498869d6d1e7347cd01f337a77984604eb5e
commit: b756a3b5e7ead8f6f4b03cea8ac22478ce04c8a8 mm: device exclusive memory access
date:   2 years, 5 months ago
:::::: branch date: 3 hours ago
:::::: commit date: 2 years, 5 months ago
config: alpha-randconfig-r131-20231116 (https://download.01.org/0day-ci/archive/20231211/202312110527.2ixYcotR-lkp@intel.com/config)
compiler: alpha-linux-gcc (GCC) 13.2.0
reproduce: (https://download.01.org/0day-ci/archive/20231211/202312110527.2ixYcotR-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/r/202312110527.2ixYcotR-lkp@intel.com/

sparse warnings: (new ones prefixed by >>)
>> mm/memory.c:709:25: sparse: sparse: cast to non-scalar
>> mm/memory.c:709:25: sparse: sparse: cast from non-scalar
   mm/memory.c:284:46: sparse: sparse: self-comparison always evaluates to false
   mm/memory.c:318:46: sparse: sparse: self-comparison always evaluates to false
   mm/memory.c:1023:17: sparse: sparse: context imbalance in 'copy_pte_range' - different lock contexts for basic block
   mm/memory.c:1196:61: sparse: sparse: self-comparison always evaluates to false
   mm/memory.c:1220:61: sparse: sparse: self-comparison always evaluates to false
   mm/memory.c:1736:16: sparse: sparse: context imbalance in '__get_locked_pte' - different lock contexts for basic block
   mm/memory.c:1785:9: sparse: sparse: context imbalance in 'insert_page' - different lock contexts for basic block
   mm/memory.c:2287:17: sparse: sparse: context imbalance in 'remap_pte_range' - different lock contexts for basic block
   mm/memory.c:2344:46: sparse: sparse: self-comparison always evaluates to false
   mm/memory.c:2366:46: sparse: sparse: self-comparison always evaluates to false
   mm/memory.c:2543:17: sparse: sparse: context imbalance in 'apply_to_pte_range' - unexpected unlock
   mm/memory.c:2616:46: sparse: sparse: self-comparison always evaluates to false
   mm/memory.c:2652:46: sparse: sparse: self-comparison always evaluates to false
   mm/memory.c:2831:17: sparse: sparse: context imbalance in 'wp_page_copy' - unexpected unlock
   mm/memory.c:3180:17: sparse: sparse: context imbalance in 'wp_pfn_shared' - unexpected unlock
   mm/memory.c:3243: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:275:16: sparse: sparse: cast to non-scalar
   include/linux/pgtable.h:275:16: sparse: sparse: cast from non-scalar
   mm/memory.c:4874:5: sparse: sparse: context imbalance in 'follow_invalidate_pte' - different lock contexts for basic block
   mm/memory.c:4995:9: sparse: sparse: context imbalance in 'follow_pfn' - unexpected unlock

vim +709 mm/memory.c

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

-- 
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki

^ permalink raw reply	[flat|nested] 8+ messages in thread

* mm/memory.c:709:25: sparse: sparse: cast to non-scalar
@ 2022-03-09  5:07 kernel test robot
  0 siblings, 0 replies; 8+ messages in thread
From: kernel test robot @ 2022-03-09  5:07 UTC (permalink / raw)
  To: Alistair Popple
  Cc: kbuild-all, linux-kernel, Dan Carpenter, Christoph Hellwig,
	Andrew Morton, Linux Memory Management List

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head:   330f4c53d3c2d8b11d86ec03a964b86dc81452f5
commit: b756a3b5e7ead8f6f4b03cea8ac22478ce04c8a8 mm: device exclusive memory access
date:   8 months ago
config: alpha-randconfig-s031-20220308 (https://download.01.org/0day-ci/archive/20220309/202203091301.CQlNi3CF-lkp@intel.com/config)
compiler: alpha-linux-gcc (GCC) 11.2.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.4-dirty
        # https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=b756a3b5e7ead8f6f4b03cea8ac22478ce04c8a8
        git remote add linus https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
        git fetch --no-tags linus master
        git checkout b756a3b5e7ead8f6f4b03cea8ac22478ce04c8a8
        # save the config file to linux build tree
        mkdir build_dir
        COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-11.2.0 make.cross C=1 CF='-fdiagnostic-prefix -D__CHECK_ENDIAN__' O=build_dir ARCH=alpha SHELL=/bin/bash

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


sparse warnings: (new ones prefixed by >>)
>> mm/memory.c:709:25: sparse: sparse: cast to non-scalar
>> mm/memory.c:709:25: sparse: sparse: cast from non-scalar
   mm/memory.c:1023:17: sparse: sparse: context imbalance in 'copy_pte_range' - different lock contexts for basic block
   mm/memory.c:1736:16: sparse: sparse: context imbalance in '__get_locked_pte' - different lock contexts for basic block
   mm/memory.c:1785:9: sparse: sparse: context imbalance in 'insert_page' - different lock contexts for basic block
   mm/memory.c:2287:17: sparse: sparse: context imbalance in 'remap_pte_range' - different lock contexts for basic block
   mm/memory.c:2543:17: sparse: sparse: context imbalance in 'apply_to_pte_range' - unexpected unlock
   mm/memory.c:2831:17: sparse: sparse: context imbalance in 'wp_page_copy' - unexpected unlock
   mm/memory.c:3180:17: sparse: sparse: context imbalance in 'wp_pfn_shared' - unexpected unlock
   mm/memory.c:3243: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:275:16: sparse: sparse: cast to non-scalar
   include/linux/pgtable.h:275:16: sparse: sparse: cast from non-scalar
   mm/memory.c:4874:5: sparse: sparse: context imbalance in 'follow_invalidate_pte' - different lock contexts for basic block
   mm/memory.c:4995:9: sparse: sparse: context imbalance in 'follow_pfn' - unexpected unlock

vim +709 mm/memory.c

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

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

^ permalink raw reply	[flat|nested] 8+ messages in thread

* mm/memory.c:709:25: sparse: sparse: cast to non-scalar
@ 2021-11-23 20:37 ` kernel test robot
  0 siblings, 0 replies; 8+ messages in thread
From: kernel test robot @ 2021-11-23 20:37 UTC (permalink / raw)
  To: Alistair Popple
  Cc: kbuild-all, linux-kernel, Dan Carpenter, Christoph Hellwig,
	Andrew Morton, Linux Memory Management List

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head:   136057256686de39cc3a07c2e39ef6bc43003ff6
commit: b756a3b5e7ead8f6f4b03cea8ac22478ce04c8a8 mm: device exclusive memory access
date:   5 months ago
config: alpha-randconfig-s031-20211122 (https://download.01.org/0day-ci/archive/20211124/202111240450.3z7aF31U-lkp@intel.com/config.gz)
compiler: alpha-linux-gcc (GCC) 11.2.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.4-dirty
        # https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=b756a3b5e7ead8f6f4b03cea8ac22478ce04c8a8
        git remote add linus https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
        git fetch --no-tags linus master
        git checkout b756a3b5e7ead8f6f4b03cea8ac22478ce04c8a8
        # save the config file to linux build tree
        COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-11.2.0 make.cross C=1 CF='-fdiagnostic-prefix -D__CHECK_ENDIAN__' O=build_dir ARCH=alpha SHELL=/bin/bash

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


sparse warnings: (new ones prefixed by >>)
>> mm/memory.c:709:25: sparse: sparse: cast to non-scalar
>> mm/memory.c:709:25: sparse: sparse: cast from non-scalar
   mm/memory.c:1023:17: sparse: sparse: context imbalance in 'copy_pte_range' - different lock contexts for basic block
   mm/memory.c:1736:16: sparse: sparse: context imbalance in '__get_locked_pte' - different lock contexts for basic block
   mm/memory.c:1785:9: sparse: sparse: context imbalance in 'insert_page' - different lock contexts for basic block
   mm/memory.c:2287:17: sparse: sparse: context imbalance in 'remap_pte_range' - different lock contexts for basic block
   mm/memory.c:2543:17: sparse: sparse: context imbalance in 'apply_to_pte_range' - unexpected unlock
   mm/memory.c:2831:17: sparse: sparse: context imbalance in 'wp_page_copy' - unexpected unlock
   mm/memory.c:3180:17: sparse: sparse: context imbalance in 'wp_pfn_shared' - unexpected unlock
   mm/memory.c:3243: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:275:16: sparse: sparse: cast to non-scalar
   include/linux/pgtable.h:275:16: sparse: sparse: cast from non-scalar
   mm/memory.c:4874:5: sparse: sparse: context imbalance in 'follow_invalidate_pte' - different lock contexts for basic block
   mm/memory.c:4995:9: sparse: sparse: context imbalance in 'follow_pfn' - unexpected unlock

vim +709 mm/memory.c

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

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

^ permalink raw reply	[flat|nested] 8+ messages in thread

* mm/memory.c:709:25: sparse: sparse: cast to non-scalar
@ 2021-11-23 20:37 ` kernel test robot
  0 siblings, 0 replies; 8+ messages in thread
From: kernel test robot @ 2021-11-23 20:37 UTC (permalink / raw)
  To: kbuild-all

[-- Attachment #1: Type: text/plain, Size: 4482 bytes --]

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head:   136057256686de39cc3a07c2e39ef6bc43003ff6
commit: b756a3b5e7ead8f6f4b03cea8ac22478ce04c8a8 mm: device exclusive memory access
date:   5 months ago
config: alpha-randconfig-s031-20211122 (https://download.01.org/0day-ci/archive/20211124/202111240450.3z7aF31U-lkp(a)intel.com/config.gz)
compiler: alpha-linux-gcc (GCC) 11.2.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.4-dirty
        # https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=b756a3b5e7ead8f6f4b03cea8ac22478ce04c8a8
        git remote add linus https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
        git fetch --no-tags linus master
        git checkout b756a3b5e7ead8f6f4b03cea8ac22478ce04c8a8
        # save the config file to linux build tree
        COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-11.2.0 make.cross C=1 CF='-fdiagnostic-prefix -D__CHECK_ENDIAN__' O=build_dir ARCH=alpha SHELL=/bin/bash

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


sparse warnings: (new ones prefixed by >>)
>> mm/memory.c:709:25: sparse: sparse: cast to non-scalar
>> mm/memory.c:709:25: sparse: sparse: cast from non-scalar
   mm/memory.c:1023:17: sparse: sparse: context imbalance in 'copy_pte_range' - different lock contexts for basic block
   mm/memory.c:1736:16: sparse: sparse: context imbalance in '__get_locked_pte' - different lock contexts for basic block
   mm/memory.c:1785:9: sparse: sparse: context imbalance in 'insert_page' - different lock contexts for basic block
   mm/memory.c:2287:17: sparse: sparse: context imbalance in 'remap_pte_range' - different lock contexts for basic block
   mm/memory.c:2543:17: sparse: sparse: context imbalance in 'apply_to_pte_range' - unexpected unlock
   mm/memory.c:2831:17: sparse: sparse: context imbalance in 'wp_page_copy' - unexpected unlock
   mm/memory.c:3180:17: sparse: sparse: context imbalance in 'wp_pfn_shared' - unexpected unlock
   mm/memory.c:3243: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:275:16: sparse: sparse: cast to non-scalar
   include/linux/pgtable.h:275:16: sparse: sparse: cast from non-scalar
   mm/memory.c:4874:5: sparse: sparse: context imbalance in 'follow_invalidate_pte' - different lock contexts for basic block
   mm/memory.c:4995:9: sparse: sparse: context imbalance in 'follow_pfn' - unexpected unlock

vim +709 mm/memory.c

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

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

^ permalink raw reply	[flat|nested] 8+ messages in thread

* mm/memory.c:709:25: sparse: sparse: cast to non-scalar
@ 2021-11-12 16:01 ` kernel test robot
  0 siblings, 0 replies; 8+ messages in thread
From: kernel test robot @ 2021-11-12 16:01 UTC (permalink / raw)
  To: Alistair Popple
  Cc: kbuild-all, linux-kernel, Dan Carpenter, Christoph Hellwig,
	Andrew Morton, Linux Memory Management List

[-- Attachment #1: Type: text/plain, Size: 4322 bytes --]

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head:   5833291ab6de9c3e2374336b51c814e515e8f3a5
commit: b756a3b5e7ead8f6f4b03cea8ac22478ce04c8a8 mm: device exclusive memory access
date:   4 months ago
config: alpha-randconfig-s032-20211103 (attached as .config)
compiler: alpha-linux-gcc (GCC) 11.2.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.4-dirty
        # https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=b756a3b5e7ead8f6f4b03cea8ac22478ce04c8a8
        git remote add linus https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
        git fetch --no-tags linus master
        git checkout b756a3b5e7ead8f6f4b03cea8ac22478ce04c8a8
        # save the attached .config to linux build tree
        COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-11.2.0 make.cross C=1 CF='-fdiagnostic-prefix -D__CHECK_ENDIAN__' O=build_dir ARCH=alpha SHELL=/bin/bash

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


sparse warnings: (new ones prefixed by >>)
>> mm/memory.c:709:25: sparse: sparse: cast to non-scalar
>> mm/memory.c:709:25: sparse: sparse: cast from non-scalar
   mm/memory.c:1023:17: sparse: sparse: context imbalance in 'copy_pte_range' - different lock contexts for basic block
   mm/memory.c:1736:16: sparse: sparse: context imbalance in '__get_locked_pte' - different lock contexts for basic block
   mm/memory.c:1785:9: sparse: sparse: context imbalance in 'insert_page' - different lock contexts for basic block
   mm/memory.c:2287:17: sparse: sparse: context imbalance in 'remap_pte_range' - different lock contexts for basic block
   mm/memory.c:2543:17: sparse: sparse: context imbalance in 'apply_to_pte_range' - unexpected unlock
   mm/memory.c:2831:17: sparse: sparse: context imbalance in 'wp_page_copy' - unexpected unlock
   mm/memory.c:3180:17: sparse: sparse: context imbalance in 'wp_pfn_shared' - unexpected unlock
   mm/memory.c:3243: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:275:16: sparse: sparse: cast to non-scalar
   include/linux/pgtable.h:275:16: sparse: sparse: cast from non-scalar
   mm/memory.c:4874:5: sparse: sparse: context imbalance in 'follow_invalidate_pte' - different lock contexts for basic block
   mm/memory.c:4995:9: sparse: sparse: context imbalance in 'follow_pfn' - unexpected unlock

vim +709 mm/memory.c

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

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

[-- Attachment #2: .config.gz --]
[-- Type: application/gzip, Size: 29598 bytes --]

^ permalink raw reply	[flat|nested] 8+ messages in thread

* mm/memory.c:709:25: sparse: sparse: cast to non-scalar
@ 2021-11-12 16:01 ` kernel test robot
  0 siblings, 0 replies; 8+ messages in thread
From: kernel test robot @ 2021-11-12 16:01 UTC (permalink / raw)
  To: kbuild-all

[-- Attachment #1: Type: text/plain, Size: 4412 bytes --]

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head:   5833291ab6de9c3e2374336b51c814e515e8f3a5
commit: b756a3b5e7ead8f6f4b03cea8ac22478ce04c8a8 mm: device exclusive memory access
date:   4 months ago
config: alpha-randconfig-s032-20211103 (attached as .config)
compiler: alpha-linux-gcc (GCC) 11.2.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.4-dirty
        # https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=b756a3b5e7ead8f6f4b03cea8ac22478ce04c8a8
        git remote add linus https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
        git fetch --no-tags linus master
        git checkout b756a3b5e7ead8f6f4b03cea8ac22478ce04c8a8
        # save the attached .config to linux build tree
        COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-11.2.0 make.cross C=1 CF='-fdiagnostic-prefix -D__CHECK_ENDIAN__' O=build_dir ARCH=alpha SHELL=/bin/bash

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


sparse warnings: (new ones prefixed by >>)
>> mm/memory.c:709:25: sparse: sparse: cast to non-scalar
>> mm/memory.c:709:25: sparse: sparse: cast from non-scalar
   mm/memory.c:1023:17: sparse: sparse: context imbalance in 'copy_pte_range' - different lock contexts for basic block
   mm/memory.c:1736:16: sparse: sparse: context imbalance in '__get_locked_pte' - different lock contexts for basic block
   mm/memory.c:1785:9: sparse: sparse: context imbalance in 'insert_page' - different lock contexts for basic block
   mm/memory.c:2287:17: sparse: sparse: context imbalance in 'remap_pte_range' - different lock contexts for basic block
   mm/memory.c:2543:17: sparse: sparse: context imbalance in 'apply_to_pte_range' - unexpected unlock
   mm/memory.c:2831:17: sparse: sparse: context imbalance in 'wp_page_copy' - unexpected unlock
   mm/memory.c:3180:17: sparse: sparse: context imbalance in 'wp_pfn_shared' - unexpected unlock
   mm/memory.c:3243: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:275:16: sparse: sparse: cast to non-scalar
   include/linux/pgtable.h:275:16: sparse: sparse: cast from non-scalar
   mm/memory.c:4874:5: sparse: sparse: context imbalance in 'follow_invalidate_pte' - different lock contexts for basic block
   mm/memory.c:4995:9: sparse: sparse: context imbalance in 'follow_pfn' - unexpected unlock

vim +709 mm/memory.c

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

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

[-- Attachment #2: config.gz --]
[-- Type: application/gzip, Size: 29598 bytes --]

^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2023-12-10 21:44 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-01-01  5:39 mm/memory.c:709:25: sparse: sparse: cast to non-scalar kernel test robot
2022-01-01  5:39 ` kernel test robot
  -- strict thread matches above, loose matches on Subject: below --
2023-12-10 21:44 kernel test robot
2022-03-09  5:07 kernel test robot
2021-11-23 20:37 kernel test robot
2021-11-23 20:37 ` kernel test robot
2021-11-12 16:01 kernel test robot
2021-11-12 16:01 ` kernel test robot

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.