<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=us-ascii">
<style type="text/css" style="display:none;"> P {margin-top:0;margin-bottom:0;} </style>
</head>
<body dir="ltr">
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
The fixes are there; they are the subsequent commits, I guess I can squash them in.</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
<br>
</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
Alex<br>
</div>
<div id="appendonsend"></div>
<hr style="display:inline-block;width:98%" tabindex="-1">
<div id="divRplyFwdMsg" dir="ltr"><font face="Calibri, sans-serif" style="font-size:11pt" color="#000000"><b>From:</b> Kuehling, Felix<br>
<b>Sent:</b> Wednesday, April 3, 2019 6:20 PM<br>
<b>To:</b> Yang, Philip; Deucher, Alexander<br>
<b>Cc:</b> dri-devel@lists.freedesktop.org; Koenig, Christian<br>
<b>Subject:</b> Re: [radeon-alex:drm-next-5.2-wip 21/42] drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c:756:32: error: 'HMM_PFN_VALID' undeclared; did you mean '_PAGE_VALID'?</font>
<div> </div>
</div>
<div class="BodyFragment"><font size="2"><span style="font-size:11pt;">
<div class="PlainText">[dropping the robot]<br>
<br>
I think Philip fixed those issues on amd-staging-drm-next. Either some <br>
fixes are missing on drm-next-5.2-wip, or they are there but should be <br>
squashed to avoid hitting these errors on intermediate builds.<br>
<br>
Regards,<br>
   Felix<br>
