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'?

2019-04-04 Thread Deucher, Alexander
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/amdgpu/amdgpu_ttm.c:756:32: error: 'HMM_PFN_VALID' 
undeclared; did you mean '_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-next-5.2-wip
> head:   5666aea3ea494d4dd96df8f092cab32dbeeac321
> commit: 95db8d6001df8966e3370a66c9f358925fbcc890 [21/42] drm/amdgpu: replace 
> 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 ~/bin/make.cross
>  git checkout 95db8d6001df8966e3370a66c9f358925fbcc890
>  # save the attached .config to linux build tree
>  GCC_VERSION=7.2.0 make.cross ARCH=mips
>
> Note: the radeon-alex/drm-next-5.2-wip HEAD 
> 5666aea3ea494d4dd96df8f092cab32dbeeac321 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_get_user_pages':
> drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c:738:7: error: dereferencing 
> pointer to incomplete type 'struct hmm_range'
>   range->vma = 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] = 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 
> declaration of function 'hmm_vma_fault'; did you mean 'hmm_mm_init'? 
> [-Werror=implicit-function-declaration]
>   r = hmm_vma_fault(range, true);
>   ^
>   hmm_mm_init
> 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]
>pages[i] = hmm_pfn_to_page(range, range->pfns[i]);
>   ^~~
>   __pfn_to_page
> drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c: In function 
> '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=implicit-function-declaration]
>r = hmm_vma_range_done(>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_tuserptr;
> 711   struct task_struct  *usertask;
> 712   uint32_tuserflags;
>   > 713   struct hmm_rangerange;
> 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 only
> 721 

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'?

2019-04-03 Thread Kuehling, Felix
[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: replace 
> 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 ~/bin/make.cross
>  git checkout 95db8d6001df8966e3370a66c9f358925fbcc890
>  # save the attached .config to linux build tree
>  GCC_VERSION=7.2.0 make.cross ARCH=mips
>
> Note: the radeon-alex/drm-next-5.2-wip HEAD 
> 5666aea3ea494d4dd96df8f092cab32dbeeac321 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_get_user_pages':
> drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c:738:7: error: dereferencing 
> pointer to incomplete type 'struct hmm_range'
>   range->vma = 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] = 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 
> declaration of function 'hmm_vma_fault'; did you mean 'hmm_mm_init'? 
> [-Werror=implicit-function-declaration]
>   r = hmm_vma_fault(range, true);
>   ^
>   hmm_mm_init
> 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]
>pages[i] = hmm_pfn_to_page(range, range->pfns[i]);
>   ^~~
>   __pfn_to_page
> drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c: In function 
> '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=implicit-function-declaration]
>r = hmm_vma_range_done(>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_tuserptr;
> 711   struct task_struct  *usertask;
> 712   uint32_tuserflags;
>   > 713   struct hmm_rangerange;
> 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 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 = (void *)ttm;
> 726   struct mm_struct *mm = gtt->usertask->mm;
> 727   unsigned long end = gtt->userptr + ttm->num_pages * 
> PAGE_SIZE;
> 728   struct hmm_range *range = >range;
> 729   int r = 0, i;
> 730   
> 731   if (!mm) /* Happens during process shutdown */
> 732   return -ESRCH;
> 733   
> 734   amdgpu_hmm_init_range(range);
> 735   
> 736  

[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'?

2019-04-03 Thread kbuild test robot
tree:   git://people.freedesktop.org/~agd5f/linux.git drm-next-5.2-wip
head:   5666aea3ea494d4dd96df8f092cab32dbeeac321
commit: 95db8d6001df8966e3370a66c9f358925fbcc890 [21/42] drm/amdgpu: replace 
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 ~/bin/make.cross
git checkout 95db8d6001df8966e3370a66c9f358925fbcc890
# save the attached .config to linux build tree
GCC_VERSION=7.2.0 make.cross ARCH=mips 

Note: the radeon-alex/drm-next-5.2-wip HEAD 
5666aea3ea494d4dd96df8f092cab32dbeeac321 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_get_user_pages':
   drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c:738:7: error: dereferencing pointer 
to incomplete type 'struct hmm_range'
 range->vma = 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] = 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 declaration 
of function 'hmm_vma_fault'; did you mean 'hmm_mm_init'? 
[-Werror=implicit-function-declaration]
 r = hmm_vma_fault(range, true);
 ^
 hmm_mm_init
   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]
  pages[i] = hmm_pfn_to_page(range, range->pfns[i]);
 ^~~
 __pfn_to_page
   drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c: In function 
'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=implicit-function-declaration]
  r = hmm_vma_range_done(>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_tuserptr;
   711  struct task_struct  *usertask;
   712  uint32_tuserflags;
 > 713  struct hmm_rangerange;
   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 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 = (void *)ttm;
   726  struct mm_struct *mm = gtt->usertask->mm;
   727  unsigned long end = gtt->userptr + ttm->num_pages * PAGE_SIZE;
   728  struct hmm_range *range = >range;
   729  int r = 0, i;
   730  
   731  if (!mm) /* Happens during process shutdown */
   732  return -ESRCH;
   733  
   734  amdgpu_hmm_init_range(range);
   735  
   736  down_read(>mmap_sem);
   737  
   738  range->vma = find_vma(mm, gtt->userptr);
   739  if (!range_in_vma(range->vma, gtt->userptr, end))
   740  r = -EFAULT;
   741  else if ((gtt->userflags & AMDGPU_GEM_USERPTR_ANONONLY) &&
   742  range->vma->vm_file)
   743  r = -EPERM;
   744  if (r)
   745  goto out;
   746  
   747  range->pfns = kvmalloc_array(ttm->num_pages, sizeof(uint64_t),
   748   GFP_KERNEL);
   749  if (range->pfns == NULL) {
   750  r = -ENOMEM;
   751  goto out;
   752  }
   753  range->start = gtt->userptr;