From mboxrd@z Thu Jan 1 00:00:00 1970 From: "Deucher, Alexander" Subject: 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'? Date: Thu, 4 Apr 2019 12:52:22 +0000 Message-ID: References: <201904040226.27hBlEqH%lkp@intel.com>, Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="===============0447456681==" Return-path: Received: from NAM03-DM3-obe.outbound.protection.outlook.com (mail-eopbgr800084.outbound.protection.outlook.com [40.107.80.84]) by gabe.freedesktop.org (Postfix) with ESMTPS id 48CB36E59A for ; Thu, 4 Apr 2019 12:52:24 +0000 (UTC) In-Reply-To: Content-Language: en-US List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" To: "Kuehling, Felix" , "Yang, Philip" Cc: "Koenig, Christian" , "dri-devel@lists.freedesktop.org" List-Id: dri-devel@lists.freedesktop.org --===============0447456681== Content-Language: en-US Content-Type: multipart/alternative; boundary="_000_BN6PR12MB18099BAC0CB4151C1C93D6DCF7500BN6PR12MB1809namp_" --_000_BN6PR12MB18099BAC0CB4151C1C93D6DCF7500BN6PR12MB1809namp_ Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable The fixes are there; they are the subsequent commits, I guess I can squash = them in. Alex ________________________________ From: Kuehling, Felix Sent: Wednesday, April 3, 2019 6:20 PM To: Yang, Philip; Deucher, Alexander Cc: dri-devel@lists.freedesktop.org; Koenig, Christian Subject: Re: [radeon-alex:drm-next-5.2-wip 21/42] drivers/gpu/drm/amd/amdgp= u/amdgpu_ttm.c:756:32: error: 'HMM_PFN_VALID' undeclared; did you mean '_PA= GE_VALID'? [dropping the robot] I think Philip fixed those issues on amd-staging-drm-next. Either some fixes are missing on drm-next-5.2-wip, or they are there but should be squashed to avoid hitting these errors on intermediate builds. Regards, Felix On 2019-04-03 2:26 p.m., kbuild test robot wrote: > tree: git://people.freedesktop.org/~agd5f/linux.git drm-next-5.2-wip > head: 5666aea3ea494d4dd96df8f092cab32dbeeac321 > commit: 95db8d6001df8966e3370a66c9f358925fbcc890 [21/42] drm/amdgpu: repl= ace get_user_pages with HMM mirror helpers > config: mips-allyesconfig (attached as .config) > compiler: mips-linux-gnu-gcc (Debian 7.2.0-11) 7.2.0 > reproduce: > wget https://raw.githubusercontent.com/intel/lkp-tests/master/sb= in/make.cross -O ~/bin/make.cross > chmod +x ~/bin/make.cross > git checkout 95db8d6001df8966e3370a66c9f358925fbcc890 > # save the attached .config to linux build tree > GCC_VERSION=3D7.2.0 make.cross ARCH=3Dmips > > Note: the radeon-alex/drm-next-5.2-wip HEAD 5666aea3ea494d4dd96df8f092cab= 32dbeeac321 builds fine. > It only hurts bisectibility. > > All errors (new ones prefixed by >>): > > drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c:713:19: error: field 'range' = has incomplete type > struct hmm_range range; > ^~~~~ > drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c: In function 'amdgpu_ttm_tt_g= et_user_pages': > drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c:738:7: error: dereferencing p= ointer to incomplete type 'struct hmm_range' > range->vma =3D find_vma(mm, gtt->userptr); > ^~ >>> 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'? > range->pfns[0] =3D range->flags[HMM_PFN_VALID]; > ^~~~~~~~~~~~~ > _PAGE_VALID > drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c:756:32: note: each undeclared= identifier is reported only once for each function it appears in > 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'? > 0 : range->flags[HMM_PFN_WRITE]; > ^~~~~~~~~~~~~ > HMM_PFN_VALID > drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c:763:6: error: implicit declar= ation of function 'hmm_vma_fault'; did you mean 'hmm_mm_init'? [-Werror=3Di= mplicit-function-declaration] > r =3D hmm_vma_fault(range, true); > ^~~~~~~~~~~~~ > hmm_mm_init > drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c:770:14: error: implicit decla= ration of function 'hmm_pfn_to_page'; did you mean '__pfn_to_page'? [-Werro= r=3Dimplicit-function-declaration] > pages[i] =3D hmm_pfn_to_page(range, range->pfns[i]); > ^~~~~~~~~~~~~~~ > __pfn_to_page > drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c: In function 'amdgpu_ttm_tt_g= et_user_pages_done': > drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c:798:7: error: implicit declar= ation of function 'hmm_vma_range_done'; did you mean 'drm_vma_node_size'? [= -Werror=3Dimplicit-function-declaration] > r =3D hmm_vma_range_done(>t->range); > ^~~~~~~~~~~~~~~~~~ > drm_vma_node_size > cc1: some warnings being treated as errors > > vim +756 drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c > > 703 > 704 /* > 705 * TTM backend functions. > 706 */ > 707 struct amdgpu_ttm_tt { > 708 struct ttm_dma_tt ttm; > 709 u64 offset; > 710 uint64_t userptr; > 711 struct task_struct *usertask; > 712 uint32_t userflags; > > 713 struct hmm_range range; > 714 }; > 715 > 716 /** > 717 * amdgpu_ttm_tt_get_user_pages - get device accessible pag= es that back user > 718 * memory and start HMM tracking CPU page table update > 719 * > 720 * Calling function must call amdgpu_ttm_tt_userptr_range_d= one() once and only > 721 * once afterwards to stop HMM tracking > 722 */ > 723 int amdgpu_ttm_tt_get_user_pages(struct ttm_tt *ttm, struct= page **pages) > 724 { > 725 struct amdgpu_ttm_tt *gtt =3D (void *)ttm; > 726 struct mm_struct *mm =3D gtt->usertask->mm; > 727 unsigned long end =3D gtt->userptr + ttm->num_pages= * PAGE_SIZE; > 728 struct hmm_range *range =3D >t->range; > 729 int r =3D 0, i; > 730 > 731 if (!mm) /* Happens during process shutdown */ > 732 return -ESRCH; > 733 > 734 amdgpu_hmm_init_range(range); > 735 > 736 down_read(&mm->mmap_sem); > 737 > 738 range->vma =3D find_vma(mm, gtt->userptr); > 739 if (!range_in_vma(range->vma, gtt->userptr, end)) > 740 r =3D -EFAULT; > 741 else if ((gtt->userflags & AMDGPU_GEM_USERPTR_ANONO= NLY) && > 742 range->vma->vm_file) > 743 r =3D -EPERM; > 744 if (r) > 745 goto out; > 746 > 747 range->pfns =3D kvmalloc_array(ttm->num_pages, size= of(uint64_t), > 748 GFP_KERNEL); > 749 if (range->pfns =3D=3D NULL) { > 750 r =3D -ENOMEM; > 751 goto out; > 752 } > 753 range->start =3D gtt->userptr; > 754 range->end =3D end; > 755 > > 756 range->pfns[0] =3D range->flags[HMM_PFN_VALID]; > 757 range->pfns[0] |=3D amdgpu_ttm_tt_is_readonly(ttm) = ? > 758 0 : range->flags[HMM_PFN_WR= ITE]; > 759 for (i =3D 1; i < ttm->num_pages; i++) > 760 range->pfns[i] =3D range->pfns[0]; > 761 > 762 /* This may trigger page table update */ > 763 r =3D hmm_vma_fault(range, true); > 764 if (r) > 765 goto out_free_pfns; > 766 > 767 up_read(&mm->mmap_sem); > 768 > 769 for (i =3D 0; i < ttm->num_pages; i++) > 770 pages[i] =3D hmm_pfn_to_page(range, range->= pfns[i]); > 771 > 772 return 0; > 773 > 774 out_free_pfns: > 775 kvfree(range->pfns); > 776 range->pfns =3D NULL; > 777 out: > 778 up_read(&mm->mmap_sem); > 779 return r; > 780 } > 781 > > --- > 0-DAY kernel test infrastructure Open Source Technology Ce= nter > https://lists.01.org/pipermail/kbuild-all Intel Corpora= tion --_000_BN6PR12MB18099BAC0CB4151C1C93D6DCF7500BN6PR12MB1809namp_ Content-Type: text/html; charset="us-ascii" Content-Transfer-Encoding: quoted-printable
The fixes are there; they are the subsequent commits, I guess I can squash = them in.