<br>
On 2019-04-03 2:26 p.m., kbuild test robot wrote:<br>
> tree:   git://people.freedesktop.org/~agd5f/linux.git drm-next-5.2-wip<br>
> head:   5666aea3ea494d4dd96df8f092cab32dbeeac321<br>
> commit: 95db8d6001df8966e3370a66c9f358925fbcc890 [21/42] drm/amdgpu: replace get_user_pages with HMM mirror helpers<br>
> config: mips-allyesconfig (attached as .config)<br>
> compiler: mips-linux-gnu-gcc (Debian 7.2.0-11) 7.2.0<br>
> reproduce:<br>
>          wget <a href="https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross">
https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross</a> -O ~/bin/make.cross<br>
>          chmod +x ~/bin/make.cross<br>
>          git checkout 95db8d6001df8966e3370a66c9f358925fbcc890<br>
>          # save the attached .config to linux build tree<br>
>          GCC_VERSION=7.2.0 make.cross ARCH=mips<br>
><br>
> Note: the radeon-alex/drm-next-5.2-wip HEAD 5666aea3ea494d4dd96df8f092cab32dbeeac321 builds fine.<br>
>        It only hurts bisectibility.<br>
><br>
> All errors (new ones prefixed by >>):<br>
><br>
>     drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c:713:19: error: field 'range' has incomplete type<br>
>       struct hmm_range range;<br>
>                        ^~~~~<br>
>     drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c: In function 'amdgpu_ttm_tt_get_user_pages':<br>
>     drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c:738:7: error: dereferencing pointer to incomplete type 'struct hmm_range'<br>
>       range->vma = find_vma(mm, gtt->userptr);<br>
>            ^~<br>
>>> drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c:756:32: error: 'HMM_PFN_VALID' undeclared (first use in this function); did you mean '_PAGE_VALID'?<br>
>       range->pfns[0] = range->flags[HMM_PFN_VALID];<br>
>                                     ^~~~~~~~~~~~~<br>
>                                     _PAGE_VALID<br>
>     drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c:756:32: note: each undeclared identifier is reported only once for each function it appears in<br>
>     drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c:758:22: error: 'HMM_PFN_WRITE' undeclared (first use in this function); did you mean 'HMM_PFN_VALID'?<br>
>          0 : range->flags[HMM_PFN_WRITE];<br>
>                           ^~~~~~~~~~~~~<br>
>                           HMM_PFN_VALID<br>
>     drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c:763:6: error: implicit declaration of function 'hmm_vma_fault'; did you mean 'hmm_mm_init'? [-Werror=implicit-function-declaration]<br>
>       r = hmm_vma_fault(range, true);<br>
>           ^~~~~~~~~~~~~<br>
>           hmm_mm_init<br>
>     drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c:770:14: error: implicit declaration of function 'hmm_pfn_to_page'; did you mean '__pfn_to_page'? [-Werror=implicit-function-declaration]<br>
>        pages[i] = hmm_pfn_to_page(range, range->pfns[i]);<br>
>                   ^~~~~~~~~~~~~~~<br>
>                   __pfn_to_page<br>
>     drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c: In function 'amdgpu_ttm_tt_get_user_pages_done':<br>
>     drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c:798:7: error: implicit declaration of function 'hmm_vma_range_done'; did you mean 'drm_vma_node_size'? [-Werror=implicit-function-declaration]<br>
>        r = hmm_vma_range_done(&gtt->range);<br>
>            ^~~~~~~~~~~~~~~~~~<br>
>            drm_vma_node_size<br>
>     cc1: some warnings being treated as errors<br>
><br>
> vim +756 drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c<br>
><br>
>     703       <br>
>     704       /*<br>
>     705        * TTM backend functions.<br>
>     706        */<br>
>     707       struct amdgpu_ttm_tt {<br>
>     708               struct ttm_dma_tt       ttm;<br>
>     709               u64                     offset;<br>
>     710               uint64_t                userptr;<br>
>     711               struct task_struct      *usertask;<br>
>     712               uint32_t                userflags;<br>
>   > 713               struct hmm_range        range;<br>
>     714       };<br>
>     715       <br>
>     716       /**<br>
>     717        * amdgpu_ttm_tt_get_user_pages - get device accessible pages that back user<br>
>     718        * memory and start HMM tracking CPU page table update<br>
>     719        *<br>
>     720        * Calling function must call amdgpu_ttm_tt_userptr_range_done() once and only<br>
>     721        * once afterwards to stop HMM tracking<br>
>     722        */<br>
>     723       int amdgpu_ttm_tt_get_user_pages(struct ttm_tt *ttm, struct page **pages)<br>
>     724       {<br>
>     725               struct amdgpu_ttm_tt *gtt = (void *)ttm;<br>
>     726               struct mm_struct *mm = gtt->usertask->mm;<br>
>     727               unsigned long end = gtt->userptr + ttm->num_pages * PAGE_SIZE;<br>
>     728               struct hmm_range *range = &gtt->range;<br>
>     729               int r = 0, i;<br>
>     730       <br>
>     731               if (!mm) /* Happens during process shutdown */<br>
>     732                       return -ESRCH;<br>
>     733       <br>
>     734               amdgpu_hmm_init_range(range);<br>
>     735       <br>
>     736               down_read(&mm->mmap_sem);<br>
>     737       <br>
>     738               range->vma = find_vma(mm, gtt->userptr);<br>
>     739               if (!range_in_vma(range->vma, gtt->userptr, end))<br>
>     740                       r = -EFAULT;<br>
>     741               else if ((gtt->userflags & AMDGPU_GEM_USERPTR_ANONONLY) &&<br>
>     742                       range->vma->vm_file)<br>
>     743                       r = -EPERM;<br>
>     744               if (r)<br>
>     745                       goto out;<br>
>     746       <br>
>     747               range->pfns = kvmalloc_array(ttm->num_pages, sizeof(uint64_t),<br>
>     748                                            GFP_KERNEL);<br>
>     749               if (range->pfns == NULL) {<br>
>     750                       r = -ENOMEM;<br>
>     751                       goto out;<br>
>     752               }<br>
>     753               range->start = gtt->userptr;<br>
>     754               range->end = end;<br>
>     755       <br>
>   > 756               range->pfns[0] = range->flags[HMM_PFN_VALID];<br>
>     757               range->pfns[0] |= amdgpu_ttm_tt_is_readonly(ttm) ?<br>
>     758                                       0 : range->flags[HMM_PFN_WRITE];<br>
>     759               for (i = 1; i < ttm->num_pages; i++)<br>
>     760                       range->pfns[i] = range->pfns[0];<br>
>     761       <br>
>     762               /* This may trigger page table update */<br>
>     763               r = hmm_vma_fault(range, true);<br>
>     764               if (r)<br>
>     765                       goto out_free_pfns;<br>
>     766       <br>
>     767               up_read(&mm->mmap_sem);<br>
>     768       <br>
>     769               for (i = 0; i < ttm->num_pages; i++)<br>
>     770                       pages[i] = hmm_pfn_to_page(range, range->pfns[i]);<br>
>     771       <br>
>     772               return 0;<br>
>     773       <br>
>     774       out_free_pfns:<br>
>     775               kvfree(range->pfns);<br>
>     776               range->pfns = NULL;<br>
>     777       out:<br>
>     778               up_read(&mm->mmap_sem);<br>
>     779               return r;<br>
>     780       }<br>
>     781       <br>
><br>
> ---<br>
> 0-DAY kernel test infrastructure                Open Source Technology Center<br>
> <a href="https://lists.01.org/pipermail/kbuild-all">https://lists.01.org/pipermail/kbuild-all</a>                   Intel Corporation<br>
</div>
</span></font></div>
</body>
</html>