Re: [drm-drm-misc:for-linux-next 2/2] drivers/dma-buf/dma-buf.c:1186: undefined reference to `vma_set_file'

2020-11-05 Thread Christian König

Am 05.11.20 um 17:05 schrieb Christian König:

Am 05.11.20 um 17:04 schrieb Daniel Vetter:

On Thu, Nov 05, 2020 at 05:02:09PM +0100, Daniel Vetter wrote:

On Thu, Nov 05, 2020 at 04:41:00PM +0100, Christian König wrote:
Guys, can anybody help me out. Why is the kernel test robot 
complaining

here?

Thanks in advance,
Christian.

Am 05.11.20 um 16:26 schrieb kernel test robot:

tree: git://anongit.freedesktop.org/drm/drm-misc for-linux-next
head:   2b5b95b1ff3d70a95013a45e3b5b90f1daf42348
commit: 2b5b95b1ff3d70a95013a45e3b5b90f1daf42348 [2/2] mm: 
introduce vma_set_file function v4

config: h8300-randconfig-r031-20201105 (attached as .config)
compiler: h8300-linux-gcc (GCC) 9.3.0

nommu platform?

If you have a hard time finding a cross compiler for this, there's some
nommu arm platforms. I used that for compile teesting nommu support
recently.

If it's not that, then it's something specific with that config for 
sure.

Also looking a the tree, there's no ack from Andrew Morton. For merging
stuff that's not maintained in drm-misc (and definitely for stuff 
outside

of drm maintained tree) we need an ack from the right maintainer.


Ok, going to revert from drm-misc-next then.


Any objections that I use an Acked-by: Daniel Vetter 
 and the original Link tags for the revert?


Christian.



Thanks,
Christian.



I'd say make sure he's ok before we dig an even deeper hole here.
-Daniel


-Daniel


reproduce (this is a W=1 build):
  wget 
https://nam11.safelinks.protection.outlook.com/?url=https%3A%2F%2Fraw.githubusercontent.com%2Fintel%2Flkp-tests%2Fmaster%2Fsbin%2Fmake.crossdata=04%7C01%7Cchristian.koenig%40amd.com%7C4e238bfcb3c74ec4509b08d881a476b1%7C3dd8961fe4884e608e11a82d994e183d%7C0%7C0%7C637401890651814795%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000sdata=SwbnYEHBsw44Iy1yJdEqUp1BnLY%2BkMFKOuFcVrccisg%3Dreserved=0 
-O ~/bin/make.cross

  chmod +x ~/bin/make.cross
  git remote add drm-drm-misc 
git://anongit.freedesktop.org/drm/drm-misc

  git fetch --no-tags drm-drm-misc for-linux-next
  git checkout 2b5b95b1ff3d70a95013a45e3b5b90f1daf42348
  # save the attached .config to linux build tree
  COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-9.3.0 
make.cross ARCH=h8300


If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot 

All errors (new ones prefixed by >>):

 h8300-linux-ld: section .init.text LMA 
[004da400,0051ebcb] overlaps section .text LMA 
[025c,01069997]
 h8300-linux-ld: section .data VMA 
[0040,004da3ff] overlaps section .text VMA 
[025c,01069997]
 h8300-linux-ld: drivers/dma-buf/dma-buf.o: in function 
`dma_buf_mmap':
drivers/dma-buf/dma-buf.c:1186: undefined reference to 
`vma_set_file'

vim +1186 drivers/dma-buf/dma-buf.c

    1150
    1151
    1152    /**
    1153 * dma_buf_mmap - Setup up a userspace mmap with the 
given vma

    1154 * @dmabuf:    [in]    buffer that should back the vma
    1155 * @vma:    [in]    vma for the mmap
    1156 * @pgoff:    [in]    offset in pages where this mmap 
should start within the

    1157 *    dma-buf buffer.
    1158 *
    1159 * This function adjusts the passed in vma so that it 
points at the file of the
    1160 * dma_buf operation. It also adjusts the starting 
pgoff and does bounds
    1161 * checking on the size of the vma. Then it calls the 
exporters mmap function to

    1162 * set up the mapping.
    1163 *
    1164 * Can return negative error values, returns 0 on 
success.

    1165 */
    1166    int dma_buf_mmap(struct dma_buf *dmabuf, struct 
vm_area_struct *vma,

    1167 unsigned long pgoff)
    1168    {
    1169    if (WARN_ON(!dmabuf || !vma))
    1170    return -EINVAL;
    1171
    1172    /* check if buffer supports mmap */
    1173    if (!dmabuf->ops->mmap)
    1174    return -EINVAL;
    1175
    1176    /* check for offset overflow */
    1177    if (pgoff + vma_pages(vma) < pgoff)
    1178    return -EOVERFLOW;
    1179
    1180    /* check for overflowing the buffer's size */
    1181    if (pgoff + vma_pages(vma) >
    1182    dmabuf->size >> PAGE_SHIFT)
    1183    return -EINVAL;
    1184
    1185    /* readjust the vma */

1186    vma_set_file(vma, dmabuf->file);

    1187    vma->vm_pgoff = pgoff;
    1188
    1189    return dmabuf->ops->mmap(dmabuf, vma);
    1190    }
    1191    EXPORT_SYMBOL_GPL(dma_buf_mmap);
    1192

---
0-DAY CI Kernel Test Service, Intel Corporation

Re: [drm-drm-misc:for-linux-next 2/2] drivers/dma-buf/dma-buf.c:1186: undefined reference to `vma_set_file'

2020-11-05 Thread Christian König

Am 05.11.20 um 17:04 schrieb Daniel Vetter:

On Thu, Nov 05, 2020 at 05:02:09PM +0100, Daniel Vetter wrote:

On Thu, Nov 05, 2020 at 04:41:00PM +0100, Christian König wrote:

Guys, can anybody help me out. Why is the kernel test robot complaining
here?

Thanks in advance,
Christian.

Am 05.11.20 um 16:26 schrieb kernel test robot:

tree:   git://anongit.freedesktop.org/drm/drm-misc for-linux-next
head:   2b5b95b1ff3d70a95013a45e3b5b90f1daf42348
commit: 2b5b95b1ff3d70a95013a45e3b5b90f1daf42348 [2/2] mm: introduce 
vma_set_file function v4
config: h8300-randconfig-r031-20201105 (attached as .config)
compiler: h8300-linux-gcc (GCC) 9.3.0

nommu platform?

If you have a hard time finding a cross compiler for this, there's some
nommu arm platforms. I used that for compile teesting nommu support
recently.

If it's not that, then it's something specific with that config for sure.

Also looking a the tree, there's no ack from Andrew Morton. For merging
stuff that's not maintained in drm-misc (and definitely for stuff outside
of drm maintained tree) we need an ack from the right maintainer.


Ok, going to revert from drm-misc-next then.

Thanks,
Christian.



I'd say make sure he's ok before we dig an even deeper hole here.
-Daniel


-Daniel


reproduce (this is a W=1 build):
  wget 
https://nam11.safelinks.protection.outlook.com/?url=https%3A%2F%2Fraw.githubusercontent.com%2Fintel%2Flkp-tests%2Fmaster%2Fsbin%2Fmake.crossdata=04%7C01%7Cchristian.koenig%40amd.com%7C4e238bfcb3c74ec4509b08d881a476b1%7C3dd8961fe4884e608e11a82d994e183d%7C0%7C0%7C637401890651814795%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000sdata=SwbnYEHBsw44Iy1yJdEqUp1BnLY%2BkMFKOuFcVrccisg%3Dreserved=0
 -O ~/bin/make.cross
  chmod +x ~/bin/make.cross
  git remote add drm-drm-misc git://anongit.freedesktop.org/drm/drm-misc
  git fetch --no-tags drm-drm-misc for-linux-next
  git checkout 2b5b95b1ff3d70a95013a45e3b5b90f1daf42348
  # save the attached .config to linux build tree
  COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-9.3.0 make.cross 
ARCH=h8300

If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot 

All errors (new ones prefixed by >>):

 h8300-linux-ld: section .init.text LMA [004da400,0051ebcb] 
overlaps section .text LMA [025c,01069997]
 h8300-linux-ld: section .data VMA [0040,004da3ff] 
overlaps section .text VMA [025c,01069997]
 h8300-linux-ld: drivers/dma-buf/dma-buf.o: in function `dma_buf_mmap':

drivers/dma-buf/dma-buf.c:1186: undefined reference to `vma_set_file'

vim +1186 drivers/dma-buf/dma-buf.c