Alex

From: Kuehling, Felix
Sent: Wednesday, April 3, 2019 6:20 PM
To: Yang, Philip; Deucher, Alexander
Cc: dri-devel@lists.freedesktop.org; Koenig, Christian
Subject: Re: [radeon-alex:drm-next-5.2-wip 21/42] drivers/gpu/drm/am= d/amdgpu/amdgpu_ttm.c:756:32: error: 'HMM_PFN_VALID' undeclared; did you me= an '_PAGE_VALID'?
 
[dropping the robot]

I think Philip fixed those issues on amd-staging-drm-next. Either some
fixes are missing on drm-next-5.2-wip, or they are there but should be
squashed to avoid hitting these errors on intermediate builds.

Regards,
   Felix

On 2019-04-03 2:26 p.m., kbuild test robot wrote:
> tree:   git://people.freedesktop.org/~agd5f/linux.git drm-ne= xt-5.2-wip
> head:   5666aea3ea494d4dd96df8f092cab32dbeeac321
> commit: 95db8d6001df8966e3370a66c9f358925fbcc890 [21/42] drm/amdgpu: r= eplace get_user_pages with HMM mirror helpers
> config: mips-allyesconfig (attached as .config)
> compiler: mips-linux-gnu-gcc (Debian 7.2.0-11) 7.2.0
> reproduce:
>          wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
>          chmod +x ~/b= in/make.cross
>          git checkout 95d= b8d6001df8966e3370a66c9f358925fbcc890
>          # save the attac= hed .config to linux build tree
>          GCC_VERSION=3D7.= 2.0 make.cross ARCH=3Dmips
>
> Note: the radeon-alex/drm-next-5.2-wip HEAD 5666aea3ea494d4dd96df8f092= cab32dbeeac321 builds fine.
>        It only hurts bisectibility.=
>
> All errors (new ones prefixed by >>):
>
>     drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c:713:19= : error: field 'range' has incomplete type
>       struct hmm_range range;
>            = ;            ^~~~~ >     drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c: In fu= nction 'amdgpu_ttm_tt_get_user_pages':
>     drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c:738:7:= error: dereferencing pointer to incomplete type 'struct hmm_range'
>       range->vma =3D find_vma(mm, gtt= ->userptr);
>            ^~ >>> drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c:756:32: error: 'HMM_PF= N_VALID' undeclared (first use in this function); did you mean '_PAGE_VALID= '?
>       range->pfns[0] =3D range->fl= ags[HMM_PFN_VALID];
>            = ;            &n= bsp;            ^~~~= ~~~~~~~~~
>            = ;            &n= bsp;            _PAG= E_VALID
>     drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c:756:32= : note: each undeclared identifier is reported only once for each function = it appears in
>     drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c:758:22= : error: 'HMM_PFN_WRITE' undeclared (first use in this function); did you m= ean 'HMM_PFN_VALID'?
>          0 : range->fl= ags[HMM_PFN_WRITE];
>            = ;            &n= bsp;  ^~~~~~~~~~~~~
>            = ;            &n= bsp;  HMM_PFN_VALID
>     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=3Dimplicit-function-declaration]
>       r =3D hmm_vma_fault(range, true);<= br> >           ^~~~~~~~~~= ~~~
>           hmm_mm_ini= t
>     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=3Dimplicit-function-declaration]
>        pages[i] =3D hmm_pfn_to_page= (range, range->pfns[i]);
>            = ;       ^~~~~~~~~~~~~~~
>            = ;       __pfn_to_page
>     drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c: In fu= nction 'amdgpu_ttm_tt_get_user_pages_done':
>     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=3Dimplicit-function-declaration]
>        r =3D hmm_vma_range_done(&am= p;gtt->range);
>            ^~~~= ~~~~~~~~~~~~~~
>            drm_= vma_node_size
>     cc1: some warnings being treated as errors
>
> vim +756 drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c
>
>     703      
>     704       /*
>     705        = * TTM backend functions.
>     706        = */
>     707       struct= amdgpu_ttm_tt {
>     708       &= nbsp;       struct ttm_dma_tt  &nbs= p;    ttm;
>     709       &= nbsp;       u64     =             &nb= sp;   offset;
>     710       &= nbsp;       uint64_t    &= nbsp;           userptr;<= br> >     711       &= nbsp;       struct task_struct  &nb= sp;   *usertask;
>     712       &= nbsp;       uint32_t    &= nbsp;           userflags= ;
>   > 713        &n= bsp;      struct hmm_range    =     range;
>     714       };
>     715      
>     716       /** >     717        = * amdgpu_ttm_tt_get_user_pages - get device accessible pages that back user=
>     718        = * memory and start HMM tracking CPU page table update
>     719        = *
>     720        = * Calling function must call amdgpu_ttm_tt_userptr_range_done() once and on= ly
>     721        = * once afterwards to stop HMM tracking
>     722        = */
>     723       int am= dgpu_ttm_tt_get_user_pages(struct ttm_tt *ttm, struct page **pages)
>     724       {
>     725       &= nbsp;       struct amdgpu_ttm_tt *gtt =3D (vo= id *)ttm;
>     726       &= nbsp;       struct mm_struct *mm =3D gtt->= usertask->mm;
>     727       &= nbsp;       unsigned long end =3D gtt->use= rptr + ttm->num_pages * PAGE_SIZE;
>     728       &= nbsp;       struct hmm_range *range =3D &= gtt->range;
>     729       &= nbsp;       int r =3D 0, i;
>     730      
>     731       &= nbsp;       if (!mm) /* Happens during proces= s shutdown */
>     732       &= nbsp;           &nbs= p;   return -ESRCH;
>     733      
>     734       &= nbsp;       amdgpu_hmm_init_range(range);
>     735      
>     736       &= nbsp;       down_read(&mm->mmap_sem);<= br> >     737      
>     738       &= nbsp;       range->vma =3D find_vma(mm, gt= t->userptr);
>     739       &= nbsp;       if (!range_in_vma(range->vma, = gtt->userptr, end))
>     740       &= nbsp;           &nbs= p;   r =3D -EFAULT;
>     741       &= nbsp;       else if ((gtt->userflags &= AMDGPU_GEM_USERPTR_ANONONLY) &&
>     742       &= nbsp;           &nbs= p;   range->vma->vm_file)
>     743       &= nbsp;           &nbs= p;   r =3D -EPERM;
>     744       &= nbsp;       if (r)
>     745       &= nbsp;           &nbs= p;   goto out;
>     746      
>     747       &= nbsp;       range->pfns =3D kvmalloc_array= (ttm->num_pages, sizeof(uint64_t),
>     748       &= nbsp;           &nbs= p;            &= nbsp;           GFP_KERNE= L);
>     749       &= nbsp;       if (range->pfns =3D=3D NULL) {=
>     750       &= nbsp;           &nbs= p;   r =3D -ENOMEM;
>     751       &= nbsp;           &nbs= p;   goto out;
>     752       &= nbsp;       }
>     753       &= nbsp;       range->start =3D gtt->userp= tr;
>     754       &= nbsp;       range->end =3D end;
>     755      
>   > 756        &n= bsp;      range->pfns[0] =3D range->flags[HM= M_PFN_VALID];
>     757       &= nbsp;       range->pfns[0] |=3D amdgpu_ttm= _tt_is_readonly(ttm) ?
>     758       &= nbsp;           &nbs= p;            &= nbsp;      0 : range->flags[HMM_PFN_WRITE];
>     759       &= nbsp;       for (i =3D 1; i < ttm->num_= pages; i++)
>     760       &= nbsp;           &nbs= p;   range->pfns[i] =3D range->pfns[0];
>     761      
>     762       &= nbsp;       /* This may trigger page table up= date */
>     763       &= nbsp;       r =3D hmm_vma_fault(range, true);=
>     764       &= nbsp;       if (r)
>     765       &= nbsp;           &nbs= p;   goto out_free_pfns;
>     766      
>     767       &= nbsp;       up_read(&mm->mmap_sem); >     768      
>     769       &= nbsp;       for (i =3D 0; i < ttm->num_= pages; i++)
>     770       &= nbsp;           &nbs= p;   pages[i] =3D hmm_pfn_to_page(range, range->pfns[i]);
>     771      
>     772       &= nbsp;       return 0;
>     773      
>     774       out_fr= ee_pfns:
>     775       &= nbsp;       kvfree(range->pfns);
>     776       &= nbsp;       range->pfns =3D NULL;
>     777       out: >     778       &= nbsp;       up_read(&mm->mmap_sem); >     779       &= nbsp;       return r;
>     780       }
>     781      
>
> ---
> 0-DAY kernel test infrastructure      &n= bsp;         Open Source Technology= Center
>
https://lists.01= .org/pipermail/kbuild-all       &nbs= p;           Intel Corpor= ation
--_000_BN6PR12MB18099BAC0CB4151C1C93D6DCF7500BN6PR12MB1809namp_-- --===============0447456681== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: base64 Content-Disposition: inline X19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX18KZHJpLWRldmVs IG1haWxpbmcgbGlzdApkcmktZGV2ZWxAbGlzdHMuZnJlZWRlc2t0b3Aub3JnCmh0dHBzOi8vbGlz dHMuZnJlZWRlc2t0b3Aub3JnL21haWxtYW4vbGlzdGluZm8vZHJpLWRldmVs --===============0447456681==--