[android-common:android-mainline-riscv64 1/1] mm/hmm.c:271:8: error: implicit declaration of function 'softleaf_is_device_private_write'; did you mean 'folio_is_device_private'?
kernel test robot <[email protected]>
| Newsgroups | dev.linux.lists.oe-kbuild-all |
|---|---|
| Message-ID | <[email protected]> |
Hi Carlos,
FYI, the error/warning still remains.
tree: https://android.googlesource.com/kernel/common android-mainline-riscv64
head: 7c6a4d07be4f08cc4ce6cdad429c9f390e7e47a2
commit: 82d9be76e213a0fb22f8f20586b020b6a91a5c01 [1/1] Merge 7203ca412fc8 ("Merge tag 'mm-stable-2025-12-03-21-26' of git://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm") into android-mainline
config: arm-randconfig-003-20260813 (https://download.01.org/0day-ci/archive/20260813/[email protected]/config)
compiler: arm-linux-gnueabi-gcc (GCC) 8.5.0
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20260813/[email protected]/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 <[email protected]>
| Closes: https://lore.kernel.org/oe-kbuild-all/[email protected]/
All errors (new ones prefixed by >>):
mm/hmm.c: In function 'pte_to_hmm_pfn_flags':
mm/hmm.c:230:6: error: implicit declaration of function 'pte_none'; did you mean 'p4d_none'? [-Werror=implicit-function-declaration]
if (pte_none(pte) || !pte_present(pte) || pte_protnone(pte))
^~~~~~~~
p4d_none
mm/hmm.c:230:24: error: implicit declaration of function 'pte_present'; did you mean 'p4d_present'? [-Werror=implicit-function-declaration]
if (pte_none(pte) || !pte_present(pte) || pte_protnone(pte))
^~~~~~~~~~~
p4d_present
mm/hmm.c:230:44: error: implicit declaration of function 'pte_protnone'; did you mean 'p4d_none'? [-Werror=implicit-function-declaration]
if (pte_none(pte) || !pte_present(pte) || pte_protnone(pte))
^~~~~~~~~~~~
p4d_none
mm/hmm.c:232:9: error: implicit declaration of function 'pte_write'; did you mean 'pgd_write'? [-Werror=implicit-function-declaration]
return pte_write(pte) ? (HMM_PFN_VALID | HMM_PFN_WRITE) : HMM_PFN_VALID;
^~~~~~~~~
pgd_write
mm/hmm.c: In function 'hmm_vma_handle_pte':
mm/hmm.c:243:14: error: implicit declaration of function 'ptep_get'; did you mean 'kset_get'? [-Werror=implicit-function-declaration]
pte_t pte = ptep_get(ptep);
^~~~~~~~
kset_get
mm/hmm.c:252:23: error: implicit declaration of function 'pte_is_uffd_wp_marker'; did you mean 'pte_swp_uffd_wp_any'? [-Werror=implicit-function-declaration]
if (pte_none(pte) || pte_is_uffd_wp_marker(pte)) {
^~~~~~~~~~~~~~~~~~~~~
pte_swp_uffd_wp_any
mm/hmm.c:261:28: error: implicit declaration of function 'softleaf_from_pte' [-Werror=implicit-function-declaration]
const softleaf_t entry = softleaf_from_pte(pte);
^~~~~~~~~~~~~~~~~
mm/hmm.c:261:28: error: invalid initializer
mm/hmm.c:267:7: error: implicit declaration of function 'softleaf_is_device_private'; did you mean 'folio_is_device_private'? [-Werror=implicit-function-declaration]
if (softleaf_is_device_private(entry) &&
^~~~~~~~~~~~~~~~~~~~~~~~~~
folio_is_device_private
mm/hmm.c:268:18: error: implicit declaration of function 'softleaf_to_page'; did you mean 'kmap_to_page'? [-Werror=implicit-function-declaration]
page_pgmap(softleaf_to_page(entry))->owner ==
^~~~~~~~~~~~~~~~
kmap_to_page
mm/hmm.c:268:18: warning: passing argument 1 of 'page_pgmap' makes pointer from integer without a cast [-Wint-conversion]
page_pgmap(softleaf_to_page(entry))->owner ==
^~~~~~~~~~~~~~~~~~~~~~~
In file included from include/linux/gfp.h:7,
from include/linux/mm.h:7,
from include/linux/pagewalk.h:5,
from mm/hmm.c:11:
include/linux/mmzone.h:1241:65: note: expected 'const struct page *' but argument is of type 'int'
static inline struct dev_pagemap *page_pgmap(const struct page *page)
~~~~~~~~~~~~~~~~~~~^~~~
>> mm/hmm.c:271:8: error: implicit declaration of function 'softleaf_is_device_private_write'; did you mean 'folio_is_device_private'? [-Werror=implicit-function-declaration]
if (softleaf_is_device_private_write(entry))
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
folio_is_device_private
mm/hmm.c:273:20: error: implicit declaration of function 'softleaf_to_pfn'; did you mean 'vmalloc_to_pfn'? [-Werror=implicit-function-declaration]
new_pfn_flags = softleaf_to_pfn(entry) | cpu_flags;
^~~~~~~~~~~~~~~
vmalloc_to_pfn
mm/hmm.c:282:7: error: implicit declaration of function 'softleaf_is_swap'; did you mean 'folio_swap'? [-Werror=implicit-function-declaration]
if (softleaf_is_swap(entry))
^~~~~~~~~~~~~~~~
folio_swap
mm/hmm.c:288:7: error: implicit declaration of function 'softleaf_is_device_exclusive'; did you mean 'swait_event_exclusive'? [-Werror=implicit-function-declaration]
if (softleaf_is_device_exclusive(entry))
^~~~~~~~~~~~~~~~~~~~~~~~~~~~
swait_event_exclusive
>> mm/hmm.c:291:7: error: implicit declaration of function 'softleaf_is_migration' [-Werror=implicit-function-declaration]
if (softleaf_is_migration(entry)) {
^~~~~~~~~~~~~~~~~~~~~
mm/hmm.c:292:4: error: implicit declaration of function 'pte_unmap'; did you mean 'memunmap'? [-Werror=implicit-function-declaration]
pte_unmap(ptep);
^~~~~~~~~
memunmap
mm/hmm.c:294:4: error: implicit declaration of function 'migration_entry_wait'; did you mean 'memalloc_retry_wait'? [-Werror=implicit-function-declaration]
migration_entry_wait(walk->mm, pmdp, addr);
^~~~~~~~~~~~~~~~~~~~
memalloc_retry_wait
mm/hmm.c:314:19: error: implicit declaration of function 'pte_pfn'; did you mean 'pud_pfn'? [-Werror=implicit-function-declaration]
!is_zero_pfn(pte_pfn(pte))) {
^~~~~~~
pud_pfn
mm/hmm.c: In function 'hmm_vma_walk_pmd':
mm/hmm.c:411:8: error: implicit declaration of function 'pmdp_get_lockless'; did you mean 'pmd_offset_lockless'? [-Werror=implicit-function-declaration]
pmd = pmdp_get_lockless(pmdp);
^~~~~~~~~~~~~~~~~
pmd_offset_lockless
mm/hmm.c:412:6: error: implicit declaration of function 'pmd_none'; did you mean 'p4d_none'? [-Werror=implicit-function-declaration]
if (pmd_none(pmd))
^~~~~~~~
p4d_none
mm/hmm.c:415:35: error: implicit declaration of function 'pmd_is_migration_entry'; did you mean 'list_first_entry'? [-Werror=implicit-function-declaration]
if (thp_migration_supported() && pmd_is_migration_entry(pmd)) {
^~~~~~~~~~~~~~~~~~~~~~
list_first_entry
mm/hmm.c:418:4: error: implicit declaration of function 'pmd_migration_entry_wait'; did you mean 'memalloc_retry_wait'? [-Werror=implicit-function-declaration]
pmd_migration_entry_wait(walk->mm, pmdp);
^~~~~~~~~~~~~~~~~~~~~~~~
memalloc_retry_wait
mm/hmm.c:424:7: error: implicit declaration of function 'pmd_present'; did you mean 'p4d_present'? [-Werror=implicit-function-declaration]
if (!pmd_present(pmd))
^~~~~~~~~~~
p4d_present
mm/hmm.c:428:6: error: implicit declaration of function 'pmd_trans_huge'; did you mean 'pmd_is_huge'? [-Werror=implicit-function-declaration]
if (pmd_trans_huge(pmd)) {
^~~~~~~~~~~~~~
pmd_is_huge
mm/hmm.c:451:6: error: implicit declaration of function 'pmd_bad'; did you mean 'p4d_bad'? [-Werror=implicit-function-declaration]
if (pmd_bad(pmd)) {
^~~~~~~
p4d_bad
mm/hmm.c: In function 'hmm_range_fault':
mm/hmm.c:672:7: error: implicit declaration of function 'mmu_interval_check_retry'; did you mean 'vma_interval_tree_remove'? [-Werror=implicit-function-declaration]
if (mmu_interval_check_retry(range->notifier,
^~~~~~~~~~~~~~~~~~~~~~~~
vma_interval_tree_remove
cc1: some warnings being treated as errors
Kconfig warnings: (for reference only)
WARNING: unmet direct dependencies detected for CAN_DEV
Depends on [n]: NETDEVICES [=n] && CAN [=y]
Selected by [y]:
- CAN [=y] && NET [=y]
WARNING: unmet direct dependencies detected for WEXT_CORE
Depends on [n]: NET [=y] && WIRELESS [=n] && (CFG80211_WEXT [=n] || WIRELESS_EXT [=y])
Selected by [y]:
- GKI_LEGACY_WEXT_ALLCONFIG [=y]
WARNING: unmet direct dependencies detected for SND_COMPRESS_ACCEL
Depends on [n]: SOUND [=m] && SND [=n]
Selected by [y]:
- GKI_HIDDEN_SND_CONFIGS [=y]
WARNING: unmet direct dependencies detected for SND_JACK
Depends on [n]: SOUND [=m] && SND [=n]
Selected by [y]:
- GKI_HIDDEN_SND_CONFIGS [=y]
WARNING: unmet direct dependencies detected for SND_VMASTER
Depends on [n]: SOUND [=m] && SND [=n]
Selected by [y]:
- GKI_HIDDEN_SND_CONFIGS [=y]
WARNING: unmet direct dependencies detected for CAN_RX_OFFLOAD
Depends on [n]: NETDEVICES [=n] && CAN_DEV [=y] && CAN_NETLINK [=n]
Selected by [y]:
- GKI_HIDDEN_MCP251XFD_CONFIGS [=y]
WARNING: unmet direct dependencies detected for SND_JACK_INPUT_DEV
Depends on [n]: SOUND [=m] && SND [=n] && SND_JACK [=y]
Selected by [y]:
- GKI_HIDDEN_SND_CONFIGS [=y]
WARNING: unmet direct dependencies detected for WEXT_PROC
Depends on [n]: NET [=y] && WIRELESS [=n] && PROC_FS [=n] && WEXT_CORE [=y]
Selected by [y]:
- GKI_LEGACY_WEXT_ALLCONFIG [=y]
WARNING: unmet direct dependencies detected for SND_PCM_ELD
Depends on [n]: SOUND [=m] && SND [=n]
Selected by [y]:
- GKI_HIDDEN_SND_CONFIGS [=y]
WARNING: unmet direct dependencies detected for WEXT_PRIV
Depends on [n]: NET [=y] && WIRELESS [=n]
Selected by [y]:
- GKI_LEGACY_WEXT_ALLCONFIG [=y]
WARNING: unmet direct dependencies detected for HMM_MIRROR
Depends on [n]: MMU [=n]
Selected by [y]:
- GKI_HIDDEN_DRM_CONFIGS [=y] && DRM [=y]
WARNING: unmet direct dependencies detected for USB_PHY
Depends on [n]: USB_SUPPORT [=n]
Selected by [y]:
- GKI_HIDDEN_USB_CONFIGS [=y]
WARNING: unmet direct dependencies detected for DRM_GEM_SHMEM_HELPER
Depends on [n]: HAS_IOMEM [=y] && DRM [=y] && MMU [=n]
Selected by [y]:
- GKI_HIDDEN_DRM_CONFIGS [=y] && DRM [=y]
WARNING: unmet direct dependencies detected for BALLOON_COMPACTION
Depends on [n]: COMPACTION [=n] && MEMORY_BALLOON [=y]
Selected by [y]:
- GKI_HIDDEN_MM_CONFIGS [=y]
WARNING: unmet direct dependencies detected for PHYLINK
Depends on [n]: NETDEVICES [=n]
Selected by [y]:
- GKI_HIDDEN_ETHERNET_CONFIGS [=y]
WARNING: unmet direct dependencies detected for DRM_TTM
Depends on [n]: HAS_IOMEM [=y] && DRM [=y] && MMU [=n]
Selected by [y]:
- GKI_HIDDEN_DRM_CONFIGS [=y] && HAS_IOMEM [=y] && DRM [=y]
WARNING: unmet direct dependencies detected for SND_PCM_IEC958
Depends on [n]: SOUND [=m] && SND [=n]
Selected by [y]:
- GKI_HIDDEN_SND_SOC_CONFIGS [=y]
WARNING: unmet direct dependencies detected for IOMMU_SVA
Depends on [n]: IOMMU_SUPPORT [=n]
Selected by [y]:
- GKI_HIDDEN_IOMMU_CONFIGS [=y]
WARNING: unmet direct dependencies detected for WIRELESS_EXT
Depends on [n]: NET [=y] && WIRELESS [=n]
Selected by [y]:
- GKI_LEGACY_WEXT_ALLCONFIG [=y]
vim +271 mm/hmm.c
2aee09d8c11642 Jérôme Glisse 2018-04-10 234
53f5c3f489ecdd Jérôme Glisse 2018-04-10 235 static int hmm_vma_handle_pte(struct mm_walk *walk, unsigned long addr,
53f5c3f489ecdd Jérôme Glisse 2018-04-10 236 unsigned long end, pmd_t *pmdp, pte_t *ptep,
2733ea144dcce7 Jason Gunthorpe 2020-05-01 237 unsigned long *hmm_pfn)
53f5c3f489ecdd Jérôme Glisse 2018-04-10 238 {
53f5c3f489ecdd Jérôme Glisse 2018-04-10 239 struct hmm_vma_walk *hmm_vma_walk = walk->private;
f88a1e90c66540 Jérôme Glisse 2018-04-10 240 struct hmm_range *range = hmm_vma_walk->range;
a3eb13c1579ba9 Jason Gunthorpe 2020-03-27 241 unsigned int required_fault;
2733ea144dcce7 Jason Gunthorpe 2020-05-01 242 unsigned long cpu_flags;
c33c794828f212 Ryan Roberts 2023-06-12 243 pte_t pte = ptep_get(ptep);
2733ea144dcce7 Jason Gunthorpe 2020-05-01 244 uint64_t pfn_req_flags = *hmm_pfn;
285e871884ff3d Leon Romanovsky 2025-04-28 245 uint64_t new_pfn_flags = 0;
da4c3c735ea4dc Jérôme Glisse 2017-09-08 246
c093cf451094a9 Lorenzo Stoakes 2025-11-10 247 /*
c093cf451094a9 Lorenzo Stoakes 2025-11-10 248 * Any other marker than a UFFD WP marker will result in a fault error
c093cf451094a9 Lorenzo Stoakes 2025-11-10 249 * that will be correctly handled, so we need only check for UFFD WP
c093cf451094a9 Lorenzo Stoakes 2025-11-10 250 * here.
c093cf451094a9 Lorenzo Stoakes 2025-11-10 251 */
68aa2fdbf57f76 Lorenzo Stoakes 2025-11-10 252 if (pte_none(pte) || pte_is_uffd_wp_marker(pte)) {
2733ea144dcce7 Jason Gunthorpe 2020-05-01 253 required_fault =
2733ea144dcce7 Jason Gunthorpe 2020-05-01 254 hmm_pte_need_fault(hmm_vma_walk, pfn_req_flags, 0);
a3eb13c1579ba9 Jason Gunthorpe 2020-03-27 255 if (required_fault)
74eee180b935fc Jérôme Glisse 2017-09-08 256 goto fault;
285e871884ff3d Leon Romanovsky 2025-04-28 257 goto out;
74eee180b935fc Jérôme Glisse 2017-09-08 258 }
74eee180b935fc Jérôme Glisse 2017-09-08 259
74eee180b935fc Jérôme Glisse 2017-09-08 260 if (!pte_present(pte)) {
9ff30bb9ab40b3 Lorenzo Stoakes 2025-11-10 261 const softleaf_t entry = softleaf_from_pte(pte);
74eee180b935fc Jérôme Glisse 2017-09-08 262
74eee180b935fc Jérôme Glisse 2017-09-08 263 /*
8a295dbbaf7292 Ralph Campbell 2022-07-25 264 * Don't fault in device private pages owned by the caller,
8a295dbbaf7292 Ralph Campbell 2022-07-25 265 * just report the PFN.
74eee180b935fc Jérôme Glisse 2017-09-08 266 */
9ff30bb9ab40b3 Lorenzo Stoakes 2025-11-10 267 if (softleaf_is_device_private(entry) &&
9ff30bb9ab40b3 Lorenzo Stoakes 2025-11-10 268 page_pgmap(softleaf_to_page(entry))->owner ==
8a295dbbaf7292 Ralph Campbell 2022-07-25 269 range->dev_private_owner) {
2733ea144dcce7 Jason Gunthorpe 2020-05-01 270 cpu_flags = HMM_PFN_VALID;
9ff30bb9ab40b3 Lorenzo Stoakes 2025-11-10 @271 if (softleaf_is_device_private_write(entry))
2733ea144dcce7 Jason Gunthorpe 2020-05-01 272 cpu_flags |= HMM_PFN_WRITE;
93976a20345b4a Lorenzo Stoakes 2025-11-10 273 new_pfn_flags = softleaf_to_pfn(entry) | cpu_flags;
285e871884ff3d Leon Romanovsky 2025-04-28 274 goto out;
53f5c3f489ecdd Jérôme Glisse 2018-04-10 275 }
53f5c3f489ecdd Jérôme Glisse 2018-04-10 276
2733ea144dcce7 Jason Gunthorpe 2020-05-01 277 required_fault =
2733ea144dcce7 Jason Gunthorpe 2020-05-01 278 hmm_pte_need_fault(hmm_vma_walk, pfn_req_flags, 0);
285e871884ff3d Leon Romanovsky 2025-04-28 279 if (!required_fault)
285e871884ff3d Leon Romanovsky 2025-04-28 280 goto out;
76612d6ce4ccd2 Jason Gunthorpe 2020-02-28 281
9ff30bb9ab40b3 Lorenzo Stoakes 2025-11-10 282 if (softleaf_is_swap(entry))
76612d6ce4ccd2 Jason Gunthorpe 2020-02-28 283 goto fault;
76612d6ce4ccd2 Jason Gunthorpe 2020-02-28 284
9ff30bb9ab40b3 Lorenzo Stoakes 2025-11-10 285 if (softleaf_is_device_private(entry))
8a295dbbaf7292 Ralph Campbell 2022-07-25 286 goto fault;
8a295dbbaf7292 Ralph Campbell 2022-07-25 287
9ff30bb9ab40b3 Lorenzo Stoakes 2025-11-10 288 if (softleaf_is_device_exclusive(entry))
b756a3b5e7ead8 Alistair Popple 2021-06-30 289 goto fault;
b756a3b5e7ead8 Alistair Popple 2021-06-30 290
9ff30bb9ab40b3 Lorenzo Stoakes 2025-11-10 @291 if (softleaf_is_migration(entry)) {
74eee180b935fc Jérôme Glisse 2017-09-08 292 pte_unmap(ptep);
74eee180b935fc Jérôme Glisse 2017-09-08 293 hmm_vma_walk->last = addr;
d2e8d551165ccb Ralph Campbell 2019-07-25 294 migration_entry_wait(walk->mm, pmdp, addr);
73231612dc7c90 Jérôme Glisse 2019-05-13 295 return -EBUSY;
74eee180b935fc Jérôme Glisse 2017-09-08 296 }
53f5c3f489ecdd Jérôme Glisse 2018-04-10 297
53f5c3f489ecdd Jérôme Glisse 2018-04-10 298 /* Report error for everything else */
dfdc22078f3f06 Jason Gunthorpe 2020-02-28 299 pte_unmap(ptep);
53f5c3f489ecdd Jérôme Glisse 2018-04-10 300 return -EFAULT;
da4c3c735ea4dc Jérôme Glisse 2017-09-08 301 }
da4c3c735ea4dc Jérôme Glisse 2017-09-08 302
76612d6ce4ccd2 Jason Gunthorpe 2020-02-28 303 cpu_flags = pte_to_hmm_pfn_flags(range, pte);
2733ea144dcce7 Jason Gunthorpe 2020-05-01 304 required_fault =
2733ea144dcce7 Jason Gunthorpe 2020-05-01 305 hmm_pte_need_fault(hmm_vma_walk, pfn_req_flags, cpu_flags);
a3eb13c1579ba9 Jason Gunthorpe 2020-03-27 306 if (required_fault)
74eee180b935fc Jérôme Glisse 2017-09-08 307 goto fault;
74eee180b935fc Jérôme Glisse 2017-09-08 308
ac541f25037229 Ralph Campbell 2019-10-23 309 /*
40550627492291 Jason Gunthorpe 2020-03-05 310 * Since each architecture defines a struct page for the zero page, just
40550627492291 Jason Gunthorpe 2020-03-05 311 * fall through and treat it like a normal page.
ac541f25037229 Ralph Campbell 2019-10-23 312 */
87c01d57fa23de Alistair Popple 2022-01-14 313 if (!vm_normal_page(walk->vma, addr, pte) &&
4b42fb213678d2 Li Zhijian 2021-09-08 314 !is_zero_pfn(pte_pfn(pte))) {
2733ea144dcce7 Jason Gunthorpe 2020-05-01 315 if (hmm_pte_need_fault(hmm_vma_walk, pfn_req_flags, 0)) {
40550627492291 Jason Gunthorpe 2020-03-05 316 pte_unmap(ptep);
40550627492291 Jason Gunthorpe 2020-03-05 317 return -EFAULT;
40550627492291 Jason Gunthorpe 2020-03-05 318 }
285e871884ff3d Leon Romanovsky 2025-04-28 319 new_pfn_flags = HMM_PFN_ERROR;
285e871884ff3d Leon Romanovsky 2025-04-28 320 goto out;
ac541f25037229 Ralph Campbell 2019-10-23 321 }
992de9a8b75116 Jérôme Glisse 2019-05-13 322
285e871884ff3d Leon Romanovsky 2025-04-28 323 new_pfn_flags = pte_pfn(pte) | cpu_flags;
285e871884ff3d Leon Romanovsky 2025-04-28 324 out:
285e871884ff3d Leon Romanovsky 2025-04-28 325 *hmm_pfn = (*hmm_pfn & HMM_PFN_INOUT_FLAGS) | new_pfn_flags;
53f5c3f489ecdd Jérôme Glisse 2018-04-10 326 return 0;
74eee180b935fc Jérôme Glisse 2017-09-08 327
74eee180b935fc Jérôme Glisse 2017-09-08 328 fault:
74eee180b935fc Jérôme Glisse 2017-09-08 329 pte_unmap(ptep);
5504ed29692faa Jérôme Glisse 2018-04-10 330 /* Fault any virtual address we were asked to fault */
a3eb13c1579ba9 Jason Gunthorpe 2020-03-27 331 return hmm_vma_fault(addr, end, required_fault, walk);
53f5c3f489ecdd Jérôme Glisse 2018-04-10 332 }
53f5c3f489ecdd Jérôme Glisse 2018-04-10 333
:::::: The code at line 271 was first introduced by commit
:::::: 9ff30bb9ab40b34908eefd661f12f99aa00d04c3 mm: remove non_swap_entry() and use softleaf helpers instead
:::::: TO: Lorenzo Stoakes <[email protected]>
:::::: CC: Andrew Morton <[email protected]>
--
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki