Re: [PATCH 2/2] KVMM: Memory and interface related changes

From: kbuild test robot
Date: Mon May 18 2020 - 06:16:53 EST


Hi Anastassios,

Thank you for the patch! Yet something to improve:

[auto build test ERROR on v5.7-rc6]
[cannot apply to kvm/linux-next kvmarm/next tip/x86/core next-20200515]
[if your patch is applied to the wrong git tree, please drop us a note to help
improve the system. BTW, we also suggest to use '--base' option to specify the
base tree in git format-patch, please see https://stackoverflow.com/a/37406982]

url: https://github.com/0day-ci/linux/commits/Anastassios-Nanos/Expose-KVM-API-to-Linux-Kernel/20200518-150402
base: b9bbe6ed63b2b9f2c9ee5cbd0f2c946a2723f4ce
config: powerpc-defconfig (attached as .config)
compiler: powerpc64-linux-gcc (GCC) 9.3.0
reproduce:
wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
chmod +x ~/bin/make.cross
# save the attached .config to linux build tree
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-9.3.0 make.cross ARCH=powerpc

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

All errors (new ones prefixed by >>, old ones prefixed by <<):

arch/powerpc/kvm/../../../virt/kvm/kvm_main.c: In function 'hva_to_pfn_slow':
>> arch/powerpc/kvm/../../../virt/kvm/kvm_main.c:1837:4: error: 'npages_local' undeclared (first use in this function)
1837 | npages_local = 1;
| ^~~~~~~~~~~~
arch/powerpc/kvm/../../../virt/kvm/kvm_main.c:1837:4: note: each undeclared identifier is reported only once for each function it appears in

vim +/npages_local +1837 arch/powerpc/kvm/../../../virt/kvm/kvm_main.c

1800
1801 /*
1802 * The slow path to get the pfn of the specified host virtual address,
1803 * 1 indicates success, -errno is returned if error is detected.
1804 */
1805 static int hva_to_pfn_slow(unsigned long addr, bool *async, bool write_fault,
1806 bool *writable, kvm_pfn_t *pfn)
1807 {
1808 unsigned int flags = FOLL_HWPOISON;
1809 struct page *page;
1810 int npages = 0;
1811
1812 might_sleep();
1813
1814 if (writable)
1815 *writable = write_fault;
1816
1817 if (write_fault)
1818 flags |= FOLL_WRITE;
1819 if (async)
1820 flags |= FOLL_NOWAIT;
1821
1822 if (kvmm_valid_addr(addr)) {
1823 npages = 1;
1824 page = vmalloc_to_page((void *)addr);
1825 } else {
1826 npages = get_user_pages_unlocked(addr, 1, &page, flags);
1827 }
1828 if (npages != 1)
1829 return npages;
1830
1831 /* map read fault as writable if possible */
1832 if (unlikely(!write_fault) && writable) {
1833 struct page *wpage;
1834 int lnpages = 0;
1835
1836 if (kvmm_valid_addr(addr)) {
> 1837 npages_local = 1;
1838 wpage = vmalloc_to_page((void *)addr);
1839 } else {
1840 lnpages = __get_user_pages_fast(addr, 1, 1, &wpage);
1841 }
1842
1843 if (lnpages == 1) {
1844 *writable = true;
1845 put_page(page);
1846 page = wpage;
1847 }
1848 }
1849 *pfn = page_to_pfn(page);
1850 return npages;
1851 }
1852

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

Attachment: .config.gz
Description: application/gzip