mm/hugetlb.c:3231:8: error: implicit declaration of function 'pte_to_swp_entry'; did you mean 'get_plt_entry'?

From: kbuild test robot
Date: Fri Feb 14 2020 - 10:33:11 EST


Hi Martin,

FYI, the error/warning still remains.

tree: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head: b19e8c68470385dd2c5440876591fddb02c8c402
commit: 85d33df357b634649ddbe0a20fd2d0fc5732c3cb bpf: Introduce BPF_MAP_TYPE_STRUCT_OPS
date: 5 weeks ago
config: riscv-randconfig-a001-20200214 (attached as .config)
compiler: riscv64-linux-gcc (GCC) 7.5.0
reproduce:
wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
chmod +x ~/bin/make.cross
git checkout 85d33df357b634649ddbe0a20fd2d0fc5732c3cb
# save the attached .config to linux build tree
GCC_VERSION=7.5.0 make.cross ARCH=riscv

If you fix the issue, kindly add following tag
Reported-by: kbuild test robot <lkp@xxxxxxxxx>

All errors (new ones prefixed by >>):

include/asm-generic/hugetlb.h: In function 'huge_pte_dirty':
include/asm-generic/hugetlb.h:17:9: error: implicit declaration of function 'pte_dirty'; did you mean 'info_dirty'? [-Werror=implicit-function-declaration]
return pte_dirty(pte);
^~~~~~~~~
info_dirty
include/asm-generic/hugetlb.h: In function 'huge_pte_mkwrite':
include/asm-generic/hugetlb.h:22:9: error: implicit declaration of function 'pte_mkwrite'; did you mean 'pgd_write'? [-Werror=implicit-function-declaration]
return pte_mkwrite(pte);
^~~~~~~~~~~
pgd_write
include/asm-generic/hugetlb.h:22:9: error: incompatible types when returning type 'int' but 'pte_t {aka struct <anonymous>}' was expected
return pte_mkwrite(pte);
^~~~~~~~~~~~~~~~
include/asm-generic/hugetlb.h: In function 'huge_pte_mkdirty':
include/asm-generic/hugetlb.h:27:9: error: implicit declaration of function 'pte_mkdirty'; did you mean 'huge_pte_mkdirty'? [-Werror=implicit-function-declaration]
return pte_mkdirty(pte);
^~~~~~~~~~~
huge_pte_mkdirty
include/asm-generic/hugetlb.h:27:9: error: incompatible types when returning type 'int' but 'pte_t {aka struct <anonymous>}' was expected
return pte_mkdirty(pte);
^~~~~~~~~~~~~~~~
include/asm-generic/hugetlb.h: In function 'huge_pte_modify':
include/asm-generic/hugetlb.h:32:9: error: implicit declaration of function 'pte_modify'; did you mean 'lease_modify'? [-Werror=implicit-function-declaration]
return pte_modify(pte, newprot);
^~~~~~~~~~
lease_modify
include/asm-generic/hugetlb.h:32:9: error: incompatible types when returning type 'int' but 'pte_t {aka struct <anonymous>}' was expected
return pte_modify(pte, newprot);
^~~~~~~~~~~~~~~~~~~~~~~~
include/asm-generic/hugetlb.h: In function 'huge_pte_clear':
include/asm-generic/hugetlb.h:39:2: error: implicit declaration of function 'pte_clear'; did you mean 'pud_clear'? [-Werror=implicit-function-declaration]
pte_clear(mm, addr, ptep);
^~~~~~~~~
pud_clear
include/asm-generic/hugetlb.h: In function 'set_huge_pte_at':
include/asm-generic/hugetlb.h:56:2: error: implicit declaration of function 'set_pte_at'; did you mean 'set_huge_pte_at'? [-Werror=implicit-function-declaration]
set_pte_at(mm, addr, ptep, pte);
^~~~~~~~~~
set_huge_pte_at
include/asm-generic/hugetlb.h: In function 'huge_ptep_get_and_clear':
include/asm-generic/hugetlb.h:64:9: error: implicit declaration of function 'ptep_get_and_clear'; did you mean 'huge_ptep_get_and_clear'? [-Werror=implicit-function-declaration]
return ptep_get_and_clear(mm, addr, ptep);
^~~~~~~~~~~~~~~~~~
huge_ptep_get_and_clear
include/asm-generic/hugetlb.h:64:9: error: incompatible types when returning type 'int' but 'pte_t {aka struct <anonymous>}' was expected
return ptep_get_and_clear(mm, addr, ptep);
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
include/asm-generic/hugetlb.h: In function 'huge_ptep_clear_flush':
include/asm-generic/hugetlb.h:72:2: error: implicit declaration of function 'ptep_clear_flush'; did you mean 'huge_ptep_clear_flush'? [-Werror=implicit-function-declaration]
ptep_clear_flush(vma, addr, ptep);
^~~~~~~~~~~~~~~~
huge_ptep_clear_flush
include/asm-generic/hugetlb.h: In function 'huge_pte_none':
include/asm-generic/hugetlb.h:79:9: error: implicit declaration of function 'pte_none'; did you mean 'pud_none'? [-Werror=implicit-function-declaration]
return pte_none(pte);
^~~~~~~~
pud_none
include/asm-generic/hugetlb.h: In function 'huge_pte_wrprotect':
include/asm-generic/hugetlb.h:86:9: error: implicit declaration of function 'pte_wrprotect'; did you mean 'huge_pte_wrprotect'? [-Werror=implicit-function-declaration]
return pte_wrprotect(pte);
^~~~~~~~~~~~~
huge_pte_wrprotect
include/asm-generic/hugetlb.h:86:9: error: incompatible types when returning type 'int' but 'pte_t {aka struct <anonymous>}' was expected
return pte_wrprotect(pte);
^~~~~~~~~~~~~~~~~~
include/asm-generic/hugetlb.h: In function 'huge_ptep_set_wrprotect':
include/asm-generic/hugetlb.h:109:2: error: implicit declaration of function 'ptep_set_wrprotect'; did you mean 'huge_ptep_set_wrprotect'? [-Werror=implicit-function-declaration]
ptep_set_wrprotect(mm, addr, ptep);
^~~~~~~~~~~~~~~~~~
huge_ptep_set_wrprotect
include/asm-generic/hugetlb.h: In function 'huge_ptep_set_access_flags':
include/asm-generic/hugetlb.h:118:9: error: implicit declaration of function 'ptep_set_access_flags'; did you mean 'huge_ptep_set_access_flags'? [-Werror=implicit-function-declaration]
return ptep_set_access_flags(vma, addr, ptep, pte, dirty);
^~~~~~~~~~~~~~~~~~~~~
huge_ptep_set_access_flags
mm/hugetlb.c: In function 'make_huge_pte':
mm/hugetlb.c:3208:10: error: implicit declaration of function 'pte_mkyoung'; did you mean 'page_mapping'? [-Werror=implicit-function-declaration]
entry = pte_mkyoung(entry);
^~~~~~~~~~~
page_mapping
mm/hugetlb.c:3208:8: error: incompatible types when assigning to type 'pte_t {aka struct <anonymous>}' from type 'int'
entry = pte_mkyoung(entry);
^
mm/hugetlb.c:3209:10: error: implicit declaration of function 'pte_mkhuge'; did you mean 'pud_huge'? [-Werror=implicit-function-declaration]
entry = pte_mkhuge(entry);
^~~~~~~~~~
pud_huge
mm/hugetlb.c:3209:8: error: incompatible types when assigning to type 'pte_t {aka struct <anonymous>}' from type 'int'
entry = pte_mkhuge(entry);
^
mm/hugetlb.c: In function 'set_huge_ptep_writable':
mm/hugetlb.c:3222:3: error: implicit declaration of function 'update_mmu_cache'; did you mean 'node_add_cache'? [-Werror=implicit-function-declaration]
update_mmu_cache(vma, address, ptep);
^~~~~~~~~~~~~~~~
node_add_cache
mm/hugetlb.c: In function 'is_hugetlb_entry_migration':
mm/hugetlb.c:3229:28: error: implicit declaration of function 'pte_present'; did you mean 'pud_present'? [-Werror=implicit-function-declaration]
if (huge_pte_none(pte) || pte_present(pte))
^~~~~~~~~~~
pud_present
>> mm/hugetlb.c:3231:8: error: implicit declaration of function 'pte_to_swp_entry'; did you mean 'get_plt_entry'? [-Werror=implicit-function-declaration]
swp = pte_to_swp_entry(pte);
^~~~~~~~~~~~~~~~
get_plt_entry
mm/hugetlb.c:3231:6: error: incompatible types when assigning to type 'swp_entry_t {aka struct <anonymous>}' from type 'int'
swp = pte_to_swp_entry(pte);
^
mm/hugetlb.c:3232:6: error: implicit declaration of function 'non_swap_entry'; did you mean 'init_wait_entry'? [-Werror=implicit-function-declaration]
if (non_swap_entry(swp) && is_migration_entry(swp))
^~~~~~~~~~~~~~
init_wait_entry
mm/hugetlb.c:3232:29: error: implicit declaration of function 'is_migration_entry'; did you mean 'list_first_entry'? [-Werror=implicit-function-declaration]
if (non_swap_entry(swp) && is_migration_entry(swp))
^~~~~~~~~~~~~~~~~~
list_first_entry
mm/hugetlb.c: In function 'is_hugetlb_entry_hwpoisoned':
mm/hugetlb.c:3244:6: error: incompatible types when assigning to type 'swp_entry_t {aka struct <anonymous>}' from type 'int'
swp = pte_to_swp_entry(pte);
^
mm/hugetlb.c:3245:29: error: implicit declaration of function 'is_hwpoison_entry'; did you mean 'hwpoison_filter'? [-Werror=implicit-function-declaration]
if (non_swap_entry(swp) && is_hwpoison_entry(swp))
^~~~~~~~~~~~~~~~~
hwpoison_filter
mm/hugetlb.c: In function 'copy_hugetlb_page_range':
mm/hugetlb.c:3310:28: error: invalid initializer
swp_entry_t swp_entry = pte_to_swp_entry(entry);
^~~~~~~~~~~~~~~~
mm/hugetlb.c:3312:8: error: implicit declaration of function 'is_write_migration_entry'; did you mean 'init_wait_entry'? [-Werror=implicit-function-declaration]
if (is_write_migration_entry(swp_entry) && cow) {
^~~~~~~~~~~~~~~~~~~~~~~~
init_wait_entry
mm/hugetlb.c:3317:5: error: implicit declaration of function 'make_migration_entry_read'; did you mean 'thp_migration_supported'? [-Werror=implicit-function-declaration]
make_migration_entry_read(&swp_entry);
^~~~~~~~~~~~~~~~~~~~~~~~~
thp_migration_supported
mm/hugetlb.c:3318:13: error: implicit declaration of function 'swp_entry_to_pte'; did you mean '__d_entry_type'? [-Werror=implicit-function-declaration]
entry = swp_entry_to_pte(swp_entry);
^~~~~~~~~~~~~~~~
__d_entry_type
mm/hugetlb.c:3318:11: error: incompatible types when assigning to type 'pte_t {aka struct <anonymous>}' from type 'int'
entry = swp_entry_to_pte(swp_entry);
^
mm/hugetlb.c:3335:14: error: implicit declaration of function 'pte_page'; did you mean 'put_page'? [-Werror=implicit-function-declaration]
ptepage = pte_page(entry);
^~~~~~~~
put_page
mm/hugetlb.c:3335:12: warning: assignment makes pointer from integer without a cast [-Wint-conversion]
ptepage = pte_page(entry);
^
mm/hugetlb.c:3337:4: error: implicit declaration of function 'page_dup_rmap'; did you mean 'page_is_ram'? [-Werror=implicit-function-declaration]
page_dup_rmap(ptepage, true);
^~~~~~~~~~~~~
page_is_ram
mm/hugetlb.c: In function '__unmap_hugepage_range':
mm/hugetlb.c:3373:2: error: implicit declaration of function 'tlb_change_page_size'; did you mean 'huge_page_size'? [-Werror=implicit-function-declaration]
tlb_change_page_size(tlb, sz);
^~~~~~~~~~~~~~~~~~~~
huge_page_size
mm/hugetlb.c:3374:2: error: implicit declaration of function 'tlb_start_vma'; did you mean 'hstate_vma'? [-Werror=implicit-function-declaration]
tlb_start_vma(tlb, vma);
^~~~~~~~~~~~~
hstate_vma
mm/hugetlb.c:3415:8: warning: assignment makes pointer from integer without a cast [-Wint-conversion]
page = pte_page(pte);
^
mm/hugetlb.c:3435:3: error: implicit declaration of function 'tlb_remove_huge_tlb_entry'; did you mean 'move_hugetlb_state'? [-Werror=implicit-function-declaration]
tlb_remove_huge_tlb_entry(h, tlb, ptep, address);
^~~~~~~~~~~~~~~~~~~~~~~~~
move_hugetlb_state
mm/hugetlb.c:3440:3: error: implicit declaration of function 'page_remove_rmap'; did you mean 'page_anon_vma'? [-Werror=implicit-function-declaration]
page_remove_rmap(page, true);
^~~~~~~~~~~~~~~~
page_anon_vma
mm/hugetlb.c:3443:3: error: implicit declaration of function 'tlb_remove_page_size'; did you mean 'vma_mmu_pagesize'? [-Werror=implicit-function-declaration]
tlb_remove_page_size(tlb, page, huge_page_size(h));
^~~~~~~~~~~~~~~~~~~~
vma_mmu_pagesize
mm/hugetlb.c:3451:2: error: implicit declaration of function 'tlb_end_vma'; did you mean 'find_vma'? [-Werror=implicit-function-declaration]
tlb_end_vma(tlb, vma);
^~~~~~~~~~~
find_vma
mm/hugetlb.c: In function 'unmap_hugepage_range':
mm/hugetlb.c:3477:20: error: storage size of 'tlb' isn't known
struct mmu_gather tlb;
^~~
mm/hugetlb.c:3477:20: warning: unused variable 'tlb' [-Wunused-variable]
mm/hugetlb.c: In function 'hugetlb_cow':
mm/hugetlb.c:3572:11: warning: assignment makes pointer from integer without a cast [-Wint-conversion]
old_page = pte_page(pte);
^
mm/hugetlb.c:3578:3: error: implicit declaration of function 'page_move_anon_rmap'; did you mean 'page_anon_vma'? [-Werror=implicit-function-declaration]
page_move_anon_rmap(old_page, vma);
^~~~~~~~~~~~~~~~~~~
page_anon_vma
In file included from include/linux/kernel.h:11:0,
from include/linux/list.h:9,
from mm/hugetlb.c:6:
mm/hugetlb.c:3621:8: error: implicit declaration of function 'pte_same'; did you mean 'pte_val'? [-Werror=implicit-function-declaration]
pte_same(huge_ptep_get(ptep), pte)))
^
include/linux/compiler.h:33:34: note: in definition of macro '__branch_check__'