1150
1151
1152/**
1153 * dma_buf_mmap - Setup up a userspace mmap with the given vma
1154 * @dmabuf: [in]buffer that should back the vma
1155 * @vma:[in]vma for the mmap
1156 * @pgoff:  [in]offset in pages where this mmap should 
start within the
1157 *  dma-buf buffer.
1158 *
1159 * This function adjusts the passed in vma so that it points at 
the file of the
1160 * dma_buf operation. It also adjusts the starting pgoff and 
does bounds
1161 * checking on the size of the vma. Then it calls the exporters 
mmap function to
1162 * set up the mapping.
1163 *
1164 * Can return negative error values, returns 0 on success.
1165 */
1166int dma_buf_mmap(struct dma_buf *dmabuf, struct vm_area_struct 
*vma,
1167 unsigned long pgoff)
1168{
1169if (WARN_ON(!dmabuf || !vma))
1170return -EINVAL;
1171
1172/* check if buffer supports mmap */
1173if (!dmabuf->ops->mmap)
1174return -EINVAL;
1175
1176/* check for offset overflow */
1177if (pgoff + vma_pages(vma) < pgoff)
1178return -EOVERFLOW;
1179
1180/* check for overflowing the buffer's size */
1181if (pgoff + vma_pages(vma) >
1182dmabuf->size >> PAGE_SHIFT)
1183return -EINVAL;
1184
1185/* readjust the vma */

1186vma_set_file(vma, dmabuf->file);

1187vma->vm_pgoff = pgoff;
1188
1189return dmabuf->ops->mmap(dmabuf, vma);
1190}
1191EXPORT_SYMBOL_GPL(dma_buf_mmap);
1192

---
0-DAY CI Kernel Test Service, Intel Corporation

Re: [drm-drm-misc:for-linux-next 2/2] drivers/dma-buf/dma-buf.c:1186: undefined reference to `vma_set_file'

2020-11-05 Thread Daniel Vetter
On Thu, Nov 05, 2020 at 05:02:09PM +0100, Daniel Vetter wrote:
> On Thu, Nov 05, 2020 at 04:41:00PM +0100, Christian König wrote:
> > Guys, can anybody help me out. Why is the kernel test robot complaining
> > here?
> > 
> > Thanks in advance,
> > Christian.
> > 
> > Am 05.11.20 um 16:26 schrieb kernel test robot:
> > > tree:   git://anongit.freedesktop.org/drm/drm-misc for-linux-next
> > > head:   2b5b95b1ff3d70a95013a45e3b5b90f1daf42348
> > > commit: 2b5b95b1ff3d70a95013a45e3b5b90f1daf42348 [2/2] mm: introduce 
> > > vma_set_file function v4
> > > config: h8300-randconfig-r031-20201105 (attached as .config)
> > > compiler: h8300-linux-gcc (GCC) 9.3.0
> 
> nommu platform?
> 
> If you have a hard time finding a cross compiler for this, there's some
> nommu arm platforms. I used that for compile teesting nommu support
> recently.
> 
> If it's not that, then it's something specific with that config for sure.

Also looking a the tree, there's no ack from Andrew Morton. For merging
stuff that's not maintained in drm-misc (and definitely for stuff outside
of drm maintained tree) we need an ack from the right maintainer.

I'd say make sure he's ok before we dig an even deeper hole here.
-Daniel

> -Daniel
> 
> > > reproduce (this is a W=1 build):
> > >  wget 
> > > https://nam11.safelinks.protection.outlook.com/?url=https%3A%2F%2Fraw.githubusercontent.com%2Fintel%2Flkp-tests%2Fmaster%2Fsbin%2Fmake.crossdata=04%7C01%7Cchristian.koenig%40amd.com%7C2c3b39afc651426aa50608d8819f48fc%7C3dd8961fe4884e608e11a82d994e183d%7C0%7C0%7C637401871204724096%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000sdata=dK2txO1WerkR7SiB5i9kcXjbJTMlaQ1Q6dbK1cb9lnE%3Dreserved=0
> > >  -O ~/bin/make.cross
> > >  chmod +x ~/bin/make.cross
> > >  git remote add drm-drm-misc 
> > > git://anongit.freedesktop.org/drm/drm-misc
> > >  git fetch --no-tags drm-drm-misc for-linux-next
> > >  git checkout 2b5b95b1ff3d70a95013a45e3b5b90f1daf42348
> > >  # save the attached .config to linux build tree
> > >  COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-9.3.0 make.cross 
> > > ARCH=h8300
> > > 
> > > If you fix the issue, kindly add following tag as appropriate
> > > Reported-by: kernel test robot 
> > > 
> > > All errors (new ones prefixed by >>):
> > > 
> > > h8300-linux-ld: section .init.text LMA 
> > > [004da400,0051ebcb] overlaps section .text LMA 
> > > [025c,01069997]
> > > h8300-linux-ld: section .data VMA [0040,004da3ff] 
> > > overlaps section .text VMA [025c,01069997]
> > > h8300-linux-ld: drivers/dma-buf/dma-buf.o: in function `dma_buf_mmap':
> > > > > drivers/dma-buf/dma-buf.c:1186: undefined reference to `vma_set_file'
> > > vim +1186 drivers/dma-buf/dma-buf.c
> > > 
> > >1150   
> > >1151   
> > >1152   /**
> > >1153* dma_buf_mmap - Setup up a userspace mmap with the given vma
> > >1154* @dmabuf: [in]buffer that should back the vma
> > >1155* @vma:[in]vma for the mmap
> > >1156* @pgoff:  [in]offset in pages where this mmap should 
> > > start within the
> > >1157*  dma-buf buffer.
> > >1158*
> > >1159* This function adjusts the passed in vma so that it points at 
> > > the file of the
> > >1160* dma_buf operation. It also adjusts the starting pgoff and 
> > > does bounds
> > >1161* checking on the size of the vma. Then it calls the exporters 
> > > mmap function to
> > >1162* set up the mapping.
> > >1163*
> > >1164* Can return negative error values, returns 0 on success.
> > >1165*/
> > >1166   int dma_buf_mmap(struct dma_buf *dmabuf, struct vm_area_struct 
> > > *vma,
> > >1167unsigned long pgoff)
> > >1168   {
> > >1169   if (WARN_ON(!dmabuf || !vma))
> > >1170   return -EINVAL;
> > >1171   
> > >1172   /* check if buffer supports mmap */
> > >1173   if (!dmabuf->ops->mmap)
> > >1174   return -EINVAL;
> > >1175   
> > >1176   /* check for offset overflow */
> > >1177   if (pgoff + vma_pages(vma) < pgoff)
> > >1178   return -EOVERFLOW;
> > >1179   
> > >1180   /* check for overflowing the buffer's size */
> > >1181   if (pgoff + vma_pages(vma) >
> > >1182   dmabuf->size >> PAGE_SHIFT)
> > >1183   return -EINVAL;
> > >1184   
> > >1185   /* readjust the vma */
> > > > 1186vma_set_file(vma, dmabuf->file);
> > >1187   vma->vm_pgoff = pgoff;
> > >1188   
> > >1189   return dmabuf->ops->mmap(dmabuf, vma);
> > >1190   }
> > >1191   EXPORT_SYMBOL_GPL(dma_buf_mmap);
> > >1192   
> > > 
> > > ---
> > > 0-DAY 

Re: [drm-drm-misc:for-linux-next 2/2] drivers/dma-buf/dma-buf.c:1186: undefined reference to `vma_set_file'

2020-11-05 Thread Daniel Vetter
On Thu, Nov 05, 2020 at 04:41:00PM +0100, Christian König wrote:
> Guys, can anybody help me out. Why is the kernel test robot complaining
> here?
> 
> Thanks in advance,
> Christian.
> 
> Am 05.11.20 um 16:26 schrieb kernel test robot:
> > tree:   git://anongit.freedesktop.org/drm/drm-misc for-linux-next
> > head:   2b5b95b1ff3d70a95013a45e3b5b90f1daf42348
> > commit: 2b5b95b1ff3d70a95013a45e3b5b90f1daf42348 [2/2] mm: introduce 
> > vma_set_file function v4
> > config: h8300-randconfig-r031-20201105 (attached as .config)
> > compiler: h8300-linux-gcc (GCC) 9.3.0

nommu platform?

If you have a hard time finding a cross compiler for this, there's some
nommu arm platforms. I used that for compile teesting nommu support
recently.

If it's not that, then it's something specific with that config for sure.
-Daniel

