lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite for Android: free password hash cracker in your pocket
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <202103280335.BK1WDXLW-lkp@intel.com>
Date:   Sun, 28 Mar 2021 03:06:40 +0800
From:   kernel test robot <lkp@...el.com>
To:     Jason Gunthorpe <jgg@...dia.com>
Cc:     kbuild-all@...ts.01.org, clang-built-linux@...glegroups.com,
        linux-kernel@...r.kernel.org,
        Alex Williamson <alex.williamson@...hat.com>,
        Eric Auger <eric.auger@...hat.com>
Subject: drivers/vfio/pci/vfio_pci_nvlink2.c:101:10: error: implicit
 declaration of function 'mm_iommu_put'

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head:   0f4498cef9f5cd18d7c6639a2a902ec1edc5be4e
commit: 179209fa12709a3df8888c323b37315da2683c24 vfio: IOMMU_API should be selected
date:   11 days ago
config: powerpc64-randconfig-r031-20210328 (attached as .config)
compiler: clang version 13.0.0 (https://github.com/llvm/llvm-project d50fe9f0d6b9ee61df8830a67ea0a33c27a637e7)
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 powerpc64 cross compiling tool for clang build
        # apt-get install binutils-powerpc64-linux-gnu
        # https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=179209fa12709a3df8888c323b37315da2683c24
        git remote add linus https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
        git fetch --no-tags linus master
        git checkout 179209fa12709a3df8888c323b37315da2683c24
        # save the attached .config to linux build tree
        COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross ARCH=powerpc64 

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

All errors (new ones prefixed by >>):

>> drivers/vfio/pci/vfio_pci_nvlink2.c:101:10: error: implicit declaration of function 'mm_iommu_put' [-Werror,-Wimplicit-function-declaration]
                           ret = mm_iommu_put(data->mm, data->mem);
                                 ^
   drivers/vfio/pci/vfio_pci_nvlink2.c:101:10: note: did you mean 'mm_iommu_init'?
   arch/powerpc/include/asm/mmu_context.h:57:20: note: 'mm_iommu_init' declared here
   static inline void mm_iommu_init(struct mm_struct *mm) { }
                      ^
>> drivers/vfio/pci/vfio_pci_nvlink2.c:165:14: error: implicit declaration of function 'mm_iommu_newdev' [-Werror,-Wimplicit-function-declaration]
           ret = (int) mm_iommu_newdev(data->mm, data->useraddr,
                       ^
   2 errors generated.


vim +/mm_iommu_put +101 drivers/vfio/pci/vfio_pci_nvlink2.c

7f92891778dff6 Alexey Kardashevskiy 2018-12-20   91  
7f92891778dff6 Alexey Kardashevskiy 2018-12-20   92  static void vfio_pci_nvgpu_release(struct vfio_pci_device *vdev,
7f92891778dff6 Alexey Kardashevskiy 2018-12-20   93  		struct vfio_pci_region *region)
7f92891778dff6 Alexey Kardashevskiy 2018-12-20   94  {
7f92891778dff6 Alexey Kardashevskiy 2018-12-20   95  	struct vfio_pci_nvgpu_data *data = region->data;
7f92891778dff6 Alexey Kardashevskiy 2018-12-20   96  	long ret;
7f92891778dff6 Alexey Kardashevskiy 2018-12-20   97  
7f92891778dff6 Alexey Kardashevskiy 2018-12-20   98  	/* If there were any mappings at all... */
7f92891778dff6 Alexey Kardashevskiy 2018-12-20   99  	if (data->mm) {
338b4e10f939a7 Alexey Kardashevskiy 2019-12-23  100  		if (data->mem) {
7f92891778dff6 Alexey Kardashevskiy 2018-12-20 @101  			ret = mm_iommu_put(data->mm, data->mem);
7f92891778dff6 Alexey Kardashevskiy 2018-12-20  102  			WARN_ON(ret);
338b4e10f939a7 Alexey Kardashevskiy 2019-12-23  103  		}
7f92891778dff6 Alexey Kardashevskiy 2018-12-20  104  
7f92891778dff6 Alexey Kardashevskiy 2018-12-20  105  		mmdrop(data->mm);
7f92891778dff6 Alexey Kardashevskiy 2018-12-20  106  	}
7f92891778dff6 Alexey Kardashevskiy 2018-12-20  107  
7f92891778dff6 Alexey Kardashevskiy 2018-12-20  108  	vfio_unregister_notifier(&data->gpdev->dev, VFIO_GROUP_NOTIFY,
7f92891778dff6 Alexey Kardashevskiy 2018-12-20  109  			&data->group_notifier);
7f92891778dff6 Alexey Kardashevskiy 2018-12-20  110  
7f92891778dff6 Alexey Kardashevskiy 2018-12-20  111  	pnv_npu2_unmap_lpar_dev(data->gpdev);
7f92891778dff6 Alexey Kardashevskiy 2018-12-20  112  
7f92891778dff6 Alexey Kardashevskiy 2018-12-20  113  	kfree(data);
7f92891778dff6 Alexey Kardashevskiy 2018-12-20  114  }
7f92891778dff6 Alexey Kardashevskiy 2018-12-20  115  
7f92891778dff6 Alexey Kardashevskiy 2018-12-20  116  static vm_fault_t vfio_pci_nvgpu_mmap_fault(struct vm_fault *vmf)
7f92891778dff6 Alexey Kardashevskiy 2018-12-20  117  {
7f92891778dff6 Alexey Kardashevskiy 2018-12-20  118  	vm_fault_t ret;
7f92891778dff6 Alexey Kardashevskiy 2018-12-20  119  	struct vm_area_struct *vma = vmf->vma;
7f92891778dff6 Alexey Kardashevskiy 2018-12-20  120  	struct vfio_pci_region *region = vma->vm_private_data;
7f92891778dff6 Alexey Kardashevskiy 2018-12-20  121  	struct vfio_pci_nvgpu_data *data = region->data;
7f92891778dff6 Alexey Kardashevskiy 2018-12-20  122  	unsigned long vmf_off = (vmf->address - vma->vm_start) >> PAGE_SHIFT;
7f92891778dff6 Alexey Kardashevskiy 2018-12-20  123  	unsigned long nv2pg = data->gpu_hpa >> PAGE_SHIFT;
7f92891778dff6 Alexey Kardashevskiy 2018-12-20  124  	unsigned long vm_pgoff = vma->vm_pgoff &
7f92891778dff6 Alexey Kardashevskiy 2018-12-20  125  		((1U << (VFIO_PCI_OFFSET_SHIFT - PAGE_SHIFT)) - 1);
7f92891778dff6 Alexey Kardashevskiy 2018-12-20  126  	unsigned long pfn = nv2pg + vm_pgoff + vmf_off;
7f92891778dff6 Alexey Kardashevskiy 2018-12-20  127  
7f92891778dff6 Alexey Kardashevskiy 2018-12-20  128  	ret = vmf_insert_pfn(vma, vmf->address, pfn);
7f92891778dff6 Alexey Kardashevskiy 2018-12-20  129  	trace_vfio_pci_nvgpu_mmap_fault(data->gpdev, pfn << PAGE_SHIFT,
7f92891778dff6 Alexey Kardashevskiy 2018-12-20  130  			vmf->address, ret);
7f92891778dff6 Alexey Kardashevskiy 2018-12-20  131  
7f92891778dff6 Alexey Kardashevskiy 2018-12-20  132  	return ret;
7f92891778dff6 Alexey Kardashevskiy 2018-12-20  133  }
7f92891778dff6 Alexey Kardashevskiy 2018-12-20  134  
7f92891778dff6 Alexey Kardashevskiy 2018-12-20  135  static const struct vm_operations_struct vfio_pci_nvgpu_mmap_vmops = {
7f92891778dff6 Alexey Kardashevskiy 2018-12-20  136  	.fault = vfio_pci_nvgpu_mmap_fault,
7f92891778dff6 Alexey Kardashevskiy 2018-12-20  137  };
7f92891778dff6 Alexey Kardashevskiy 2018-12-20  138  
7f92891778dff6 Alexey Kardashevskiy 2018-12-20  139  static int vfio_pci_nvgpu_mmap(struct vfio_pci_device *vdev,
7f92891778dff6 Alexey Kardashevskiy 2018-12-20  140  		struct vfio_pci_region *region, struct vm_area_struct *vma)
7f92891778dff6 Alexey Kardashevskiy 2018-12-20  141  {
7f92891778dff6 Alexey Kardashevskiy 2018-12-20  142  	int ret;
7f92891778dff6 Alexey Kardashevskiy 2018-12-20  143  	struct vfio_pci_nvgpu_data *data = region->data;
7f92891778dff6 Alexey Kardashevskiy 2018-12-20  144  
7f92891778dff6 Alexey Kardashevskiy 2018-12-20  145  	if (data->useraddr)
7f92891778dff6 Alexey Kardashevskiy 2018-12-20  146  		return -EPERM;
7f92891778dff6 Alexey Kardashevskiy 2018-12-20  147  
7f92891778dff6 Alexey Kardashevskiy 2018-12-20  148  	if (vma->vm_end - vma->vm_start > data->size)
7f92891778dff6 Alexey Kardashevskiy 2018-12-20  149  		return -EINVAL;
7f92891778dff6 Alexey Kardashevskiy 2018-12-20  150  
7f92891778dff6 Alexey Kardashevskiy 2018-12-20  151  	vma->vm_private_data = region;
7f92891778dff6 Alexey Kardashevskiy 2018-12-20  152  	vma->vm_flags |= VM_PFNMAP;
7f92891778dff6 Alexey Kardashevskiy 2018-12-20  153  	vma->vm_ops = &vfio_pci_nvgpu_mmap_vmops;
7f92891778dff6 Alexey Kardashevskiy 2018-12-20  154  
7f92891778dff6 Alexey Kardashevskiy 2018-12-20  155  	/*
7f92891778dff6 Alexey Kardashevskiy 2018-12-20  156  	 * Calling mm_iommu_newdev() here once as the region is not
7f92891778dff6 Alexey Kardashevskiy 2018-12-20  157  	 * registered yet and therefore right initialization will happen now.
7f92891778dff6 Alexey Kardashevskiy 2018-12-20  158  	 * Other places will use mm_iommu_find() which returns
7f92891778dff6 Alexey Kardashevskiy 2018-12-20  159  	 * registered @mem and does not go gup().
7f92891778dff6 Alexey Kardashevskiy 2018-12-20  160  	 */
7f92891778dff6 Alexey Kardashevskiy 2018-12-20  161  	data->useraddr = vma->vm_start;
7f92891778dff6 Alexey Kardashevskiy 2018-12-20  162  	data->mm = current->mm;
7f92891778dff6 Alexey Kardashevskiy 2018-12-20  163  
bb3d3cf928d4cc Julia Lawall         2019-12-29  164  	mmgrab(data->mm);
7f92891778dff6 Alexey Kardashevskiy 2018-12-20 @165  	ret = (int) mm_iommu_newdev(data->mm, data->useraddr,
e66e02c4d96d33 Peng Hao             2019-07-02  166  			vma_pages(vma), data->gpu_hpa, &data->mem);
7f92891778dff6 Alexey Kardashevskiy 2018-12-20  167  
7f92891778dff6 Alexey Kardashevskiy 2018-12-20  168  	trace_vfio_pci_nvgpu_mmap(vdev->pdev, data->gpu_hpa, data->useraddr,
7f92891778dff6 Alexey Kardashevskiy 2018-12-20  169  			vma->vm_end - vma->vm_start, ret);
7f92891778dff6 Alexey Kardashevskiy 2018-12-20  170  
7f92891778dff6 Alexey Kardashevskiy 2018-12-20  171  	return ret;
7f92891778dff6 Alexey Kardashevskiy 2018-12-20  172  }
7f92891778dff6 Alexey Kardashevskiy 2018-12-20  173  

:::::: The code at line 101 was first introduced by commit
:::::: 7f92891778dff62303c070ac81de7b7d80de331a vfio_pci: Add NVIDIA GV100GL [Tesla V100 SXM2] subdriver

:::::: TO: Alexey Kardashevskiy <aik@...abs.ru>
:::::: CC: Michael Ellerman <mpe@...erman.id.au>

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

Download attachment ".config.gz" of type "application/gzip" (48898 bytes)

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