vim +3231 mm/hugetlb.c

1e8f889b10d8d22 David Gibson 2006-01-06 3224
d5ed7444dafb94b Aneesh Kumar K.V 2017-07-06 3225 bool is_hugetlb_entry_migration(pte_t pte)
4a705fef986231a Naoya Horiguchi 2014-06-23 3226 {
4a705fef986231a Naoya Horiguchi 2014-06-23 3227 swp_entry_t swp;
4a705fef986231a Naoya Horiguchi 2014-06-23 3228
4a705fef986231a Naoya Horiguchi 2014-06-23 3229 if (huge_pte_none(pte) || pte_present(pte))
d5ed7444dafb94b Aneesh Kumar K.V 2017-07-06 3230 return false;
4a705fef986231a Naoya Horiguchi 2014-06-23 @3231 swp = pte_to_swp_entry(pte);
4a705fef986231a Naoya Horiguchi 2014-06-23 3232 if (non_swap_entry(swp) && is_migration_entry(swp))
d5ed7444dafb94b Aneesh Kumar K.V 2017-07-06 3233 return true;
4a705fef986231a Naoya Horiguchi 2014-06-23 3234 else
d5ed7444dafb94b Aneesh Kumar K.V 2017-07-06 3235 return false;
4a705fef986231a Naoya Horiguchi 2014-06-23 3236 }
4a705fef986231a Naoya Horiguchi 2014-06-23 3237

:::::: The code at line 3231 was first introduced by commit
:::::: 4a705fef986231a3e7a6b1a6d3c37025f021f49f hugetlb: fix copy_hugetlb_page_range() to handle migration/hwpoisoned entry

:::::: TO: Naoya Horiguchi <n-horiguchi@xxxxxxxxxxxxx>
:::::: CC: Linus Torvalds <torvalds@xxxxxxxxxxxxxxxxxxxx>

---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@xxxxxxxxxxxx

Attachment: .config.gz
Description: application/gzip