> > reproduce (this is a W=1 build):
> >  wget 
> > https://nam11.safelinks.protection.outlook.com/?url=https%3A%2F%2Fraw.githubusercontent.com%2Fintel%2Flkp-tests%2Fmaster%2Fsbin%2Fmake.crossdata=04%7C01%7Cchristian.koenig%40amd.com%7C2c3b39afc651426aa50608d8819f48fc%7C3dd8961fe4884e608e11a82d994e183d%7C0%7C0%7C637401871204724096%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000sdata=dK2txO1WerkR7SiB5i9kcXjbJTMlaQ1Q6dbK1cb9lnE%3Dreserved=0
> >  -O ~/bin/make.cross
> >  chmod +x ~/bin/make.cross
> >  git remote add drm-drm-misc 
> > git://anongit.freedesktop.org/drm/drm-misc
> >  git fetch --no-tags drm-drm-misc for-linux-next
> >  git checkout 2b5b95b1ff3d70a95013a45e3b5b90f1daf42348
> >  # save the attached .config to linux build tree
> >  COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-9.3.0 make.cross 
> > ARCH=h8300
> > 
> > If you fix the issue, kindly add following tag as appropriate
> > Reported-by: kernel test robot 
> > 
> > All errors (new ones prefixed by >>):
> > 
> > h8300-linux-ld: section .init.text LMA 
> > [004da400,0051ebcb] overlaps section .text LMA 
> > [025c,01069997]
> > h8300-linux-ld: section .data VMA [0040,004da3ff] 
> > overlaps section .text VMA [025c,01069997]
> > h8300-linux-ld: drivers/dma-buf/dma-buf.o: in function `dma_buf_mmap':
> > > > drivers/dma-buf/dma-buf.c:1186: undefined reference to `vma_set_file'
> > vim +1186 drivers/dma-buf/dma-buf.c
> > 
> >1150 
> >1151 
> >1152 /**
> >1153  * dma_buf_mmap - Setup up a userspace mmap with the given vma
> >1154  * @dmabuf: [in]buffer that should back the vma
> >1155  * @vma:[in]vma for the mmap
> >1156  * @pgoff:  [in]offset in pages where this mmap should 
> > start within the
> >1157  *  dma-buf buffer.
> >1158  *
> >1159  * This function adjusts the passed in vma so that it points at 
> > the file of the
> >1160  * dma_buf operation. It also adjusts the starting pgoff and 
> > does bounds
> >1161  * checking on the size of the vma. Then it calls the exporters 
> > mmap function to
> >1162  * set up the mapping.
> >1163  *
> >1164  * Can return negative error values, returns 0 on success.
> >1165  */
> >1166 int dma_buf_mmap(struct dma_buf *dmabuf, struct vm_area_struct 
> > *vma,
> >1167  unsigned long pgoff)
> >1168 {
> >1169 if (WARN_ON(!dmabuf || !vma))
> >1170 return -EINVAL;
> >1171 
> >1172 /* check if buffer supports mmap */
> >1173 if (!dmabuf->ops->mmap)
> >1174 return -EINVAL;
> >1175 
> >1176 /* check for offset overflow */
> >1177 if (pgoff + vma_pages(vma) < pgoff)
> >1178 return -EOVERFLOW;
> >1179 
> >1180 /* check for overflowing the buffer's size */
> >1181 if (pgoff + vma_pages(vma) >
> >1182 dmabuf->size >> PAGE_SHIFT)
> >1183 return -EINVAL;
> >1184 
> >1185 /* readjust the vma */
> > > 1186  vma_set_file(vma, dmabuf->file);
> >1187 vma->vm_pgoff = pgoff;
> >1188 
> >1189 return dmabuf->ops->mmap(dmabuf, vma);
> >1190 }
> >1191 EXPORT_SYMBOL_GPL(dma_buf_mmap);
> >1192 
> > 
> > ---
> > 0-DAY CI Kernel Test Service, Intel Corporation
> > 

