All of lore.kernel.org
 help / color / mirror / Atom feed
* [alexshi:pgtable20251213 1/2] mm/migrate_device.c:886:48: error: incompatible pointer types passing 'pgtable_t' (aka 'pte_t *') to parameter of type 'struct ptdesc *'
@ 2025-12-13 14:45 kernel test robot
  0 siblings, 0 replies; only message in thread
From: kernel test robot @ 2025-12-13 14:45 UTC (permalink / raw)
  To: alexs; +Cc: oe-kbuild-all

tree:   https://github.com/alexshi/linux.git pgtable20251213
head:   71f843b5f777eb8b0945aec4cf5844fb4e4105c5
commit: 977a6e01539decdd817dbbc6106a67ec19128bba [1/2] mm/pgtable: use ptdesc for pgtable pointer-6.19
config: s390-allmodconfig (https://download.01.org/0day-ci/archive/20251213/202512132208.yMSCbUEP-lkp@intel.com/config)
compiler: clang version 18.1.8 (https://github.com/llvm/llvm-project 3b5b5c1ec4a3095ab096dd780e84d7ab81f3d7ff)
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20251213/202512132208.yMSCbUEP-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/202512132208.yMSCbUEP-lkp@intel.com/

All errors (new ones prefixed by >>):

>> mm/migrate_device.c:886:48: error: incompatible pointer types passing 'pgtable_t' (aka 'pte_t *') to parameter of type 'struct ptdesc *' [-Werror,-Wincompatible-pointer-types]
     886 |                 pgtable_trans_huge_deposit(vma->vm_mm, pmdp, pgtable);
         |                                                              ^~~~~~~
   arch/s390/include/asm/pgtable.h:1754:20: note: passing argument to parameter 'pgtable' here
    1754 |                                 struct ptdesc *pgtable);
         |                                                ^
   1 error generated.


vim +886 mm/migrate_device.c

76cbbead253ddc Christoph Hellwig 2022-02-16  776  
a30b48bf1b244f Balbir Singh      2025-10-01  777  #ifdef CONFIG_ARCH_ENABLE_THP_MIGRATION
a30b48bf1b244f Balbir Singh      2025-10-01  778  /**
a30b48bf1b244f Balbir Singh      2025-10-01  779   * migrate_vma_insert_huge_pmd_page: Insert a huge folio into @migrate->vma->vm_mm
a30b48bf1b244f Balbir Singh      2025-10-01  780   * at @addr. folio is already allocated as a part of the migration process with
a30b48bf1b244f Balbir Singh      2025-10-01  781   * large page.
a30b48bf1b244f Balbir Singh      2025-10-01  782   *
a30b48bf1b244f Balbir Singh      2025-10-01  783   * @page needs to be initialized and setup after it's allocated. The code bits
a30b48bf1b244f Balbir Singh      2025-10-01  784   * here follow closely the code in __do_huge_pmd_anonymous_page(). This API does
a30b48bf1b244f Balbir Singh      2025-10-01  785   * not support THP zero pages.
a30b48bf1b244f Balbir Singh      2025-10-01  786   *
a30b48bf1b244f Balbir Singh      2025-10-01  787   * @migrate: migrate_vma arguments
a30b48bf1b244f Balbir Singh      2025-10-01  788   * @addr: address where the folio will be inserted
a30b48bf1b244f Balbir Singh      2025-10-01  789   * @page: page to be inserted at @addr
a30b48bf1b244f Balbir Singh      2025-10-01  790   * @src: src pfn which is being migrated
a30b48bf1b244f Balbir Singh      2025-10-01  791   * @pmdp: pointer to the pmd
a30b48bf1b244f Balbir Singh      2025-10-01  792   */
a30b48bf1b244f Balbir Singh      2025-10-01  793  static int migrate_vma_insert_huge_pmd_page(struct migrate_vma *migrate,
a30b48bf1b244f Balbir Singh      2025-10-01  794  					 unsigned long addr,
a30b48bf1b244f Balbir Singh      2025-10-01  795  					 struct page *page,
a30b48bf1b244f Balbir Singh      2025-10-01  796  					 unsigned long *src,
a30b48bf1b244f Balbir Singh      2025-10-01  797  					 pmd_t *pmdp)
a30b48bf1b244f Balbir Singh      2025-10-01  798  {
a30b48bf1b244f Balbir Singh      2025-10-01  799  	struct vm_area_struct *vma = migrate->vma;
a30b48bf1b244f Balbir Singh      2025-10-01  800  	gfp_t gfp = vma_thp_gfp_mask(vma);
a30b48bf1b244f Balbir Singh      2025-10-01  801  	struct folio *folio = page_folio(page);
a30b48bf1b244f Balbir Singh      2025-10-01  802  	int ret;
a30b48bf1b244f Balbir Singh      2025-10-01  803  	vm_fault_t csa_ret;
a30b48bf1b244f Balbir Singh      2025-10-01  804  	spinlock_t *ptl;
a30b48bf1b244f Balbir Singh      2025-10-01  805  	pgtable_t pgtable;
a30b48bf1b244f Balbir Singh      2025-10-01  806  	pmd_t entry;
a30b48bf1b244f Balbir Singh      2025-10-01  807  	bool flush = false;
a30b48bf1b244f Balbir Singh      2025-10-01  808  	unsigned long i;
a30b48bf1b244f Balbir Singh      2025-10-01  809  
a30b48bf1b244f Balbir Singh      2025-10-01  810  	VM_WARN_ON_FOLIO(!folio, folio);
a30b48bf1b244f Balbir Singh      2025-10-01  811  	VM_WARN_ON_ONCE(!pmd_none(*pmdp) && !is_huge_zero_pmd(*pmdp));
a30b48bf1b244f Balbir Singh      2025-10-01  812  
a30b48bf1b244f Balbir Singh      2025-10-01  813  	if (!thp_vma_suitable_order(vma, addr, HPAGE_PMD_ORDER))
a30b48bf1b244f Balbir Singh      2025-10-01  814  		return -EINVAL;
a30b48bf1b244f Balbir Singh      2025-10-01  815  
a30b48bf1b244f Balbir Singh      2025-10-01  816  	ret = anon_vma_prepare(vma);
a30b48bf1b244f Balbir Singh      2025-10-01  817  	if (ret)
a30b48bf1b244f Balbir Singh      2025-10-01  818  		return ret;
a30b48bf1b244f Balbir Singh      2025-10-01  819  
a30b48bf1b244f Balbir Singh      2025-10-01  820  	folio_set_order(folio, HPAGE_PMD_ORDER);
a30b48bf1b244f Balbir Singh      2025-10-01  821  	folio_set_large_rmappable(folio);
a30b48bf1b244f Balbir Singh      2025-10-01  822  
a30b48bf1b244f Balbir Singh      2025-10-01  823  	if (mem_cgroup_charge(folio, migrate->vma->vm_mm, gfp)) {
a30b48bf1b244f Balbir Singh      2025-10-01  824  		count_vm_event(THP_FAULT_FALLBACK);
a30b48bf1b244f Balbir Singh      2025-10-01  825  		count_mthp_stat(HPAGE_PMD_ORDER, MTHP_STAT_ANON_FAULT_FALLBACK_CHARGE);
a30b48bf1b244f Balbir Singh      2025-10-01  826  		ret = -ENOMEM;
a30b48bf1b244f Balbir Singh      2025-10-01  827  		goto abort;
a30b48bf1b244f Balbir Singh      2025-10-01  828  	}
a30b48bf1b244f Balbir Singh      2025-10-01  829  
a30b48bf1b244f Balbir Singh      2025-10-01  830  	__folio_mark_uptodate(folio);
a30b48bf1b244f Balbir Singh      2025-10-01  831  
a30b48bf1b244f Balbir Singh      2025-10-01  832  	pgtable = pte_alloc_one(vma->vm_mm);
a30b48bf1b244f Balbir Singh      2025-10-01  833  	if (unlikely(!pgtable))
a30b48bf1b244f Balbir Singh      2025-10-01  834  		goto abort;
a30b48bf1b244f Balbir Singh      2025-10-01  835  
a30b48bf1b244f Balbir Singh      2025-10-01  836  	if (folio_is_device_private(folio)) {
a30b48bf1b244f Balbir Singh      2025-10-01  837  		swp_entry_t swp_entry;
a30b48bf1b244f Balbir Singh      2025-10-01  838  
a30b48bf1b244f Balbir Singh      2025-10-01  839  		if (vma->vm_flags & VM_WRITE)
a30b48bf1b244f Balbir Singh      2025-10-01  840  			swp_entry = make_writable_device_private_entry(
a30b48bf1b244f Balbir Singh      2025-10-01  841  						page_to_pfn(page));
a30b48bf1b244f Balbir Singh      2025-10-01  842  		else
a30b48bf1b244f Balbir Singh      2025-10-01  843  			swp_entry = make_readable_device_private_entry(
a30b48bf1b244f Balbir Singh      2025-10-01  844  						page_to_pfn(page));
a30b48bf1b244f Balbir Singh      2025-10-01  845  		entry = swp_entry_to_pmd(swp_entry);
a30b48bf1b244f Balbir Singh      2025-10-01  846  	} else {
a30b48bf1b244f Balbir Singh      2025-10-01  847  		if (folio_is_zone_device(folio) &&
a30b48bf1b244f Balbir Singh      2025-10-01  848  		    !folio_is_device_coherent(folio)) {
a30b48bf1b244f Balbir Singh      2025-10-01  849  			goto abort;
a30b48bf1b244f Balbir Singh      2025-10-01  850  		}
a30b48bf1b244f Balbir Singh      2025-10-01  851  		entry = folio_mk_pmd(folio, vma->vm_page_prot);
a30b48bf1b244f Balbir Singh      2025-10-01  852  		if (vma->vm_flags & VM_WRITE)
a30b48bf1b244f Balbir Singh      2025-10-01  853  			entry = pmd_mkwrite(pmd_mkdirty(entry), vma);
a30b48bf1b244f Balbir Singh      2025-10-01  854  	}
a30b48bf1b244f Balbir Singh      2025-10-01  855  
a30b48bf1b244f Balbir Singh      2025-10-01  856  	ptl = pmd_lock(vma->vm_mm, pmdp);
a30b48bf1b244f Balbir Singh      2025-10-01  857  	csa_ret = check_stable_address_space(vma->vm_mm);
a30b48bf1b244f Balbir Singh      2025-10-01  858  	if (csa_ret)
a30b48bf1b244f Balbir Singh      2025-10-01  859  		goto abort;
a30b48bf1b244f Balbir Singh      2025-10-01  860  
a30b48bf1b244f Balbir Singh      2025-10-01  861  	/*
a30b48bf1b244f Balbir Singh      2025-10-01  862  	 * Check for userfaultfd but do not deliver the fault. Instead,
a30b48bf1b244f Balbir Singh      2025-10-01  863  	 * just back off.
a30b48bf1b244f Balbir Singh      2025-10-01  864  	 */
a30b48bf1b244f Balbir Singh      2025-10-01  865  	if (userfaultfd_missing(vma))
a30b48bf1b244f Balbir Singh      2025-10-01  866  		goto unlock_abort;
a30b48bf1b244f Balbir Singh      2025-10-01  867  
a30b48bf1b244f Balbir Singh      2025-10-01  868  	if (!pmd_none(*pmdp)) {
a30b48bf1b244f Balbir Singh      2025-10-01  869  		if (!is_huge_zero_pmd(*pmdp))
a30b48bf1b244f Balbir Singh      2025-10-01  870  			goto unlock_abort;
a30b48bf1b244f Balbir Singh      2025-10-01  871  		flush = true;
a30b48bf1b244f Balbir Singh      2025-10-01  872  	} else if (!pmd_none(*pmdp))
a30b48bf1b244f Balbir Singh      2025-10-01  873  		goto unlock_abort;
a30b48bf1b244f Balbir Singh      2025-10-01  874  
a30b48bf1b244f Balbir Singh      2025-10-01  875  	add_mm_counter(vma->vm_mm, MM_ANONPAGES, HPAGE_PMD_NR);
a30b48bf1b244f Balbir Singh      2025-10-01  876  	folio_add_new_anon_rmap(folio, vma, addr, RMAP_EXCLUSIVE);
a30b48bf1b244f Balbir Singh      2025-10-01  877  	if (!folio_is_zone_device(folio))
a30b48bf1b244f Balbir Singh      2025-10-01  878  		folio_add_lru_vma(folio, vma);
a30b48bf1b244f Balbir Singh      2025-10-01  879  	folio_get(folio);
a30b48bf1b244f Balbir Singh      2025-10-01  880  
a30b48bf1b244f Balbir Singh      2025-10-01  881  	if (flush) {
a30b48bf1b244f Balbir Singh      2025-10-01  882  		pte_free(vma->vm_mm, pgtable);
a30b48bf1b244f Balbir Singh      2025-10-01  883  		flush_cache_page(vma, addr, addr + HPAGE_PMD_SIZE);
a30b48bf1b244f Balbir Singh      2025-10-01  884  		pmdp_invalidate(vma, addr, pmdp);
a30b48bf1b244f Balbir Singh      2025-10-01  885  	} else {
a30b48bf1b244f Balbir Singh      2025-10-01 @886  		pgtable_trans_huge_deposit(vma->vm_mm, pmdp, pgtable);
a30b48bf1b244f Balbir Singh      2025-10-01  887  		mm_inc_nr_ptes(vma->vm_mm);
a30b48bf1b244f Balbir Singh      2025-10-01  888  	}
a30b48bf1b244f Balbir Singh      2025-10-01  889  	set_pmd_at(vma->vm_mm, addr, pmdp, entry);
a30b48bf1b244f Balbir Singh      2025-10-01  890  	update_mmu_cache_pmd(vma, addr, pmdp);
a30b48bf1b244f Balbir Singh      2025-10-01  891  
a30b48bf1b244f Balbir Singh      2025-10-01  892  	spin_unlock(ptl);
a30b48bf1b244f Balbir Singh      2025-10-01  893  
a30b48bf1b244f Balbir Singh      2025-10-01  894  	count_vm_event(THP_FAULT_ALLOC);
a30b48bf1b244f Balbir Singh      2025-10-01  895  	count_mthp_stat(HPAGE_PMD_ORDER, MTHP_STAT_ANON_FAULT_ALLOC);
a30b48bf1b244f Balbir Singh      2025-10-01  896  	count_memcg_event_mm(vma->vm_mm, THP_FAULT_ALLOC);
a30b48bf1b244f Balbir Singh      2025-10-01  897  
a30b48bf1b244f Balbir Singh      2025-10-01  898  	return 0;
a30b48bf1b244f Balbir Singh      2025-10-01  899  
a30b48bf1b244f Balbir Singh      2025-10-01  900  unlock_abort:
a30b48bf1b244f Balbir Singh      2025-10-01  901  	spin_unlock(ptl);
a30b48bf1b244f Balbir Singh      2025-10-01  902  abort:
a30b48bf1b244f Balbir Singh      2025-10-01  903  	for (i = 0; i < HPAGE_PMD_NR; i++)
a30b48bf1b244f Balbir Singh      2025-10-01  904  		src[i] &= ~MIGRATE_PFN_MIGRATE;
a30b48bf1b244f Balbir Singh      2025-10-01  905  	return 0;
a30b48bf1b244f Balbir Singh      2025-10-01  906  }
4265d67e405a41 Balbir Singh      2025-10-01  907  

:::::: The code at line 886 was first introduced by commit
:::::: a30b48bf1b244f11bf9b6d20cdccfe0c2264130c mm/migrate_device: implement THP migration of zone device pages

:::::: TO: Balbir Singh <balbirs@nvidia.com>
:::::: CC: Andrew Morton <akpm@linux-foundation.org>

-- 
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:[~2025-12-13 14:45 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-12-13 14:45 [alexshi:pgtable20251213 1/2] mm/migrate_device.c:886:48: error: incompatible pointer types passing 'pgtable_t' (aka 'pte_t *') to parameter of type 'struct ptdesc *' 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.