All of lore.kernel.org
 help / color / mirror / Atom feed
From: kernel test robot <lkp@intel.com>
To: Lorenzo Stoakes <lorenzo.stoakes@oracle.com>
Cc: llvm@lists.linux.dev, oe-kbuild-all@lists.linux.dev,
	Jarkko Sakkinen <jarkko@kernel.org>
Subject: [jarkko-tpmdd:lgp-v2 2/4] mm/madvise.c:1098:3: error: field designator 'install_pte' does not refer to any field in type 'const struct mm_walk_ops'
Date: Fri, 25 Oct 2024 10:17:55 +0800	[thread overview]
Message-ID: <202410251055.UG8FVFhd-lkp@intel.com> (raw)

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/jarkko/linux-tpmdd.git lgp-v2
head:   7ed651841db9f18744191e575637d69239102a73
commit: 94de21c76e54641539032105ccd3f36801fa9d85 [2/4] mm: madvise: implement lightweight guard page mechanism
config: x86_64-kexec (https://download.01.org/0day-ci/archive/20241025/202410251055.UG8FVFhd-lkp@intel.com/config)
compiler: clang version 19.1.2 (https://github.com/llvm/llvm-project 7ba7d8e2f7b6445b60679da826210cdde29eaf8b)
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20241025/202410251055.UG8FVFhd-lkp@intel.com/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@intel.com>
| Closes: https://lore.kernel.org/oe-kbuild-all/202410251055.UG8FVFhd-lkp@intel.com/

All errors (new ones prefixed by >>):

   In file included from mm/madvise.c:9:
   In file included from include/linux/mman.h:5:
   In file included from include/linux/mm.h:2213:
   include/linux/vmstat.h:504:43: warning: arithmetic between different enumeration types ('enum zone_stat_item' and 'enum numa_stat_item') [-Wenum-enum-conversion]
     504 |         return vmstat_text[NR_VM_ZONE_STAT_ITEMS +
         |                            ~~~~~~~~~~~~~~~~~~~~~ ^
     505 |                            item];
         |                            ~~~~
   include/linux/vmstat.h:511:43: warning: arithmetic between different enumeration types ('enum zone_stat_item' and 'enum numa_stat_item') [-Wenum-enum-conversion]
     511 |         return vmstat_text[NR_VM_ZONE_STAT_ITEMS +
         |                            ~~~~~~~~~~~~~~~~~~~~~ ^
     512 |                            NR_VM_NUMA_EVENT_ITEMS +
         |                            ~~~~~~~~~~~~~~~~~~~~~~
   include/linux/vmstat.h:518:36: warning: arithmetic between different enumeration types ('enum node_stat_item' and 'enum lru_list') [-Wenum-enum-conversion]
     518 |         return node_stat_name(NR_LRU_BASE + lru) + 3; // skip "nr_"
         |                               ~~~~~~~~~~~ ^ ~~~
   include/linux/vmstat.h:524:43: warning: arithmetic between different enumeration types ('enum zone_stat_item' and 'enum numa_stat_item') [-Wenum-enum-conversion]
     524 |         return vmstat_text[NR_VM_ZONE_STAT_ITEMS +
         |                            ~~~~~~~~~~~~~~~~~~~~~ ^
     525 |                            NR_VM_NUMA_EVENT_ITEMS +
         |                            ~~~~~~~~~~~~~~~~~~~~~~
   In file included from mm/madvise.c:21:
   include/linux/mm_inline.h:47:41: warning: arithmetic between different enumeration types ('enum node_stat_item' and 'enum lru_list') [-Wenum-enum-conversion]
      47 |         __mod_lruvec_state(lruvec, NR_LRU_BASE + lru, nr_pages);
         |                                    ~~~~~~~~~~~ ^ ~~~
   include/linux/mm_inline.h:49:22: warning: arithmetic between different enumeration types ('enum zone_stat_item' and 'enum lru_list') [-Wenum-enum-conversion]
      49 |                                 NR_ZONE_LRU_BASE + lru, nr_pages);
         |                                 ~~~~~~~~~~~~~~~~ ^ ~~~
>> mm/madvise.c:1098:3: error: field designator 'install_pte' does not refer to any field in type 'const struct mm_walk_ops'
    1098 |         .install_pte            = guard_poison_install_pte,
         |         ~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
>> mm/madvise.c:1130:9: error: call to undeclared function 'walk_page_range_mm'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration]
    1130 |                 err = walk_page_range_mm(vma->vm_mm, start, end,
         |                       ^
   mm/madvise.c:1130:9: note: did you mean 'walk_page_range_vma'?
   include/linux/pagewalk.h:124:5: note: 'walk_page_range_vma' declared here
     124 | int walk_page_range_vma(struct vm_area_struct *vma, unsigned long start,
         |     ^
   6 warnings and 2 errors generated.


vim +1098 mm/madvise.c

  1093	
  1094	static const struct mm_walk_ops guard_poison_walk_ops = {
  1095		.pud_entry		= guard_poison_pud_entry,
  1096		.pmd_entry		= guard_poison_pmd_entry,
  1097		.pte_entry		= guard_poison_pte_entry,
> 1098		.install_pte		= guard_poison_install_pte,
  1099		.walk_lock		= PGWALK_RDLOCK,
  1100	};
  1101	
  1102	static long madvise_guard_poison(struct vm_area_struct *vma,
  1103					 struct vm_area_struct **prev,
  1104					 unsigned long start, unsigned long end)
  1105	{
  1106		long err;
  1107	
  1108		*prev = vma;
  1109		if (!is_valid_guard_vma(vma, /* allow_locked = */false))
  1110			return -EINVAL;
  1111	
  1112		/*
  1113		 * If we install poison markers, then the range is no longer
  1114		 * empty from a page table perspective and therefore it's
  1115		 * appropriate to have an anon_vma.
  1116		 *
  1117		 * This ensures that on fork, we copy page tables correctly.
  1118		 */
  1119		err = anon_vma_prepare(vma);
  1120		if (err)
  1121			return err;
  1122	
  1123		/*
  1124		 * Optimistically try to install the guard poison pages first. If any
  1125		 * non-guard pages are encountered, give up and zap the range before
  1126		 * trying again.
  1127		 */
  1128		while (true) {
  1129			/* Returns < 0 on error, == 0 if success, > 0 if zap needed. */
> 1130			err = walk_page_range_mm(vma->vm_mm, start, end,
  1131						 &guard_poison_walk_ops, NULL);
  1132			if (err <= 0)
  1133				return err;
  1134	
  1135			/*
  1136			 * OK some of the range have non-guard pages mapped, zap
  1137			 * them. This leaves existing guard pages in place.
  1138			 */
  1139			zap_page_range_single(vma, start, end - start, NULL);
  1140	
  1141			if (fatal_signal_pending(current))
  1142				return -EINTR;
  1143			cond_resched();
  1144		}
  1145	}
  1146	

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

                 reply	other threads:[~2024-10-25  2:18 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=202410251055.UG8FVFhd-lkp@intel.com \
    --to=lkp@intel.com \
    --cc=jarkko@kernel.org \
    --cc=llvm@lists.linux.dev \
    --cc=lorenzo.stoakes@oracle.com \
    --cc=oe-kbuild-all@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.