Hi Peter,
Thank you for the patch! Yet something to improve:
[auto build test ERROR on akpm-mm/mm-everything]
url: https://github.com/intel-lab-lkp/linux/commits/Peter-Xu/mm-uffd-Always-wr-pr... base: https://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm.git mm-everything patch link: https://lore.kernel.org/r/Y45duzmGGUT0%2Bu8t%40x1n patch subject: [PATCH] mm/uffd: Always wr-protect pte in pte_mkuffd_wp() config: x86_64-allyesconfig compiler: gcc-11 (Debian 11.3.0-8) 11.3.0 reproduce (this is a W=1 build): # https://github.com/intel-lab-lkp/linux/commit/ddd9626e3f22a7c2c263c0db4d062a... git remote add linux-review https://github.com/intel-lab-lkp/linux git fetch --no-tags linux-review Peter-Xu/mm-uffd-Always-wr-protect-pte-in-pte_mkuffd_wp/20221206-050912 git checkout ddd9626e3f22a7c2c263c0db4d062a7cc60dfa15 # save the config file mkdir build_dir && cp config build_dir/.config make W=1 O=build_dir ARCH=x86_64 prepare
If you fix the issue, kindly add following tag where applicable | Reported-by: kernel test robot lkp@intel.com
All errors (new ones prefixed by >>):
scripts/genksyms/parse.y: warning: 9 shift/reduce conflicts [-Wconflicts-sr] scripts/genksyms/parse.y: warning: 5 reduce/reduce conflicts [-Wconflicts-rr] scripts/genksyms/parse.y: note: rerun with option '-Wcounterexamples' to generate conflict counterexamples In file included from include/linux/pgtable.h:6, from include/linux/kasan.h:33, from include/linux/slab.h:148, from include/linux/crypto.h:20, from arch/x86/kernel/asm-offsets.c:9: arch/x86/include/asm/pgtable.h: In function 'pte_mkuffd_wp':
arch/x86/include/asm/pgtable.h:316:16: error: implicit declaration of function 'pte_wrprotect'; did you mean 'pte_write'? [-Werror=implicit-function-declaration]
316 | return pte_wrprotect(pte_set_flags(pte, _PAGE_UFFD_WP)); | ^~~~~~~~~~~~~ | pte_write
arch/x86/include/asm/pgtable.h:316:16: error: incompatible types when returning type 'int' but 'pte_t' was expected
316 | return pte_wrprotect(pte_set_flags(pte, _PAGE_UFFD_WP)); | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ arch/x86/include/asm/pgtable.h: At top level:
arch/x86/include/asm/pgtable.h:335:21: error: conflicting types for 'pte_wrprotect'; have 'pte_t(pte_t)'
335 | static inline pte_t pte_wrprotect(pte_t pte) | ^~~~~~~~~~~~~ arch/x86/include/asm/pgtable.h:316:16: note: previous implicit declaration of 'pte_wrprotect' with type 'int()' 316 | return pte_wrprotect(pte_set_flags(pte, _PAGE_UFFD_WP)); | ^~~~~~~~~~~~~ cc1: some warnings being treated as errors make[2]: *** [scripts/Makefile.build:118: arch/x86/kernel/asm-offsets.s] Error 1 make[2]: Target 'prepare' not remade because of errors. make[1]: *** [Makefile:1270: prepare0] Error 2 make[1]: Target 'prepare' not remade because of errors. make: *** [Makefile:231: __sub-make] Error 2 make: Target 'prepare' not remade because of errors.
vim +316 arch/x86/include/asm/pgtable.h
313 314 static inline pte_t pte_mkuffd_wp(pte_t pte) 315 {
316 return pte_wrprotect(pte_set_flags(pte, _PAGE_UFFD_WP));
317 } 318 319 static inline pte_t pte_clear_uffd_wp(pte_t pte) 320 { 321 return pte_clear_flags(pte, _PAGE_UFFD_WP); 322 } 323 #endif /* CONFIG_HAVE_ARCH_USERFAULTFD_WP */ 324 325 static inline pte_t pte_mkclean(pte_t pte) 326 { 327 return pte_clear_flags(pte, _PAGE_DIRTY); 328 } 329 330 static inline pte_t pte_mkold(pte_t pte) 331 { 332 return pte_clear_flags(pte, _PAGE_ACCESSED); 333 } 334
335 static inline pte_t pte_wrprotect(pte_t pte)
336 { 337 return pte_clear_flags(pte, _PAGE_RW); 338 } 339