tree:
https://github.com/0day-ci/linux/commits/UPDATE-20200821-181056/Chris-Wil...
head: 38b0cab83068fdb9ea08a83d0aa478dea9dc0198
commit: 428d9f1a613ed8a93d2b6476ec1aeb95fe90dedc [2/4] drm/i915/gem: Sync the vmap PTEs
upon construction
config: i386-randconfig-a012-20200820 (attached as .config)
compiler: gcc-9 (Debian 9.3.0-15) 9.3.0
reproduce (this is a W=1 build):
git checkout 428d9f1a613ed8a93d2b6476ec1aeb95fe90dedc
# save the attached .config to linux build tree
make W=1 ARCH=i386
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp(a)intel.com>
All errors (new ones prefixed by >>):
drivers/gpu/drm/i915/gem/i915_gem_pages.c: In function 'i915_gem_object_map':
> drivers/gpu/drm/i915/gem/i915_gem_pages.c:307:2: error: implicit
declaration of function 'flush_vm_area'; did you mean 'free_vm_area'?
[-Werror=implicit-function-declaration]
307 | flush_vm_area(area);
| ^~~~~~~~~~~~~
| free_vm_area
cc1: some warnings being treated as errors
#
https://github.com/0day-ci/linux/commit/428d9f1a613ed8a93d2b6476ec1aeb95f...
git remote add linux-review
https://github.com/0day-ci/linux
git fetch --no-tags linux-review
UPDATE-20200821-181056/Chris-Wilson/mm-Export-flush_vm_area-to-sync-the-PTEs-upon-construction/20200821-165232
git checkout 428d9f1a613ed8a93d2b6476ec1aeb95fe90dedc
vim +307 drivers/gpu/drm/i915/gem/i915_gem_pages.c
243
244 /* The 'mapping' part of i915_gem_object_pin_map() below */
245 static void *i915_gem_object_map(struct drm_i915_gem_object *obj,
246 enum i915_map_type type)
247 {
248 unsigned long n_pte = obj->base.size >> PAGE_SHIFT;
249 struct sg_table *sgt = obj->mm.pages;
250 pte_t *stack[32], **mem;
251 struct vm_struct *area;
252 pgprot_t pgprot;
253
254 if (!i915_gem_object_has_struct_page(obj) && type != I915_MAP_WC)
255 return NULL;
256
257 /* A single page can always be kmapped */
258 if (n_pte == 1 && type == I915_MAP_WB)
259 return kmap(sg_page(sgt->sgl));
260
261 mem = stack;
262 if (n_pte > ARRAY_SIZE(stack)) {
263 /* Too big for stack -- allocate temporary array instead */
264 mem = kvmalloc_array(n_pte, sizeof(*mem), GFP_KERNEL);
265 if (!mem)
266 return NULL;
267 }
268
269 area = alloc_vm_area(obj->base.size, mem);
270 if (!area) {
271 if (mem != stack)
272 kvfree(mem);
273 return NULL;
274 }
275
276 switch (type) {
277 default:
278 MISSING_CASE(type);
279 /* fallthrough - to use PAGE_KERNEL anyway */
280 case I915_MAP_WB:
281 pgprot = PAGE_KERNEL;
282 break;
283 case I915_MAP_WC:
284 pgprot = pgprot_writecombine(PAGE_KERNEL_IO);
285 break;
286 }
287
288 if (i915_gem_object_has_struct_page(obj)) {
289 struct sgt_iter iter;
290 struct page *page;
291 pte_t **ptes = mem;
292
293 for_each_sgt_page(page, iter, sgt)
294 **ptes++ = mk_pte(page, pgprot);
295 } else {
296 resource_size_t iomap;
297 struct sgt_iter iter;
298 pte_t **ptes = mem;
299 dma_addr_t addr;
300
301 iomap = obj->mm.region->iomap.base;
302 iomap -= obj->mm.region->region.start;
303
304 for_each_sgt_daddr(addr, iter, sgt)
305 **ptes++ = iomap_pte(iomap, addr, pgprot);
306 }
307 flush_vm_area(area);
308
309 if (mem != stack)
310 kvfree(mem);
311
312 return area->addr;
313 }
314
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org