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-migrate-Fix-writable-pte-for-read-migration-entry/20221111-043302 base: https://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm.git mm-everything patch link: https://lore.kernel.org/r/20221110203132.1498183-3-peterx%40redhat.com patch subject: [PATCH v2 2/2] mm/uffd: Sanity check write bit for uffd-wp protected ptes config: x86_64-randconfig-a015 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/b103eae2926a263a15e262611524ca9efa8b969e git remote add linux-review https://github.com/intel-lab-lkp/linux git fetch --no-tags linux-review Peter-Xu/mm-migrate-Fix-writable-pte-for-read-migration-entry/20221111-043302 git checkout b103eae2926a263a15e262611524ca9efa8b969e # save the config file mkdir build_dir && cp config build_dir/.config make W=1 O=build_dir ARCH=x86_64 SHELL=/bin/bash If you fix the issue, kindly add following tag where applicable | Reported-by: kernel test robot All errors (new ones prefixed by >>): In file included from include/linux/pgtable.h:6, from mm/hugetlb_vmemmap.c:13: arch/x86/include/asm/pgtable.h: In function 'pte_uffd_wp': >> arch/x86/include/asm/pgtable.h:306:9: error: implicit declaration of function 'VM_WARN_ON_ONCE'; did you mean 'WARN_ON_ONCE'? [-Werror=implicit-function-declaration] 306 | VM_WARN_ON_ONCE(wp && pte_write(pte)); | ^~~~~~~~~~~~~~~ | WARN_ON_ONCE cc1: some warnings being treated as errors vim +306 arch/x86/include/asm/pgtable.h 290 291 #ifdef CONFIG_HAVE_ARCH_USERFAULTFD_WP 292 static inline int pte_uffd_wp(pte_t pte) 293 { 294 bool wp = pte_flags(pte) & _PAGE_UFFD_WP; 295 296 /* 297 * Having write bit for wr-protect-marked present ptes is fatal, 298 * because it means the uffd-wp bit will be ignored and write will 299 * just go through. 300 * 301 * Use any chance of pgtable walking to verify this (e.g., when 302 * page swapped out or being migrated for all purposes). It means 303 * something is already wrong. Tell the admin even before the 304 * process crashes. We also nail it with wrong pgtable setup. 305 */ > 306 VM_WARN_ON_ONCE(wp && pte_write(pte)); 307 308 return wp; 309 } 310 -- 0-DAY CI Kernel Test Service https://01.org/lkp