From: kernel test robot <lkp@intel.com>
To: oe-kbuild@lists.linux.dev
Cc: lkp@intel.com, Dan Carpenter <error27@gmail.com>
Subject: [kas:uffd/v2 7/14] include/linux/mm.h:4618 gup_can_follow_protnone() warn: bitwise AND condition is false here
Date: Sun, 10 May 2026 01:47:42 +0800 [thread overview]
Message-ID: <202605100132.U77SlLEg-lkp@intel.com> (raw)
BCC: lkp@intel.com
CC: oe-kbuild-all@lists.linux.dev
TO: "Kiryl Shutsemau (Meta)" <kas@kernel.org>
tree: https://git.kernel.org/pub/scm/linux/kernel/git/kas/linux.git uffd/v2
head: 0b6f87fd4809245f9eebee73f34e2fb14230330c
commit: c88e78ffb2cc5ca81f5a6319b7e3c4ffd8baefe1 [7/14] mm: handle VM_UFFD_RWP in khugepaged, rmap, and GUP
:::::: branch date: 26 hours ago
:::::: commit date: 26 hours ago
config: m68k-randconfig-r073-20260509 (https://download.01.org/0day-ci/archive/20260510/202605100132.U77SlLEg-lkp@intel.com/config)
compiler: m68k-linux-gcc (GCC) 12.5.0
smatch: v0.5.0-9065-ge9cc34fd
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>
| Reported-by: Dan Carpenter <error27@gmail.com>
| Closes: https://lore.kernel.org/r/202605100132.U77SlLEg-lkp@intel.com/
smatch warnings:
include/linux/mm.h:4618 gup_can_follow_protnone() warn: bitwise AND condition is false here
vim +4618 include/linux/mm.h
9a291a7c9428155 James Morse 2017-06-02 4605
474098edac262ae David Hildenbrand 2022-08-25 4606 /*
474098edac262ae David Hildenbrand 2022-08-25 4607 * Indicates whether GUP can follow a PROT_NONE mapped page, or whether
c88e78ffb2cc5ca Kiryl Shutsemau (Meta 2026-04-22 4608) * a (NUMA hinting or userfaultfd RWP) fault is required.
474098edac262ae David Hildenbrand 2022-08-25 4609 */
da0045587d59d4f Max Kellermann 2025-09-01 4610 static inline bool gup_can_follow_protnone(const struct vm_area_struct *vma,
d74943a2f3cdade David Hildenbrand 2023-08-03 4611 unsigned int flags)
474098edac262ae David Hildenbrand 2022-08-25 4612 {
c88e78ffb2cc5ca Kiryl Shutsemau (Meta 2026-04-22 4613) /*
c88e78ffb2cc5ca Kiryl Shutsemau (Meta 2026-04-22 4614) * VM_UFFD_RWP uses protnone as an access-tracking marker, not for
c88e78ffb2cc5ca Kiryl Shutsemau (Meta 2026-04-22 4615) * NUMA hinting. GUP must always take a fault so the access is
c88e78ffb2cc5ca Kiryl Shutsemau (Meta 2026-04-22 4616) * delivered to userfaultfd, regardless of FOLL_HONOR_NUMA_FAULT.
c88e78ffb2cc5ca Kiryl Shutsemau (Meta 2026-04-22 4617) */
c88e78ffb2cc5ca Kiryl Shutsemau (Meta 2026-04-22 @4618) if (vma->vm_flags & VM_UFFD_RWP)
c88e78ffb2cc5ca Kiryl Shutsemau (Meta 2026-04-22 4619) return false;
c88e78ffb2cc5ca Kiryl Shutsemau (Meta 2026-04-22 4620)
474098edac262ae David Hildenbrand 2022-08-25 4621 /*
d74943a2f3cdade David Hildenbrand 2023-08-03 4622 * If callers don't want to honor NUMA hinting faults, no need to
d74943a2f3cdade David Hildenbrand 2023-08-03 4623 * determine if we would actually have to trigger a NUMA hinting fault.
474098edac262ae David Hildenbrand 2022-08-25 4624 */
d74943a2f3cdade David Hildenbrand 2023-08-03 4625 if (!(flags & FOLL_HONOR_NUMA_FAULT))
d74943a2f3cdade David Hildenbrand 2023-08-03 4626 return true;
d74943a2f3cdade David Hildenbrand 2023-08-03 4627
d74943a2f3cdade David Hildenbrand 2023-08-03 4628 /*
d74943a2f3cdade David Hildenbrand 2023-08-03 4629 * NUMA hinting faults don't apply in inaccessible (PROT_NONE) VMAs.
d74943a2f3cdade David Hildenbrand 2023-08-03 4630 *
d74943a2f3cdade David Hildenbrand 2023-08-03 4631 * Requiring a fault here even for inaccessible VMAs would mean that
d74943a2f3cdade David Hildenbrand 2023-08-03 4632 * FOLL_FORCE cannot make any progress, because handle_mm_fault()
d74943a2f3cdade David Hildenbrand 2023-08-03 4633 * refuses to process NUMA hinting faults in inaccessible VMAs.
d74943a2f3cdade David Hildenbrand 2023-08-03 4634 */
d74943a2f3cdade David Hildenbrand 2023-08-03 4635 return !vma_is_accessible(vma);
474098edac262ae David Hildenbrand 2022-08-25 4636 }
474098edac262ae David Hildenbrand 2022-08-25 4637
--
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki
reply other threads:[~2026-05-09 17:47 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=202605100132.U77SlLEg-lkp@intel.com \
--to=lkp@intel.com \
--cc=error27@gmail.com \
--cc=oe-kbuild@lists.linux.dev \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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.