Re: [PATCH v9 2/5] mm: uffd_wp: Add pte_uffd_wp_available()

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi Chunyan,

kernel test robot noticed the following build errors:

[auto build test ERROR on brauner-vfs/vfs.all]
[also build test ERROR on linus/master v6.17-rc4]
[cannot apply to akpm-mm/mm-everything arnd-asm-generic/master next-20250905]
[If your patch is applied to the wrong git tree, kindly drop us a note.
And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch#_base_tree_information]

url:    https://github.com/intel-lab-lkp/linux/commits/Chunyan-Zhang/mm-softdirty-Add-pte_soft_dirty_available/20250905-184138
base:   https://git.kernel.org/pub/scm/linux/kernel/git/vfs/vfs.git vfs.all
patch link:    https://lore.kernel.org/r/20250905103651.489197-3-zhangchunyan%40iscas.ac.cn
patch subject: [PATCH v9 2/5] mm: uffd_wp: Add pte_uffd_wp_available()
config: m68k-allnoconfig (https://download.01.org/0day-ci/archive/20250906/202509062145.1ipU0q7y-lkp@xxxxxxxxx/config)
compiler: m68k-linux-gcc (GCC) 15.1.0
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20250906/202509062145.1ipU0q7y-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/202509062145.1ipU0q7y-lkp@xxxxxxxxx/

All errors (new ones prefixed by >>):

   In file included from fs/../mm/internal.h:13,
                    from fs/exec.c:82:
   include/linux/mm_inline.h: In function 'pte_install_uffd_wp_if_needed':
>> include/linux/mm_inline.h:573:56: error: implicit declaration of function 'pte_uffd_wp_available'; did you mean 'pte_soft_dirty_available'? [-Wimplicit-function-declaration]
     573 |         if (!IS_ENABLED(CONFIG_PTE_MARKER_UFFD_WP) || !pte_uffd_wp_available())
         |                                                        ^~~~~~~~~~~~~~~~~~~~~
         |                                                        pte_soft_dirty_available
   In file included from include/asm-generic/bug.h:7,
                    from arch/m68k/include/asm/bug.h:32,
                    from include/linux/bug.h:5,
                    from include/linux/thread_info.h:13,
                    from include/asm-generic/preempt.h:5,
                    from ./arch/m68k/include/generated/asm/preempt.h:1,
                    from include/linux/preempt.h:79,
                    from include/linux/spinlock.h:56,
                    from include/linux/mmzone.h:8,
                    from include/linux/gfp.h:7,
                    from include/linux/slab.h:16,
                    from fs/exec.c:27:
>> include/linux/mm_inline.h:579:23: error: implicit declaration of function 'pte_none'; did you mean 'p4d_none'? [-Wimplicit-function-declaration]
     579 |         WARN_ON_ONCE(!pte_none(ptep_get(pte)));
         |                       ^~~~~~~~
   include/linux/once_lite.h:28:41: note: in definition of macro 'DO_ONCE_LITE_IF'
      28 |                 bool __ret_do_once = !!(condition);                     \
         |                                         ^~~~~~~~~
   include/linux/mm_inline.h:579:9: note: in expansion of macro 'WARN_ON_ONCE'
     579 |         WARN_ON_ONCE(!pte_none(ptep_get(pte)));
         |         ^~~~~~~~~~~~
>> include/linux/mm_inline.h:579:32: error: implicit declaration of function 'ptep_get' [-Wimplicit-function-declaration]
     579 |         WARN_ON_ONCE(!pte_none(ptep_get(pte)));
         |                                ^~~~~~~~
   include/linux/once_lite.h:28:41: note: in definition of macro 'DO_ONCE_LITE_IF'
      28 |                 bool __ret_do_once = !!(condition);                     \
         |                                         ^~~~~~~~~
   include/linux/mm_inline.h:579:9: note: in expansion of macro 'WARN_ON_ONCE'
     579 |         WARN_ON_ONCE(!pte_none(ptep_get(pte)));
         |         ^~~~~~~~~~~~
   In file included from include/linux/file.h:9,
                    from include/linux/kernel_read_file.h:5,
                    from fs/exec.c:26:
>> include/linux/mm_inline.h:591:22: error: implicit declaration of function 'pte_present'; did you mean 'p4d_present'? [-Wimplicit-function-declaration]
     591 |         if (unlikely(pte_present(pteval) && pte_uffd_wp(pteval)))
         |                      ^~~~~~~~~~~
   include/linux/compiler.h:77:45: note: in definition of macro 'unlikely'
      77 | # define unlikely(x)    __builtin_expect(!!(x), 0)
         |                                             ^
>> include/linux/mm_inline.h:591:45: error: implicit declaration of function 'pte_uffd_wp' [-Wimplicit-function-declaration]
     591 |         if (unlikely(pte_present(pteval) && pte_uffd_wp(pteval)))
         |                                             ^~~~~~~~~~~
   include/linux/compiler.h:77:45: note: in definition of macro 'unlikely'
      77 | # define unlikely(x)    __builtin_expect(!!(x), 0)
         |                                             ^
>> include/linux/mm_inline.h:602:17: error: implicit declaration of function 'set_pte_at'; did you mean 'user_path_at'? [-Wimplicit-function-declaration]
     602 |                 set_pte_at(vma->vm_mm, addr, pte,
         |                 ^~~~~~~~~~
         |                 user_path_at
>> include/linux/mm_inline.h:603:28: error: implicit declaration of function 'make_pte_marker' [-Wimplicit-function-declaration]
     603 |                            make_pte_marker(PTE_MARKER_UFFD_WP));
         |                            ^~~~~~~~~~~~~~~
>> include/linux/mm_inline.h:603:44: error: 'PTE_MARKER_UFFD_WP' undeclared (first use in this function)
     603 |                            make_pte_marker(PTE_MARKER_UFFD_WP));
         |                                            ^~~~~~~~~~~~~~~~~~
   include/linux/mm_inline.h:603:44: note: each undeclared identifier is reported only once for each function it appears in
--
   In file included from fs/splice.c:27:
   include/linux/mm_inline.h: In function 'pte_install_uffd_wp_if_needed':
>> include/linux/mm_inline.h:573:56: error: implicit declaration of function 'pte_uffd_wp_available'; did you mean 'pte_soft_dirty_available'? [-Wimplicit-function-declaration]
     573 |         if (!IS_ENABLED(CONFIG_PTE_MARKER_UFFD_WP) || !pte_uffd_wp_available())
         |                                                        ^~~~~~~~~~~~~~~~~~~~~
         |                                                        pte_soft_dirty_available
   In file included from include/asm-generic/bug.h:7,
                    from arch/m68k/include/asm/bug.h:32,
                    from include/linux/bug.h:5,
                    from include/linux/vfsdebug.h:5,
                    from include/linux/fs.h:5,
                    from include/linux/highmem.h:5,
                    from include/linux/bvec.h:10,
                    from fs/splice.c:21:
>> include/linux/mm_inline.h:579:23: error: implicit declaration of function 'pte_none'; did you mean 'p4d_none'? [-Wimplicit-function-declaration]
     579 |         WARN_ON_ONCE(!pte_none(ptep_get(pte)));
         |                       ^~~~~~~~
   include/linux/once_lite.h:28:41: note: in definition of macro 'DO_ONCE_LITE_IF'
      28 |                 bool __ret_do_once = !!(condition);                     \
         |                                         ^~~~~~~~~
   include/linux/mm_inline.h:579:9: note: in expansion of macro 'WARN_ON_ONCE'
     579 |         WARN_ON_ONCE(!pte_none(ptep_get(pte)));
         |         ^~~~~~~~~~~~
>> include/linux/mm_inline.h:579:32: error: implicit declaration of function 'ptep_get' [-Wimplicit-function-declaration]
     579 |         WARN_ON_ONCE(!pte_none(ptep_get(pte)));
         |                                ^~~~~~~~
   include/linux/once_lite.h:28:41: note: in definition of macro 'DO_ONCE_LITE_IF'
      28 |                 bool __ret_do_once = !!(condition);                     \
         |                                         ^~~~~~~~~
   include/linux/mm_inline.h:579:9: note: in expansion of macro 'WARN_ON_ONCE'
     579 |         WARN_ON_ONCE(!pte_none(ptep_get(pte)));
         |         ^~~~~~~~~~~~
   In file included from include/asm-generic/bug.h:5:
>> include/linux/mm_inline.h:591:22: error: implicit declaration of function 'pte_present'; did you mean 'p4d_present'? [-Wimplicit-function-declaration]
     591 |         if (unlikely(pte_present(pteval) && pte_uffd_wp(pteval)))
         |                      ^~~~~~~~~~~
   include/linux/compiler.h:77:45: note: in definition of macro 'unlikely'
      77 | # define unlikely(x)    __builtin_expect(!!(x), 0)
         |                                             ^
>> include/linux/mm_inline.h:591:45: error: implicit declaration of function 'pte_uffd_wp' [-Wimplicit-function-declaration]
     591 |         if (unlikely(pte_present(pteval) && pte_uffd_wp(pteval)))
         |                                             ^~~~~~~~~~~
   include/linux/compiler.h:77:45: note: in definition of macro 'unlikely'
      77 | # define unlikely(x)    __builtin_expect(!!(x), 0)
         |                                             ^
   include/linux/mm_inline.h:602:17: error: implicit declaration of function 'set_pte_at' [-Wimplicit-function-declaration]
     602 |                 set_pte_at(vma->vm_mm, addr, pte,
         |                 ^~~~~~~~~~
>> include/linux/mm_inline.h:603:28: error: implicit declaration of function 'make_pte_marker' [-Wimplicit-function-declaration]
     603 |                            make_pte_marker(PTE_MARKER_UFFD_WP));
         |                            ^~~~~~~~~~~~~~~
>> include/linux/mm_inline.h:603:44: error: 'PTE_MARKER_UFFD_WP' undeclared (first use in this function)
     603 |                            make_pte_marker(PTE_MARKER_UFFD_WP));
         |                                            ^~~~~~~~~~~~~~~~~~
   include/linux/mm_inline.h:603:44: note: each undeclared identifier is reported only once for each function it appears in


vim +573 include/linux/mm_inline.h

   556	
   557	/*
   558	 * If this pte is wr-protected by uffd-wp in any form, arm the special pte to
   559	 * replace a none pte.  NOTE!  This should only be called when *pte is already
   560	 * cleared so we will never accidentally replace something valuable.  Meanwhile
   561	 * none pte also means we are not demoting the pte so tlb flushed is not needed.
   562	 * E.g., when pte cleared the caller should have taken care of the tlb flush.
   563	 *
   564	 * Must be called with pgtable lock held so that no thread will see the none
   565	 * pte, and if they see it, they'll fault and serialize at the pgtable lock.
   566	 *
   567	 * Returns true if an uffd-wp pte was installed, false otherwise.
   568	 */
   569	static inline bool
   570	pte_install_uffd_wp_if_needed(struct vm_area_struct *vma, unsigned long addr,
   571				      pte_t *pte, pte_t pteval)
   572	{
 > 573		if (!IS_ENABLED(CONFIG_PTE_MARKER_UFFD_WP) || !pte_uffd_wp_available())
   574			return false;
   575	
   576		bool arm_uffd_pte = false;
   577	
   578		/* The current status of the pte should be "cleared" before calling */
 > 579		WARN_ON_ONCE(!pte_none(ptep_get(pte)));
   580	
   581		/*
   582		 * NOTE: userfaultfd_wp_unpopulated() doesn't need this whole
   583		 * thing, because when zapping either it means it's dropping the
   584		 * page, or in TTU where the present pte will be quickly replaced
   585		 * with a swap pte.  There's no way of leaking the bit.
   586		 */
   587		if (vma_is_anonymous(vma) || !userfaultfd_wp(vma))
   588			return false;
   589	
   590		/* A uffd-wp wr-protected normal pte */
 > 591		if (unlikely(pte_present(pteval) && pte_uffd_wp(pteval)))
   592			arm_uffd_pte = true;
   593	
   594		/*
   595		 * A uffd-wp wr-protected swap pte.  Note: this should even cover an
   596		 * existing pte marker with uffd-wp bit set.
   597		 */
   598		if (unlikely(pte_swp_uffd_wp_any(pteval)))
   599			arm_uffd_pte = true;
   600	
   601		if (unlikely(arm_uffd_pte)) {
 > 602			set_pte_at(vma->vm_mm, addr, pte,
 > 603				   make_pte_marker(PTE_MARKER_UFFD_WP));
   604			return true;
   605		}
   606	
   607		return false;
   608	}
   609	

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




[Index of Archives]     [Linux Ext4 Filesystem]     [Union Filesystem]     [Filesystem Testing]     [Ceph Users]     [Ecryptfs]     [NTFS 3]     [AutoFS]     [Kernel Newbies]     [Share Photos]     [Security]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux Cachefs]     [Reiser Filesystem]     [Linux RAID]     [NTFS 3]     [Samba]     [Device Mapper]     [CEPH Development]

  Powered by Linux