Re: [drm-drm-misc:for-linux-next 2/2] drivers/dma-buf/dma-buf.c:1186: undefined reference to `vma_set_file'

2020-11-05 Thread Christian König
Guys, can anybody help me out. Why is the kernel test robot complaining 
here?


Thanks in advance,
Christian.

Am 05.11.20 um 16:26 schrieb kernel test robot:

tree:   git://anongit.freedesktop.org/drm/drm-misc for-linux-next
head:   2b5b95b1ff3d70a95013a45e3b5b90f1daf42348
commit: 2b5b95b1ff3d70a95013a45e3b5b90f1daf42348 [2/2] mm: introduce 
vma_set_file function v4
config: h8300-randconfig-r031-20201105 (attached as .config)
compiler: h8300-linux-gcc (GCC) 9.3.0
reproduce (this is a W=1 build):
 wget 
https://nam11.safelinks.protection.outlook.com/?url=https%3A%2F%2Fraw.githubusercontent.com%2Fintel%2Flkp-tests%2Fmaster%2Fsbin%2Fmake.crossdata=04%7C01%7Cchristian.koenig%40amd.com%7C2c3b39afc651426aa50608d8819f48fc%7C3dd8961fe4884e608e11a82d994e183d%7C0%7C0%7C637401871204724096%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000sdata=dK2txO1WerkR7SiB5i9kcXjbJTMlaQ1Q6dbK1cb9lnE%3Dreserved=0
 -O ~/bin/make.cross
 chmod +x ~/bin/make.cross
 git remote add drm-drm-misc git://anongit.freedesktop.org/drm/drm-misc
 git fetch --no-tags drm-drm-misc for-linux-next
 git checkout 2b5b95b1ff3d70a95013a45e3b5b90f1daf42348
 # save the attached .config to linux build tree
 COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-9.3.0 make.cross 
ARCH=h8300

If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot 

All errors (new ones prefixed by >>):

h8300-linux-ld: section .init.text LMA [004da400,0051ebcb] 
overlaps section .text LMA [025c,01069997]
h8300-linux-ld: section .data VMA [0040,004da3ff] 
overlaps section .text VMA [025c,01069997]
h8300-linux-ld: drivers/dma-buf/dma-buf.o: in function `dma_buf_mmap':

drivers/dma-buf/dma-buf.c:1186: undefined reference to `vma_set_file'

vim +1186 drivers/dma-buf/dma-buf.c

   1150 
   1151 
   1152 /**
   1153  * dma_buf_mmap - Setup up a userspace mmap with the given vma
   1154  * @dmabuf: [in]buffer that should back the vma
   1155  * @vma:[in]vma for the mmap
   1156  * @pgoff:  [in]offset in pages where this mmap should start 
within the
   1157  *  dma-buf buffer.
   1158  *
   1159  * This function adjusts the passed in vma so that it points at the 
file of the
   1160  * dma_buf operation. It also adjusts the starting pgoff and does bounds
   1161  * checking on the size of the vma. Then it calls the exporters mmap 
function to
   1162  * set up the mapping.
   1163  *
   1164  * Can return negative error values, returns 0 on success.
   1165  */
   1166 int dma_buf_mmap(struct dma_buf *dmabuf, struct vm_area_struct *vma,
   1167  unsigned long pgoff)
   1168 {
   1169 if (WARN_ON(!dmabuf || !vma))
   1170 return -EINVAL;
   1171 
   1172 /* check if buffer supports mmap */
   1173 if (!dmabuf->ops->mmap)
   1174 return -EINVAL;
   1175 
   1176 /* check for offset overflow */
   1177 if (pgoff + vma_pages(vma) < pgoff)
   1178 return -EOVERFLOW;
   1179 
   1180 /* check for overflowing the buffer's size */
   1181 if (pgoff + vma_pages(vma) >
   1182 dmabuf->size >> PAGE_SHIFT)
   1183 return -EINVAL;
   1184 
   1185 /* readjust the vma */

1186vma_set_file(vma, dmabuf->file);

   1187 vma->vm_pgoff = pgoff;
   1188 
   1189 return dmabuf->ops->mmap(dmabuf, vma);
   1190 }
   1191 EXPORT_SYMBOL_GPL(dma_buf_mmap);
   1192 

---
0-DAY CI Kernel Test Service, Intel Corporation
https://nam11.safelinks.protection.outlook.com/?url=https%3A%2F%2Flists.01.org%2Fhyperkitty%2Flist%2Fkbuild-all%40lists.01.orgdata=04%7C01%7Cchristian.koenig%40amd.com%7C2c3b39afc651426aa50608d8819f48fc%7C3dd8961fe4884e608e11a82d994e183d%7C0%7C0%7C637401871204724096%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000sdata=YS8NkL2Wf4ysbsibG3a3MAGp8zsEopbazO3ARSAPezc%3Dreserved=0


___
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel