Re: [PATCH 36/43] x86: kmsan: sync metadata pages on page fault

kernel test robot
2021-12-14T22:44:33Z

Hi Alexander,

I love your patch! Perhaps something to improve:

[auto build test WARNING on tip/x86/mm]
[also build test WARNING on linus/master v5.16-rc5]
[cannot apply to tip/x86/core hnaz-mm/master next-20211213]
[If your patch is applied to the wrong git tree, kindly drop us a note.
And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch]

url: https://github.com/0day-ci/linux/commits/Alexander-Potapenko/Add-KernelMemorySanitizer-infrastructure/20211215-003033
base: https://git.kernel.org/pub/scm/linux/kernel/git/tip/tip.git 35fa745286ac44ee26ed100c2bd2553368ad193b
config: i386-randconfig-r015-20211214 (https://download.01.org/0day-ci/archive/20211215/202112150621.jBfij0NA-lkp@intel.com/config)
compiler: clang version 14.0.0 (https://github.com/llvm/llvm-project b6a2ddb6c8ac29412b1361810972e15221fa021c)
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
# https://github.com/0day-ci/linux/commit/b9eff579426967ca933560818b165769b449377b
git remote add linux-review https://github.com/0day-ci/linux
git fetch --no-tags linux-review Alexander-Potapenko/Add-KernelMemorySanitizer-infrastructure/20211215-003033
git checkout b9eff579426967ca933560818b165769b449377b
# save the config file to linux build tree
mkdir build_dir
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross W=1 O=build_dir ARCH=i386 SHELL=/bin/bash arch/x86/mm/

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

All warnings (new ones prefixed by >>):

>> arch/x86/mm/fault.c:263:6: warning: no previous prototype for function '__arch_sync_kernel_mappings' [-Wmissing-prototypes]
void __arch_sync_kernel_mappings(unsigned long start, unsigned long end)
^
arch/x86/mm/fault.c:263:1: note: declare 'static' if the function is not intended to be used outside of this translation unit
void __arch_sync_kernel_mappings(unsigned long start, unsigned long end)
^
static
arch/x86/mm/fault.c:299:28: error: use of undeclared identifier 'KMSAN_VMALLOC_SHADOW_START'
start - VMALLOC_START + KMSAN_VMALLOC_SHADOW_START,
^
arch/x86/mm/fault.c:300:26: error: use of undeclared identifier 'KMSAN_VMALLOC_SHADOW_START'
end - VMALLOC_START + KMSAN_VMALLOC_SHADOW_START);
^
arch/x86/mm/fault.c:302:28: error: use of undeclared identifier 'KMSAN_VMALLOC_ORIGIN_START'
start - VMALLOC_START + KMSAN_VMALLOC_ORIGIN_START,
^
arch/x86/mm/fault.c:303:26: error: use of undeclared identifier 'KMSAN_VMALLOC_ORIGIN_START'
end - VMALLOC_START + KMSAN_VMALLOC_ORIGIN_START);
^
1 warning and 4 errors generated.

vim +/__arch_sync_kernel_mappings +263 arch/x86/mm/fault.c

262
> 263 void __arch_sync_kernel_mappings(unsigned long start, unsigned long end)
264 {
265 unsigned long addr;
266
267 for (addr = start & PMD_MASK;
268 addr >= TASK_SIZE_MAX && addr < VMALLOC_END;
269 addr += PMD_SIZE) {
270 struct page *page;
271
272 spin_lock(&pgd_lock);
273 list_for_each_entry(page, &pgd_list, lru) {
274 spinlock_t *pgt_lock;
275
276 /* the pgt_lock only for Xen */
277 pgt_lock = &pgd_page_get_mm(page)->page_table_lock;
278
279 spin_lock(pgt_lock);
280 vmalloc_sync_one(page_address(page), addr);
281 spin_unlock(pgt_lock);
282 }
283 spin_unlock(&pgd_lock);
284 }
285 }
286

---
0-DAY CI Kernel Test Service, Intel Corporation