[vgupta-arc:topic-zol-remove 112/188] mm/memory.c:773:1: error: no previous prototype for function 'copy_nonpresent_pte'

From: kernel test robot
Date: Sat Oct 16 2021 - 08:35:01 EST


tree: https://git.kernel.org/pub/scm/linux/kernel/git/vgupta/arc.git topic-zol-remove
head: 5d273f5d5109b942d3be84a4db0ffe05feb901d4
commit: b55091ec6890b580d5ca97add1bb56b5502e67df [112/188] xxx: dbg: uninline copy_p*_range() functions
config: riscv-buildonly-randconfig-r005-20211016 (attached as .config)
compiler: clang version 14.0.0 (https://github.com/llvm/llvm-project a49f5386ce6b091da66ea7c3a1d9a588d53becf7)
reproduce (this is a W=1 build):
wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
chmod +x ~/bin/make.cross
# install riscv cross compiling tool for clang build
# apt-get install binutils-riscv64-linux-gnu
# https://git.kernel.org/pub/scm/linux/kernel/git/vgupta/arc.git/commit/?id=b55091ec6890b580d5ca97add1bb56b5502e67df
git remote add vgupta-arc https://git.kernel.org/pub/scm/linux/kernel/git/vgupta/arc.git
git fetch --no-tags vgupta-arc topic-zol-remove
git checkout b55091ec6890b580d5ca97add1bb56b5502e67df
# save the attached .config to linux build tree
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross W=1 ARCH=riscv

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

All errors (new ones prefixed by >>):

>> mm/memory.c:773:1: error: no previous prototype for function 'copy_nonpresent_pte' [-Werror,-Wmissing-prototypes]
copy_nonpresent_pte(struct mm_struct *dst_mm, struct mm_struct *src_mm,
^
mm/memory.c:772:10: note: declare 'static' if the function is not intended to be used outside of this translation unit
noinline unsigned long
^
static
>> mm/memory.c:1005:1: error: no previous prototype for function 'copy_pte_range' [-Werror,-Wmissing-prototypes]
copy_pte_range(struct vm_area_struct *dst_vma, struct vm_area_struct *src_vma,
^
mm/memory.c:1004:10: note: declare 'static' if the function is not intended to be used outside of this translation unit
noinline int
^
static
>> mm/memory.c:1129:1: error: no previous prototype for function 'copy_pmd_range' [-Werror,-Wmissing-prototypes]
copy_pmd_range(struct vm_area_struct *dst_vma, struct vm_area_struct *src_vma,
^
mm/memory.c:1128:10: note: declare 'static' if the function is not intended to be used outside of this translation unit
noinline int
^
static
>> mm/memory.c:1166:1: error: no previous prototype for function 'copy_pud_range' [-Werror,-Wmissing-prototypes]
copy_pud_range(struct vm_area_struct *dst_vma, struct vm_area_struct *src_vma,
^
mm/memory.c:1165:10: note: declare 'static' if the function is not intended to be used outside of this translation unit
noinline int
^
static
>> mm/memory.c:1203:1: error: no previous prototype for function 'copy_p4d_range' [-Werror,-Wmissing-prototypes]
copy_p4d_range(struct vm_area_struct *dst_vma, struct vm_area_struct *src_vma,
^
mm/memory.c:1202:10: note: declare 'static' if the function is not intended to be used outside of this translation unit
noinline int
^
static
mm/memory.c:3717:21: error: no previous prototype for function 'do_anonymous_page' [-Werror,-Wmissing-prototypes]
noinline vm_fault_t do_anonymous_page(struct vm_fault *vmf)
^
mm/memory.c:3717:10: note: declare 'static' if the function is not intended to be used outside of this translation unit
noinline vm_fault_t do_anonymous_page(struct vm_fault *vmf)
^
static
mm/memory.c:3833:21: error: no previous prototype for function '__do_fault' [-Werror,-Wmissing-prototypes]
noinline vm_fault_t __do_fault(struct vm_fault *vmf)
^
mm/memory.c:3833:10: note: declare 'static' if the function is not intended to be used outside of this translation unit
noinline vm_fault_t __do_fault(struct vm_fault *vmf)
^
static
mm/memory.c:4157:21: error: no previous prototype for function 'do_read_fault' [-Werror,-Wmissing-prototypes]
noinline vm_fault_t do_read_fault(struct vm_fault *vmf)
^
mm/memory.c:4157:10: note: declare 'static' if the function is not intended to be used outside of this translation unit
noinline vm_fault_t do_read_fault(struct vm_fault *vmf)
^
static
mm/memory.c:4186:21: error: no previous prototype for function 'do_cow_fault' [-Werror,-Wmissing-prototypes]
noinline vm_fault_t do_cow_fault(struct vm_fault *vmf)
^
mm/memory.c:4186:10: note: declare 'static' if the function is not intended to be used outside of this translation unit
noinline vm_fault_t do_cow_fault(struct vm_fault *vmf)
^
static
mm/memory.c:4224:21: error: no previous prototype for function 'do_shared_fault' [-Werror,-Wmissing-prototypes]
noinline vm_fault_t do_shared_fault(struct vm_fault *vmf)
^
mm/memory.c:4224:10: note: declare 'static' if the function is not intended to be used outside of this translation unit
noinline vm_fault_t do_shared_fault(struct vm_fault *vmf)
^
static
mm/memory.c:4267:21: error: no previous prototype for function 'do_fault' [-Werror,-Wmissing-prototypes]
noinline vm_fault_t do_fault(struct vm_fault *vmf)
^
mm/memory.c:4267:10: note: declare 'static' if the function is not intended to be used outside of this translation unit
noinline vm_fault_t do_fault(struct vm_fault *vmf)
^
static
mm/memory.c:4506:21: error: no previous prototype for function 'handle_pte_fault' [-Werror,-Wmissing-prototypes]
noinline vm_fault_t handle_pte_fault(struct vm_fault *vmf)
^
mm/memory.c:4506:10: note: declare 'static' if the function is not intended to be used outside of this translation unit
noinline vm_fault_t handle_pte_fault(struct vm_fault *vmf)
^
static
mm/memory.c:4610:21: error: no previous prototype for function '__handle_mm_fault' [-Werror,-Wmissing-prototypes]
noinline vm_fault_t __handle_mm_fault(struct vm_area_struct *vma,
^
mm/memory.c:4610:10: note: declare 'static' if the function is not intended to be used outside of this translation unit
noinline vm_fault_t __handle_mm_fault(struct vm_area_struct *vma,
^
static
13 errors generated.


vim +/copy_nonpresent_pte +773 mm/memory.c

b756a3b5e7ead8 Alistair Popple 2021-06-30 765
^1da177e4c3f41 Linus Torvalds 2005-04-16 766 /*
^1da177e4c3f41 Linus Torvalds 2005-04-16 767 * copy one vm_area from one task to the other. Assumes the page tables
^1da177e4c3f41 Linus Torvalds 2005-04-16 768 * already present in the new task to be cleared in the whole range
^1da177e4c3f41 Linus Torvalds 2005-04-16 769 * covered by this vma.
^1da177e4c3f41 Linus Torvalds 2005-04-16 770 */
^1da177e4c3f41 Linus Torvalds 2005-04-16 771
b55091ec6890b5 Vineet Gupta 2020-12-17 772 noinline unsigned long
df3a57d1f6072d Linus Torvalds 2020-09-23 @773 copy_nonpresent_pte(struct mm_struct *dst_mm, struct mm_struct *src_mm,
8f34f1eac3820f Peter Xu 2021-06-30 774 pte_t *dst_pte, pte_t *src_pte, struct vm_area_struct *dst_vma,
8f34f1eac3820f Peter Xu 2021-06-30 775 struct vm_area_struct *src_vma, unsigned long addr, int *rss)
^1da177e4c3f41 Linus Torvalds 2005-04-16 776 {
8f34f1eac3820f Peter Xu 2021-06-30 777 unsigned long vm_flags = dst_vma->vm_flags;
^1da177e4c3f41 Linus Torvalds 2005-04-16 778 pte_t pte = *src_pte;
^1da177e4c3f41 Linus Torvalds 2005-04-16 779 struct page *page;
0697212a411c1d Christoph Lameter 2006-06-23 780 swp_entry_t entry = pte_to_swp_entry(pte);
0697212a411c1d Christoph Lameter 2006-06-23 781
2022b4d18a491a Hugh Dickins 2014-12-02 782 if (likely(!non_swap_entry(entry))) {
570a335b8e2257 Hugh Dickins 2009-12-14 783 if (swap_duplicate(entry) < 0)
9a5cc85c407402 Alistair Popple 2021-06-30 784 return -EIO;
570a335b8e2257 Hugh Dickins 2009-12-14 785
^1da177e4c3f41 Linus Torvalds 2005-04-16 786 /* make sure dst_mm is on swapoff's mmlist. */
^1da177e4c3f41 Linus Torvalds 2005-04-16 787 if (unlikely(list_empty(&dst_mm->mmlist))) {
^1da177e4c3f41 Linus Torvalds 2005-04-16 788 spin_lock(&mmlist_lock);
f412ac08c9861b Hugh Dickins 2005-10-29 789 if (list_empty(&dst_mm->mmlist))
f412ac08c9861b Hugh Dickins 2005-10-29 790 list_add(&dst_mm->mmlist,
f412ac08c9861b Hugh Dickins 2005-10-29 791 &src_mm->mmlist);
^1da177e4c3f41 Linus Torvalds 2005-04-16 792 spin_unlock(&mmlist_lock);
^1da177e4c3f41 Linus Torvalds 2005-04-16 793 }
b084d4353ff99d KAMEZAWA Hiroyuki 2010-03-05 794 rss[MM_SWAPENTS]++;
2022b4d18a491a Hugh Dickins 2014-12-02 795 } else if (is_migration_entry(entry)) {
af5cdaf82238fb Alistair Popple 2021-06-30 796 page = pfn_swap_entry_to_page(entry);
9f9f1acd713d69 Konstantin Khlebnikov 2012-01-20 797
eca56ff906bdd0 Jerome Marchand 2016-01-14 798 rss[mm_counter(page)]++;
9f9f1acd713d69 Konstantin Khlebnikov 2012-01-20 799
4dd845b5a3e57a Alistair Popple 2021-06-30 800 if (is_writable_migration_entry(entry) &&
0697212a411c1d Christoph Lameter 2006-06-23 801 is_cow_mapping(vm_flags)) {
0697212a411c1d Christoph Lameter 2006-06-23 802 /*
9f9f1acd713d69 Konstantin Khlebnikov 2012-01-20 803 * COW mappings require pages in both
9f9f1acd713d69 Konstantin Khlebnikov 2012-01-20 804 * parent and child to be set to read.
0697212a411c1d Christoph Lameter 2006-06-23 805 */
4dd845b5a3e57a Alistair Popple 2021-06-30 806 entry = make_readable_migration_entry(
4dd845b5a3e57a Alistair Popple 2021-06-30 807 swp_offset(entry));
0697212a411c1d Christoph Lameter 2006-06-23 808 pte = swp_entry_to_pte(entry);
c3d16e16522fe3 Cyrill Gorcunov 2013-10-16 809 if (pte_swp_soft_dirty(*src_pte))
c3d16e16522fe3 Cyrill Gorcunov 2013-10-16 810 pte = pte_swp_mksoft_dirty(pte);
f45ec5ff16a75f Peter Xu 2020-04-06 811 if (pte_swp_uffd_wp(*src_pte))
f45ec5ff16a75f Peter Xu 2020-04-06 812 pte = pte_swp_mkuffd_wp(pte);
0697212a411c1d Christoph Lameter 2006-06-23 813 set_pte_at(src_mm, addr, src_pte, pte);
0697212a411c1d Christoph Lameter 2006-06-23 814 }
5042db43cc26f5 Jérôme Glisse 2017-09-08 815 } else if (is_device_private_entry(entry)) {
af5cdaf82238fb Alistair Popple 2021-06-30 816 page = pfn_swap_entry_to_page(entry);
5042db43cc26f5 Jérôme Glisse 2017-09-08 817
5042db43cc26f5 Jérôme Glisse 2017-09-08 818 /*
5042db43cc26f5 Jérôme Glisse 2017-09-08 819 * Update rss count even for unaddressable pages, as
5042db43cc26f5 Jérôme Glisse 2017-09-08 820 * they should treated just like normal pages in this
5042db43cc26f5 Jérôme Glisse 2017-09-08 821 * respect.
5042db43cc26f5 Jérôme Glisse 2017-09-08 822 *
5042db43cc26f5 Jérôme Glisse 2017-09-08 823 * We will likely want to have some new rss counters
5042db43cc26f5 Jérôme Glisse 2017-09-08 824 * for unaddressable pages, at some point. But for now
5042db43cc26f5 Jérôme Glisse 2017-09-08 825 * keep things as they are.
5042db43cc26f5 Jérôme Glisse 2017-09-08 826 */
5042db43cc26f5 Jérôme Glisse 2017-09-08 827 get_page(page);
5042db43cc26f5 Jérôme Glisse 2017-09-08 828 rss[mm_counter(page)]++;
5042db43cc26f5 Jérôme Glisse 2017-09-08 829 page_dup_rmap(page, false);
5042db43cc26f5 Jérôme Glisse 2017-09-08 830
5042db43cc26f5 Jérôme Glisse 2017-09-08 831 /*
5042db43cc26f5 Jérôme Glisse 2017-09-08 832 * We do not preserve soft-dirty information, because so
5042db43cc26f5 Jérôme Glisse 2017-09-08 833 * far, checkpoint/restore is the only feature that
5042db43cc26f5 Jérôme Glisse 2017-09-08 834 * requires that. And checkpoint/restore does not work
5042db43cc26f5 Jérôme Glisse 2017-09-08 835 * when a device driver is involved (you cannot easily
5042db43cc26f5 Jérôme Glisse 2017-09-08 836 * save and restore device driver state).
5042db43cc26f5 Jérôme Glisse 2017-09-08 837 */
4dd845b5a3e57a Alistair Popple 2021-06-30 838 if (is_writable_device_private_entry(entry) &&
5042db43cc26f5 Jérôme Glisse 2017-09-08 839 is_cow_mapping(vm_flags)) {
4dd845b5a3e57a Alistair Popple 2021-06-30 840 entry = make_readable_device_private_entry(
4dd845b5a3e57a Alistair Popple 2021-06-30 841 swp_offset(entry));
5042db43cc26f5 Jérôme Glisse 2017-09-08 842 pte = swp_entry_to_pte(entry);
f45ec5ff16a75f Peter Xu 2020-04-06 843 if (pte_swp_uffd_wp(*src_pte))
f45ec5ff16a75f Peter Xu 2020-04-06 844 pte = pte_swp_mkuffd_wp(pte);
5042db43cc26f5 Jérôme Glisse 2017-09-08 845 set_pte_at(src_mm, addr, src_pte, pte);
5042db43cc26f5 Jérôme Glisse 2017-09-08 846 }
b756a3b5e7ead8 Alistair Popple 2021-06-30 847 } else if (is_device_exclusive_entry(entry)) {
b756a3b5e7ead8 Alistair Popple 2021-06-30 848 /*
b756a3b5e7ead8 Alistair Popple 2021-06-30 849 * Make device exclusive entries present by restoring the
b756a3b5e7ead8 Alistair Popple 2021-06-30 850 * original entry then copying as for a present pte. Device
b756a3b5e7ead8 Alistair Popple 2021-06-30 851 * exclusive entries currently only support private writable
b756a3b5e7ead8 Alistair Popple 2021-06-30 852 * (ie. COW) mappings.
b756a3b5e7ead8 Alistair Popple 2021-06-30 853 */
b756a3b5e7ead8 Alistair Popple 2021-06-30 854 VM_BUG_ON(!is_cow_mapping(src_vma->vm_flags));
b756a3b5e7ead8 Alistair Popple 2021-06-30 855 if (try_restore_exclusive_pte(src_pte, src_vma, addr))
b756a3b5e7ead8 Alistair Popple 2021-06-30 856 return -EBUSY;
b756a3b5e7ead8 Alistair Popple 2021-06-30 857 return -ENOENT;
^1da177e4c3f41 Linus Torvalds 2005-04-16 858 }
8f34f1eac3820f Peter Xu 2021-06-30 859 if (!userfaultfd_wp(dst_vma))
8f34f1eac3820f Peter Xu 2021-06-30 860 pte = pte_swp_clear_uffd_wp(pte);
df3a57d1f6072d Linus Torvalds 2020-09-23 861 set_pte_at(dst_mm, addr, dst_pte, pte);
df3a57d1f6072d Linus Torvalds 2020-09-23 862 return 0;
^1da177e4c3f41 Linus Torvalds 2005-04-16 863 }
^1da177e4c3f41 Linus Torvalds 2005-04-16 864

:::::: The code at line 773 was first introduced by commit
:::::: df3a57d1f6072d07978bafa7dbd9904cdf8f3e13 mm: split out the non-present case from copy_one_pte()

:::::: TO: Linus Torvalds <torvalds@xxxxxxxxxxxxxxxxxxxx>
:::::: 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