tree: https://git.kernel.org/pub/scm/virt/kvm/kvm.git queue head: 415efaaf0d973684af5fa7c9ddccf111485f9f1b commit: b06d4c260e93214808f9dd6031226b1b0e2937f1 [23/29] mm: replace set_pte_at_notify() with just set_pte_at() config: s390-defconfig (https://download.01.org/0day-ci/archive/20240412/202404121421.H93Aat0L-lkp@xxxxxxxxx/config) compiler: clang version 19.0.0git (https://github.com/llvm/llvm-project 8b3b4a92adee40483c27f26c478a384cd69c6f05) reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20240412/202404121421.H93Aat0L-lkp@xxxxxxxxx/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@xxxxxxxxx> | Closes: https://lore.kernel.org/oe-kbuild-all/202404121421.H93Aat0L-lkp@xxxxxxxxx/ All errors (new ones prefixed by >>): In file included from kernel/events/uprobes.c:13: In file included from include/linux/highmem.h:10: In file included from include/linux/mm.h:2208: include/linux/vmstat.h:508:43: warning: arithmetic between different enumeration types ('enum zone_stat_item' and 'enum numa_stat_item') [-Wenum-enum-conversion] 508 | return vmstat_text[NR_VM_ZONE_STAT_ITEMS + | ~~~~~~~~~~~~~~~~~~~~~ ^ 509 | item]; | ~~~~ include/linux/vmstat.h:515:43: warning: arithmetic between different enumeration types ('enum zone_stat_item' and 'enum numa_stat_item') [-Wenum-enum-conversion] 515 | return vmstat_text[NR_VM_ZONE_STAT_ITEMS + | ~~~~~~~~~~~~~~~~~~~~~ ^ 516 | NR_VM_NUMA_EVENT_ITEMS + | ~~~~~~~~~~~~~~~~~~~~~~ include/linux/vmstat.h:522:36: warning: arithmetic between different enumeration types ('enum node_stat_item' and 'enum lru_list') [-Wenum-enum-conversion] 522 | return node_stat_name(NR_LRU_BASE + lru) + 3; // skip "nr_" | ~~~~~~~~~~~ ^ ~~~ include/linux/vmstat.h:527:43: warning: arithmetic between different enumeration types ('enum zone_stat_item' and 'enum numa_stat_item') [-Wenum-enum-conversion] 527 | return vmstat_text[NR_VM_ZONE_STAT_ITEMS + | ~~~~~~~~~~~~~~~~~~~~~ ^ 528 | NR_VM_NUMA_EVENT_ITEMS + | ~~~~~~~~~~~~~~~~~~~~~~ include/linux/vmstat.h:536:43: warning: arithmetic between different enumeration types ('enum zone_stat_item' and 'enum numa_stat_item') [-Wenum-enum-conversion] 536 | return vmstat_text[NR_VM_ZONE_STAT_ITEMS + | ~~~~~~~~~~~~~~~~~~~~~ ^ 537 | NR_VM_NUMA_EVENT_ITEMS + | ~~~~~~~~~~~~~~~~~~~~~~ >> kernel/events/uprobes.c:160:28: error: variable has incomplete type 'struct mmu_notifier_range' 160 | struct mmu_notifier_range range; | ^ include/linux/mm.h:2388:8: note: forward declaration of 'struct mmu_notifier_range' 2388 | struct mmu_notifier_range; | ^ >> kernel/events/uprobes.c:162:2: error: call to undeclared function 'mmu_notifier_range_init'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration] 162 | mmu_notifier_range_init(&range, MMU_NOTIFY_CLEAR, 0, mm, addr, | ^ >> kernel/events/uprobes.c:162:34: error: use of undeclared identifier 'MMU_NOTIFY_CLEAR' 162 | mmu_notifier_range_init(&range, MMU_NOTIFY_CLEAR, 0, mm, addr, | ^ >> kernel/events/uprobes.c:175:2: error: call to undeclared function 'mmu_notifier_invalidate_range_start'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration] 175 | mmu_notifier_invalidate_range_start(&range); | ^ >> kernel/events/uprobes.c:208:2: error: call to undeclared function 'mmu_notifier_invalidate_range_end'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration] 208 | mmu_notifier_invalidate_range_end(&range); | ^ 5 warnings and 5 errors generated. vim +160 kernel/events/uprobes.c cb113b47d09818 kernel/events/uprobes.c Oleg Nesterov 2012-07-29 138 2b144498350860 kernel/uprobes.c Srikar Dronamraju 2012-02-09 139 /** 2b144498350860 kernel/uprobes.c Srikar Dronamraju 2012-02-09 140 * __replace_page - replace page in vma by new page. 2b144498350860 kernel/uprobes.c Srikar Dronamraju 2012-02-09 141 * based on replace_page in mm/ksm.c 2b144498350860 kernel/uprobes.c Srikar Dronamraju 2012-02-09 142 * 2b144498350860 kernel/uprobes.c Srikar Dronamraju 2012-02-09 143 * @vma: vma that holds the pte pointing to page c517ee744b96e4 kernel/events/uprobes.c Oleg Nesterov 2012-07-29 144 * @addr: address the old @page is mapped at fb4fb04ff4dd37 kernel/events/uprobes.c Song Liu 2019-09-23 145 * @old_page: the page we are replacing by new_page fb4fb04ff4dd37 kernel/events/uprobes.c Song Liu 2019-09-23 146 * @new_page: the modified page we replace page by 2b144498350860 kernel/uprobes.c Srikar Dronamraju 2012-02-09 147 * fb4fb04ff4dd37 kernel/events/uprobes.c Song Liu 2019-09-23 148 * If @new_page is NULL, only unmap @old_page. fb4fb04ff4dd37 kernel/events/uprobes.c Song Liu 2019-09-23 149 * fb4fb04ff4dd37 kernel/events/uprobes.c Song Liu 2019-09-23 150 * Returns 0 on success, negative error code otherwise. 2b144498350860 kernel/uprobes.c Srikar Dronamraju 2012-02-09 151 */ c517ee744b96e4 kernel/events/uprobes.c Oleg Nesterov 2012-07-29 152 static int __replace_page(struct vm_area_struct *vma, unsigned long addr, bdfaa2eecd5f6c kernel/events/uprobes.c Oleg Nesterov 2016-08-17 153 struct page *old_page, struct page *new_page) 2b144498350860 kernel/uprobes.c Srikar Dronamraju 2012-02-09 154 { 5fcd079af9ed4e kernel/events/uprobes.c Matthew Wilcox (Oracle 2022-09-02 155) struct folio *old_folio = page_folio(old_page); 82e66bf76173a1 kernel/events/uprobes.c Matthew Wilcox (Oracle 2022-09-02 156) struct folio *new_folio; 2b144498350860 kernel/uprobes.c Srikar Dronamraju 2012-02-09 157 struct mm_struct *mm = vma->vm_mm; 5fcd079af9ed4e kernel/events/uprobes.c Matthew Wilcox (Oracle 2022-09-02 158) DEFINE_FOLIO_VMA_WALK(pvmw, old_folio, vma, addr, 0); 9f92448ceeea53 kernel/events/uprobes.c Oleg Nesterov 2012-07-29 159 int err; ac46d4f3c43241 kernel/events/uprobes.c Jérôme Glisse 2018-12-28 @160 struct mmu_notifier_range range; 00501b531c4723 kernel/events/uprobes.c Johannes Weiner 2014-08-08 161 7d4a8be0c4b2b7 kernel/events/uprobes.c Alistair Popple 2023-01-10 @162 mmu_notifier_range_init(&range, MMU_NOTIFY_CLEAR, 0, mm, addr, 6f4f13e8d9e27c kernel/events/uprobes.c Jérôme Glisse 2019-05-13 163 addr + PAGE_SIZE); ac46d4f3c43241 kernel/events/uprobes.c Jérôme Glisse 2018-12-28 164 fb4fb04ff4dd37 kernel/events/uprobes.c Song Liu 2019-09-23 165 if (new_page) { 82e66bf76173a1 kernel/events/uprobes.c Matthew Wilcox (Oracle 2022-09-02 166) new_folio = page_folio(new_page); 82e66bf76173a1 kernel/events/uprobes.c Matthew Wilcox (Oracle 2022-09-02 167) err = mem_cgroup_charge(new_folio, vma->vm_mm, GFP_KERNEL); 00501b531c4723 kernel/events/uprobes.c Johannes Weiner 2014-08-08 168 if (err) 00501b531c4723 kernel/events/uprobes.c Johannes Weiner 2014-08-08 169 return err; fb4fb04ff4dd37 kernel/events/uprobes.c Song Liu 2019-09-23 170 } 2b144498350860 kernel/uprobes.c Srikar Dronamraju 2012-02-09 171 5fcd079af9ed4e kernel/events/uprobes.c Matthew Wilcox (Oracle 2022-09-02 172) /* For folio_free_swap() below */ 5fcd079af9ed4e kernel/events/uprobes.c Matthew Wilcox (Oracle 2022-09-02 173) folio_lock(old_folio); 9f92448ceeea53 kernel/events/uprobes.c Oleg Nesterov 2012-07-29 174 ac46d4f3c43241 kernel/events/uprobes.c Jérôme Glisse 2018-12-28 @175 mmu_notifier_invalidate_range_start(&range); 9f92448ceeea53 kernel/events/uprobes.c Oleg Nesterov 2012-07-29 176 err = -EAGAIN; 9d82c69438d0df kernel/events/uprobes.c Johannes Weiner 2020-06-03 177 if (!page_vma_mapped_walk(&pvmw)) 9f92448ceeea53 kernel/events/uprobes.c Oleg Nesterov 2012-07-29 178 goto unlock; 14fa2daa15887f kernel/events/uprobes.c Kirill A. Shutemov 2017-02-24 179 VM_BUG_ON_PAGE(addr != pvmw.address, old_page); 2b144498350860 kernel/uprobes.c Srikar Dronamraju 2012-02-09 180 fb4fb04ff4dd37 kernel/events/uprobes.c Song Liu 2019-09-23 181 if (new_page) { 82e66bf76173a1 kernel/events/uprobes.c Matthew Wilcox (Oracle 2022-09-02 182) folio_get(new_folio); 2853b66b601a26 kernel/events/uprobes.c Matthew Wilcox (Oracle 2023-12-11 183) folio_add_new_anon_rmap(new_folio, vma, addr); 82e66bf76173a1 kernel/events/uprobes.c Matthew Wilcox (Oracle 2022-09-02 184) folio_add_lru_vma(new_folio, vma); fb4fb04ff4dd37 kernel/events/uprobes.c Song Liu 2019-09-23 185 } else fb4fb04ff4dd37 kernel/events/uprobes.c Song Liu 2019-09-23 186 /* no new page, just dec_mm_counter for old_page */ fb4fb04ff4dd37 kernel/events/uprobes.c Song Liu 2019-09-23 187 dec_mm_counter(mm, MM_ANONPAGES); 2b144498350860 kernel/uprobes.c Srikar Dronamraju 2012-02-09 188 5fcd079af9ed4e kernel/events/uprobes.c Matthew Wilcox (Oracle 2022-09-02 189) if (!folio_test_anon(old_folio)) { 6b27cc6c66abf0 kernel/events/uprobes.c Kefeng Wang 2024-01-11 190 dec_mm_counter(mm, mm_counter_file(old_folio)); 7396fa818d6278 kernel/events/uprobes.c Srikar Dronamraju 2012-04-11 191 inc_mm_counter(mm, MM_ANONPAGES); 7396fa818d6278 kernel/events/uprobes.c Srikar Dronamraju 2012-04-11 192 } 7396fa818d6278 kernel/events/uprobes.c Srikar Dronamraju 2012-04-11 193 c33c794828f212 kernel/events/uprobes.c Ryan Roberts 2023-06-12 194 flush_cache_page(vma, addr, pte_pfn(ptep_get(pvmw.pte))); ec8832d007cb7b kernel/events/uprobes.c Alistair Popple 2023-07-25 195 ptep_clear_flush(vma, addr, pvmw.pte); fb4fb04ff4dd37 kernel/events/uprobes.c Song Liu 2019-09-23 196 if (new_page) b06d4c260e9321 kernel/events/uprobes.c Paolo Bonzini 2024-04-05 197 set_pte_at(mm, addr, pvmw.pte, 14fa2daa15887f kernel/events/uprobes.c Kirill A. Shutemov 2017-02-24 198 mk_pte(new_page, vma->vm_page_prot)); 2b144498350860 kernel/uprobes.c Srikar Dronamraju 2012-02-09 199 5cc9695f06b065 kernel/events/uprobes.c David Hildenbrand 2023-12-20 200 folio_remove_rmap_pte(old_folio, old_page, vma); 5fcd079af9ed4e kernel/events/uprobes.c Matthew Wilcox (Oracle 2022-09-02 201) if (!folio_mapped(old_folio)) 5fcd079af9ed4e kernel/events/uprobes.c Matthew Wilcox (Oracle 2022-09-02 202) folio_free_swap(old_folio); 14fa2daa15887f kernel/events/uprobes.c Kirill A. Shutemov 2017-02-24 203 page_vma_mapped_walk_done(&pvmw); 5fcd079af9ed4e kernel/events/uprobes.c Matthew Wilcox (Oracle 2022-09-02 204) folio_put(old_folio); 194f8dcbe9629d kernel/events/uprobes.c Oleg Nesterov 2012-07-29 205 9f92448ceeea53 kernel/events/uprobes.c Oleg Nesterov 2012-07-29 206 err = 0; 9f92448ceeea53 kernel/events/uprobes.c Oleg Nesterov 2012-07-29 207 unlock: ac46d4f3c43241 kernel/events/uprobes.c Jérôme Glisse 2018-12-28 @208 mmu_notifier_invalidate_range_end(&range); 5fcd079af9ed4e kernel/events/uprobes.c Matthew Wilcox (Oracle 2022-09-02 209) folio_unlock(old_folio); 9f92448ceeea53 kernel/events/uprobes.c Oleg Nesterov 2012-07-29 210 return err; 2b144498350860 kernel/uprobes.c Srikar Dronamraju 2012-02-09 211 } 2b144498350860 kernel/uprobes.c Srikar Dronamraju 2012-02-09 212 :::::: The code at line 160 was first introduced by commit :::::: ac46d4f3c43241ffa23d5bf36153a0830c0e02cc mm/mmu_notifier: use structure for invalidate_range_start/end calls v2 :::::: TO: Jérôme Glisse <jglisse@xxxxxxxxxx> :::::: CC: Linus Torvalds <torvalds@xxxxxxxxxxxxxxxxxxxx> -- 0-DAY CI Kernel Test Service https://github.com/intel/lkp-tests/wiki