From: kernel test robot <lkp@intel.com>
To: ankita@nvidia.com, jgg@nvidia.com, alex.williamson@redhat.com,
naoya.horiguchi@nec.com, maz@kernel.org, oliver.upton@linux.dev
Cc: oe-kbuild-all@lists.linux.dev, aniketa@nvidia.com,
cjia@nvidia.com, kwankhede@nvidia.com, targupta@nvidia.com,
vsethi@nvidia.com, acurrid@nvidia.com, apopple@nvidia.com,
jhubbard@nvidia.com, danw@nvidia.com, kvm@vger.kernel.org,
linux-kernel@vger.kernel.org,
linux-arm-kernel@lists.infradead.org, linux-mm@kvack.org
Subject: Re: [PATCH v3 2/6] vfio/nvgpu: expose GPU device memory as BAR1
Date: Thu, 6 Apr 2023 05:07:54 +0800 [thread overview]
Message-ID: <202304060424.MtQM4udq-lkp@intel.com> (raw)
In-Reply-To: <20230405180134.16932-3-ankita@nvidia.com>
Hi,
kernel test robot noticed the following build warnings:
[auto build test WARNING on awilliam-vfio/for-linus]
[also build test WARNING on kvmarm/next akpm-mm/mm-everything linus/master v6.3-rc5 next-20230405]
[cannot apply to awilliam-vfio/next]
[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#_base_tree_information]
url: https://github.com/intel-lab-lkp/linux/commits/ankita-nvidia-com/kvm-determine-memory-type-from-VMA/20230406-020404
base: https://github.com/awilliam/linux-vfio.git for-linus
patch link: https://lore.kernel.org/r/20230405180134.16932-3-ankita%40nvidia.com
patch subject: [PATCH v3 2/6] vfio/nvgpu: expose GPU device memory as BAR1
config: sparc-allyesconfig (https://download.01.org/0day-ci/archive/20230406/202304060424.MtQM4udq-lkp@intel.com/config)
compiler: sparc64-linux-gcc (GCC) 12.1.0
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/intel-lab-lkp/linux/commit/09ea30fcd2fb02d13a38cab4bf3d903f902408f4
git remote add linux-review https://github.com/intel-lab-lkp/linux
git fetch --no-tags linux-review ankita-nvidia-com/kvm-determine-memory-type-from-VMA/20230406-020404
git checkout 09ea30fcd2fb02d13a38cab4bf3d903f902408f4
# save the config file
mkdir build_dir && cp config build_dir/.config
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-12.1.0 make.cross W=1 O=build_dir ARCH=sparc olddefconfig
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-12.1.0 make.cross W=1 O=build_dir ARCH=sparc SHELL=/bin/bash drivers/vfio/pci/nvgpu/
If you fix the issue, kindly add following tag where applicable
| Reported-by: kernel test robot <lkp@intel.com>
| Link: https://lore.kernel.org/oe-kbuild-all/202304060424.MtQM4udq-lkp@intel.com/
All warnings (new ones prefixed by >>):
>> drivers/vfio/pci/nvgpu/main.c:57:5: warning: no previous prototype for 'nvgpu_vfio_pci_mmap' [-Wmissing-prototypes]
57 | int nvgpu_vfio_pci_mmap(struct vfio_device *core_vdev,
| ^~~~~~~~~~~~~~~~~~~
>> drivers/vfio/pci/nvgpu/main.c:100:6: warning: no previous prototype for 'nvgpu_vfio_pci_ioctl' [-Wmissing-prototypes]
100 | long nvgpu_vfio_pci_ioctl(struct vfio_device *core_vdev, unsigned int cmd,
| ^~~~~~~~~~~~~~~~~~~~
vim +/nvgpu_vfio_pci_mmap +57 drivers/vfio/pci/nvgpu/main.c
56
> 57 int nvgpu_vfio_pci_mmap(struct vfio_device *core_vdev,
58 struct vm_area_struct *vma)
59 {
60 struct nvgpu_vfio_pci_core_device *nvdev = container_of(
61 core_vdev, struct nvgpu_vfio_pci_core_device, core_device.vdev);
62
63 unsigned long start_pfn;
64 unsigned int index;
65 u64 req_len, pgoff;
66 int ret = 0;
67
68 index = vma->vm_pgoff >> (VFIO_PCI_OFFSET_SHIFT - PAGE_SHIFT);
69 if (index != nvdev->mem_prop.bar1_start_offset)
70 return vfio_pci_core_mmap(core_vdev, vma);
71
72 /*
73 * Request to mmap the BAR1. Map to the CPU accessible memory on the
74 * GPU using the memory information gathered from the system ACPI
75 * tables.
76 */
77 start_pfn = nvdev->mem_prop.hpa >> PAGE_SHIFT;
78 req_len = vma->vm_end - vma->vm_start;
79 pgoff = vma->vm_pgoff &
80 ((1U << (VFIO_PCI_OFFSET_SHIFT - PAGE_SHIFT)) - 1);
81 if (pgoff >= (nvdev->mem_prop.mem_length >> PAGE_SHIFT))
82 return -EINVAL;
83
84 /*
85 * Perform a PFN map to the memory. The device BAR1 is backed by the
86 * GPU memory now. Check that the mapping does not overflow out of
87 * the GPU memory size.
88 */
89 ret = remap_pfn_range(vma, vma->vm_start, start_pfn + pgoff,
90 min(req_len, nvdev->mem_prop.mem_length - pgoff),
91 vma->vm_page_prot);
92 if (ret)
93 return ret;
94
95 vma->vm_pgoff = start_pfn + pgoff;
96
97 return 0;
98 }
99
> 100 long nvgpu_vfio_pci_ioctl(struct vfio_device *core_vdev, unsigned int cmd,
101 unsigned long arg)
102 {
103 struct nvgpu_vfio_pci_core_device *nvdev = container_of(
104 core_vdev, struct nvgpu_vfio_pci_core_device, core_device.vdev);
105
106 unsigned long minsz = offsetofend(struct vfio_region_info, offset);
107 struct vfio_region_info info;
108
109 switch (cmd) {
110 case VFIO_DEVICE_GET_REGION_INFO:
111 if (copy_from_user(&info, (void __user *)arg, minsz))
112 return -EFAULT;
113
114 if (info.argsz < minsz)
115 return -EINVAL;
116
117 if (info.index == nvdev->mem_prop.bar1_start_offset) {
118 /*
119 * Request to determine the BAR1 region information. Send the
120 * GPU memory information.
121 */
122 info.offset = VFIO_PCI_INDEX_TO_OFFSET(info.index);
123 info.size = nvdev->mem_prop.mem_length;
124 info.flags = VFIO_REGION_INFO_FLAG_READ |
125 VFIO_REGION_INFO_FLAG_WRITE |
126 VFIO_REGION_INFO_FLAG_MMAP;
127 return copy_to_user((void __user *)arg, &info, minsz) ?
128 -EFAULT : 0;
129 }
130
131 if (info.index == nvdev->mem_prop.bar1_start_offset + 1) {
132 /*
133 * The BAR1 region is 64b. Ignore this access.
134 */
135 info.offset = VFIO_PCI_INDEX_TO_OFFSET(info.index);
136 info.size = 0;
137 info.flags = 0;
138 return copy_to_user((void __user *)arg, &info, minsz) ?
139 -EFAULT : 0;
140 }
141
142 return vfio_pci_core_ioctl(core_vdev, cmd, arg);
143
144 default:
145 return vfio_pci_core_ioctl(core_vdev, cmd, arg);
146 }
147 }
148
--
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests
next prev parent reply other threads:[~2023-04-05 21:09 UTC|newest]
Thread overview: 31+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-04-05 18:01 [PATCH v3 0/6] Expose GPU memory as coherently CPU accessible ankita
2023-04-05 18:01 ` [PATCH v3 1/6] kvm: determine memory type from VMA ankita
2023-04-12 12:43 ` Marc Zyngier
2023-04-12 13:01 ` Jason Gunthorpe
2023-05-31 11:35 ` Catalin Marinas
2023-06-14 12:44 ` Jason Gunthorpe
2023-07-14 8:10 ` Benjamin Herrenschmidt
2023-07-16 15:09 ` Catalin Marinas
2023-07-16 22:30 ` Jason Gunthorpe
2023-07-17 18:35 ` Alex Williamson
2023-07-25 6:18 ` Benjamin Herrenschmidt
2023-04-05 18:01 ` [PATCH v3 2/6] vfio/nvgpu: expose GPU device memory as BAR1 ankita
2023-04-05 21:07 ` kernel test robot [this message]
2023-04-05 18:01 ` [PATCH v3 3/6] mm: handle poisoning of pfn without struct pages ankita
2023-04-05 21:07 ` kernel test robot
2023-05-09 9:51 ` HORIGUCHI NAOYA(堀口 直也)
2023-05-15 11:18 ` Ankit Agrawal
2023-05-23 5:43 ` HORIGUCHI NAOYA(堀口 直也)
2023-04-05 18:01 ` [PATCH v3 4/6] mm: Add poison error check in fixup_user_fault() for mapped PFN ankita
2023-04-05 18:01 ` [PATCH v3 5/6] mm: Change ghes code to allow poison of non-struct PFN ankita
2023-04-05 18:01 ` [PATCH v3 6/6] vfio/nvgpu: register device memory for poison handling ankita
2023-04-05 20:24 ` Zhi Wang
2023-04-05 21:50 ` kernel test robot
2023-05-24 9:53 ` Dan Carpenter
2023-04-06 12:07 ` [PATCH v3 0/6] Expose GPU memory as coherently CPU accessible David Hildenbrand
2023-04-12 8:43 ` Ankit Agrawal
2023-04-12 9:48 ` Marc Zyngier
2023-04-12 12:28 ` Marc Zyngier
2023-04-12 12:53 ` Jason Gunthorpe
2023-04-13 9:52 ` Marc Zyngier
2023-04-13 13:19 ` Jason Gunthorpe
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=202304060424.MtQM4udq-lkp@intel.com \
--to=lkp@intel.com \
--cc=acurrid@nvidia.com \
--cc=alex.williamson@redhat.com \
--cc=aniketa@nvidia.com \
--cc=ankita@nvidia.com \
--cc=apopple@nvidia.com \
--cc=cjia@nvidia.com \
--cc=danw@nvidia.com \
--cc=jgg@nvidia.com \
--cc=jhubbard@nvidia.com \
--cc=kvm@vger.kernel.org \
--cc=kwankhede@nvidia.com \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=maz@kernel.org \
--cc=naoya.horiguchi@nec.com \
--cc=oe-kbuild-all@lists.linux.dev \
--cc=oliver.upton@linux.dev \
--cc=targupta@nvidia.com \
--cc=vsethi@nvidia.com \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox