All of lore.kernel.org
 help / color / mirror / Atom feed
* [radeon-alex:drm-next-4.12-wip 34/40] drivers/gpu/drm/amd/amdgpu/amdgpu_gem.c:620:4: warning: left shift count >= width of type
@ 2017-02-10 19:48 kbuild test robot
  2017-02-11  7:55 ` Christian König
  0 siblings, 1 reply; 4+ messages in thread
From: kbuild test robot @ 2017-02-10 19:48 UTC (permalink / raw)
  To: Junwei Zhang
  Cc: Alex Deucher, Nicolai Hähnle, kbuild-all, dri-devel,
	Christian König

[-- Attachment #1: Type: text/plain, Size: 1956 bytes --]

tree:   git://people.freedesktop.org/~agd5f/linux.git drm-next-4.12-wip
head:   d32ff0ea8e22964abcc6406e00a0646f2bfb94c7
commit: 382a21d981661dbc8198c37dc95707e1e381ce76 [34/40] drm/amdgpu: IOCTL interface for PRT support v4
config: xtensa-allmodconfig (attached as .config)
compiler: xtensa-linux-gcc (GCC) 4.9.0
reproduce:
        wget https://git.kernel.org/cgit/linux/kernel/git/wfg/lkp-tests.git/plain/sbin/make.cross -O ~/bin/make.cross
        chmod +x ~/bin/make.cross
        git checkout 382a21d981661dbc8198c37dc95707e1e381ce76
        # save the attached .config to linux build tree
        make.cross ARCH=xtensa 

All warnings (new ones prefixed by >>):

   drivers/gpu/drm/amd/amdgpu/amdgpu_gem.c: In function 'amdgpu_gem_va_ioctl':
>> drivers/gpu/drm/amd/amdgpu/amdgpu_gem.c:620:4: warning: left shift count >= width of type
       va_flags |= AMDGPU_PTE_PRT;
       ^

vim +620 drivers/gpu/drm/amd/amdgpu/amdgpu_gem.c

   604				r = -ENOENT;
   605				goto error_backoff;
   606			}
   607		} else {
   608			bo_va = fpriv->prt_va;
   609		}
   610	
   611		switch (args->operation) {
   612		case AMDGPU_VA_OP_MAP:
   613			if (args->flags & AMDGPU_VM_PAGE_READABLE)
   614				va_flags |= AMDGPU_PTE_READABLE;
   615			if (args->flags & AMDGPU_VM_PAGE_WRITEABLE)
   616				va_flags |= AMDGPU_PTE_WRITEABLE;
   617			if (args->flags & AMDGPU_VM_PAGE_EXECUTABLE)
   618				va_flags |= AMDGPU_PTE_EXECUTABLE;
   619			if (args->flags & AMDGPU_VM_PAGE_PRT)
 > 620				va_flags |= AMDGPU_PTE_PRT;
   621			r = amdgpu_vm_bo_map(adev, bo_va, args->va_address,
   622					     args->offset_in_bo, args->map_size,
   623					     va_flags);
   624			break;
   625		case AMDGPU_VA_OP_UNMAP:
   626			r = amdgpu_vm_bo_unmap(adev, bo_va, args->va_address);
   627			break;
   628		default:

---
0-DAY kernel test infrastructure                Open Source Technology Center
https://lists.01.org/pipermail/kbuild-all                   Intel Corporation

[-- Attachment #2: .config.gz --]
[-- Type: application/gzip, Size: 48207 bytes --]

[-- Attachment #3: Type: text/plain, Size: 160 bytes --]

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

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [radeon-alex:drm-next-4.12-wip 34/40] drivers/gpu/drm/amd/amdgpu/amdgpu_gem.c:620:4: warning: left shift count >= width of type
  2017-02-10 19:48 [radeon-alex:drm-next-4.12-wip 34/40] drivers/gpu/drm/amd/amdgpu/amdgpu_gem.c:620:4: warning: left shift count >= width of type kbuild test robot
@ 2017-02-11  7:55 ` Christian König
  2017-02-13  1:43   ` Zhang, Jerry
  2017-02-13  7:24   ` Thierry Reding
  0 siblings, 2 replies; 4+ messages in thread
From: Christian König @ 2017-02-11  7:55 UTC (permalink / raw)
  To: Junwei Zhang
  Cc: Alex Deucher, dri-devel, Nicolai Hähnle,
	Christian König


[-- Attachment #1.1: Type: text/plain, Size: 2465 bytes --]

Mhm, guys any idea why the build bot is spamming us with that warning?

The type is 64bit and the shift is 63, so that should work fine.

Regards,
Christian.

Am 10.02.2017 um 20:48 schrieb kbuild test robot:
> tree:   git://people.freedesktop.org/~agd5f/linux.git drm-next-4.12-wip
> head:   d32ff0ea8e22964abcc6406e00a0646f2bfb94c7
> commit: 382a21d981661dbc8198c37dc95707e1e381ce76 [34/40] drm/amdgpu: IOCTL interface for PRT support v4
> config: xtensa-allmodconfig (attached as .config)
> compiler: xtensa-linux-gcc (GCC) 4.9.0
> reproduce:
>          wget https://git.kernel.org/cgit/linux/kernel/git/wfg/lkp-tests.git/plain/sbin/make.cross -O ~/bin/make.cross
>          chmod +x ~/bin/make.cross
>          git checkout 382a21d981661dbc8198c37dc95707e1e381ce76
>          # save the attached .config to linux build tree
>          make.cross ARCH=xtensa
>
> All warnings (new ones prefixed by >>):
>
>     drivers/gpu/drm/amd/amdgpu/amdgpu_gem.c: In function 'amdgpu_gem_va_ioctl':
>>> drivers/gpu/drm/amd/amdgpu/amdgpu_gem.c:620:4: warning: left shift count >= width of type
>         va_flags |= AMDGPU_PTE_PRT;
>         ^
>
> vim +620 drivers/gpu/drm/amd/amdgpu/amdgpu_gem.c
>
>     604				r = -ENOENT;
>     605				goto error_backoff;
>     606			}
>     607		} else {
>     608			bo_va = fpriv->prt_va;
>     609		}
>     610	
>     611		switch (args->operation) {
>     612		case AMDGPU_VA_OP_MAP:
>     613			if (args->flags & AMDGPU_VM_PAGE_READABLE)
>     614				va_flags |= AMDGPU_PTE_READABLE;
>     615			if (args->flags & AMDGPU_VM_PAGE_WRITEABLE)
>     616				va_flags |= AMDGPU_PTE_WRITEABLE;
>     617			if (args->flags & AMDGPU_VM_PAGE_EXECUTABLE)
>     618				va_flags |= AMDGPU_PTE_EXECUTABLE;
>     619			if (args->flags & AMDGPU_VM_PAGE_PRT)
>   > 620				va_flags |= AMDGPU_PTE_PRT;
>     621			r = amdgpu_vm_bo_map(adev, bo_va, args->va_address,
>     622					     args->offset_in_bo, args->map_size,
>     623					     va_flags);
>     624			break;
>     625		case AMDGPU_VA_OP_UNMAP:
>     626			r = amdgpu_vm_bo_unmap(adev, bo_va, args->va_address);
>     627			break;
>     628		default:
>
> ---
> 0-DAY kernel test infrastructure                Open Source Technology Center
> https://lists.01.org/pipermail/kbuild-all                   Intel Corporation
>
>
> _______________________________________________
> dri-devel mailing list
> dri-devel@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/dri-devel



[-- Attachment #1.2: Type: text/html, Size: 3495 bytes --]

[-- Attachment #2: Type: text/plain, Size: 160 bytes --]

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

^ permalink raw reply	[flat|nested] 4+ messages in thread

* RE: [radeon-alex:drm-next-4.12-wip 34/40] drivers/gpu/drm/amd/amdgpu/amdgpu_gem.c:620:4: warning: left shift count >= width of type
  2017-02-11  7:55 ` Christian König
@ 2017-02-13  1:43   ` Zhang, Jerry
  2017-02-13  7:24   ` Thierry Reding
  1 sibling, 0 replies; 4+ messages in thread
From: Zhang, Jerry @ 2017-02-13  1:43 UTC (permalink / raw)
  To: Christian König
  Cc: Deucher, Alexander, dri-devel@lists.freedesktop.org,
	Haehnle, Nicolai, Koenig, Christian


[-- Attachment #1.1: Type: text/plain, Size: 3917 bytes --]

Hi Christian,

Maybe we need a change.
{{{
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.h b/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.h
index 4d26e9b..fb5448b 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.h
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.h
@@ -65,7 +65,7 @@

#define AMDGPU_PTE_FRAG(x)     ((x & 0x1f) << 7)

-#define AMDGPU_PTE_PRT         (1UL << 63)
+#define AMDGPU_PTE_PRT         (1ULL << 63)

/* How to programm VM fault handling */
#define AMDGPU_VM_FAULT_STOP_NEVER     0
}}}

Regards,
Jerry (Junwei Zhang)

Linux Base Graphics
SRDC Software Development
_____________________________________

From: Christian König [mailto:deathsimple@vodafone.de]
Sent: Saturday, February 11, 2017 15:56
To: Zhang, Jerry
Cc: Deucher, Alexander; Haehnle, Nicolai; dri-devel@lists.freedesktop.org; Koenig, Christian
Subject: Re: [radeon-alex:drm-next-4.12-wip 34/40] drivers/gpu/drm/amd/amdgpu/amdgpu_gem.c:620:4: warning: left shift count >= width of type

Mhm, guys any idea why the build bot is spamming us with that warning?

The type is 64bit and the shift is 63, so that should work fine.

Regards,
Christian.

Am 10.02.2017 um 20:48 schrieb kbuild test robot:

tree:   git://people.freedesktop.org/~agd5f/linux.git drm-next-4.12-wip

head:   d32ff0ea8e22964abcc6406e00a0646f2bfb94c7

commit: 382a21d981661dbc8198c37dc95707e1e381ce76 [34/40] drm/amdgpu: IOCTL interface for PRT support v4

config: xtensa-allmodconfig (attached as .config)

compiler: xtensa-linux-gcc (GCC) 4.9.0

reproduce:

        wget https://git.kernel.org/cgit/linux/kernel/git/wfg/lkp-tests.git/plain/sbin/make.cross -O ~/bin/make.cross

        chmod +x ~/bin/make.cross

        git checkout 382a21d981661dbc8198c37dc95707e1e381ce76

        # save the attached .config to linux build tree

        make.cross ARCH=xtensa



All warnings (new ones prefixed by >>):



   drivers/gpu/drm/amd/amdgpu/amdgpu_gem.c: In function 'amdgpu_gem_va_ioctl':

drivers/gpu/drm/amd/amdgpu/amdgpu_gem.c:620:4: warning: left shift count >= width of type

       va_flags |= AMDGPU_PTE_PRT;

       ^



vim +620 drivers/gpu/drm/amd/amdgpu/amdgpu_gem.c



   604                         r = -ENOENT;

   605                         goto error_backoff;

   606                  }

   607          } else {

   608                  bo_va = fpriv->prt_va;

   609          }

   610

   611          switch (args->operation) {

   612          case AMDGPU_VA_OP_MAP:

   613                  if (args->flags & AMDGPU_VM_PAGE_READABLE)

   614                         va_flags |= AMDGPU_PTE_READABLE;

   615                  if (args->flags & AMDGPU_VM_PAGE_WRITEABLE)

   616                         va_flags |= AMDGPU_PTE_WRITEABLE;

   617                  if (args->flags & AMDGPU_VM_PAGE_EXECUTABLE)

   618                         va_flags |= AMDGPU_PTE_EXECUTABLE;

   619                  if (args->flags & AMDGPU_VM_PAGE_PRT)

 > 620                         va_flags |= AMDGPU_PTE_PRT;

   621                  r = amdgpu_vm_bo_map(adev, bo_va, args->va_address,

   622                                      args->offset_in_bo, args->map_size,

   623                                      va_flags);

   624                  break;

   625          case AMDGPU_VA_OP_UNMAP:

   626                  r = amdgpu_vm_bo_unmap(adev, bo_va, args->va_address);

   627                  break;

   628          default:



---

0-DAY kernel test infrastructure                Open Source Technology Center

https://lists.01.org/pipermail/kbuild-all                   Intel Corporation




_______________________________________________

dri-devel mailing list

dri-devel@lists.freedesktop.org<mailto:dri-devel@lists.freedesktop.org>

https://lists.freedesktop.org/mailman/listinfo/dri-devel



[-- Attachment #1.2: Type: text/html, Size: 15633 bytes --]

[-- Attachment #2: Type: text/plain, Size: 160 bytes --]

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

^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [radeon-alex:drm-next-4.12-wip 34/40] drivers/gpu/drm/amd/amdgpu/amdgpu_gem.c:620:4: warning: left shift count >= width of type
  2017-02-11  7:55 ` Christian König
  2017-02-13  1:43   ` Zhang, Jerry
@ 2017-02-13  7:24   ` Thierry Reding
  1 sibling, 0 replies; 4+ messages in thread
From: Thierry Reding @ 2017-02-13  7:24 UTC (permalink / raw)
  To: Christian König
  Cc: Junwei Zhang, Alex Deucher, Nicolai Hähnle, dri-devel,
	Christian König


[-- Attachment #1.1: Type: text/plain, Size: 3403 bytes --]

On Sat, Feb 11, 2017 at 08:55:50AM +0100, Christian König wrote:
> Mhm, guys any idea why the build bot is spamming us with that warning?
> 
> The type is 64bit and the shift is 63, so that should work fine.

1UL will be an unsigned long, which is 64 bit on 64 bit architectures
only. Xtensa is a 32 bit platform, hence 1UL will effectively be 32 bits
and 1UL << 63 would effectively be 0.

I think the safe thing to do here would be to change 1UL to 1ULL to make
sure there are enough bits. unsigned long long is guaranteed to be at
least 64 bits.

Alternatively if you no longer want to support 32 bit architectures you
could depend on the Kconfig symbol 64BIT, but I suspect you don't want
to do that.

Thierry

> Am 10.02.2017 um 20:48 schrieb kbuild test robot:
> > tree:   git://people.freedesktop.org/~agd5f/linux.git drm-next-4.12-wip
> > head:   d32ff0ea8e22964abcc6406e00a0646f2bfb94c7
> > commit: 382a21d981661dbc8198c37dc95707e1e381ce76 [34/40] drm/amdgpu: IOCTL interface for PRT support v4
> > config: xtensa-allmodconfig (attached as .config)
> > compiler: xtensa-linux-gcc (GCC) 4.9.0
> > reproduce:
> >          wget https://git.kernel.org/cgit/linux/kernel/git/wfg/lkp-tests.git/plain/sbin/make.cross -O ~/bin/make.cross
> >          chmod +x ~/bin/make.cross
> >          git checkout 382a21d981661dbc8198c37dc95707e1e381ce76
> >          # save the attached .config to linux build tree
> >          make.cross ARCH=xtensa
> > 
> > All warnings (new ones prefixed by >>):
> > 
> >     drivers/gpu/drm/amd/amdgpu/amdgpu_gem.c: In function 'amdgpu_gem_va_ioctl':
> > > > drivers/gpu/drm/amd/amdgpu/amdgpu_gem.c:620:4: warning: left shift count >= width of type
> >         va_flags |= AMDGPU_PTE_PRT;
> >         ^
> > 
> > vim +620 drivers/gpu/drm/amd/amdgpu/amdgpu_gem.c
> > 
> >     604				r = -ENOENT;
> >     605				goto error_backoff;
> >     606			}
> >     607		} else {
> >     608			bo_va = fpriv->prt_va;
> >     609		}
> >     610	
> >     611		switch (args->operation) {
> >     612		case AMDGPU_VA_OP_MAP:
> >     613			if (args->flags & AMDGPU_VM_PAGE_READABLE)
> >     614				va_flags |= AMDGPU_PTE_READABLE;
> >     615			if (args->flags & AMDGPU_VM_PAGE_WRITEABLE)
> >     616				va_flags |= AMDGPU_PTE_WRITEABLE;
> >     617			if (args->flags & AMDGPU_VM_PAGE_EXECUTABLE)
> >     618				va_flags |= AMDGPU_PTE_EXECUTABLE;
> >     619			if (args->flags & AMDGPU_VM_PAGE_PRT)
> >   > 620				va_flags |= AMDGPU_PTE_PRT;
> >     621			r = amdgpu_vm_bo_map(adev, bo_va, args->va_address,
> >     622					     args->offset_in_bo, args->map_size,
> >     623					     va_flags);
> >     624			break;
> >     625		case AMDGPU_VA_OP_UNMAP:
> >     626			r = amdgpu_vm_bo_unmap(adev, bo_va, args->va_address);
> >     627			break;
> >     628		default:
> > 
> > ---
> > 0-DAY kernel test infrastructure                Open Source Technology Center
> > https://lists.01.org/pipermail/kbuild-all                   Intel Corporation
> > 
> > 
> > _______________________________________________
> > dri-devel mailing list
> > dri-devel@lists.freedesktop.org
> > https://lists.freedesktop.org/mailman/listinfo/dri-devel
> 
> 

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


[-- Attachment #1.2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

[-- Attachment #2: Type: text/plain, Size: 160 bytes --]

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

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2017-02-13  7:24 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-02-10 19:48 [radeon-alex:drm-next-4.12-wip 34/40] drivers/gpu/drm/amd/amdgpu/amdgpu_gem.c:620:4: warning: left shift count >= width of type kbuild test robot
2017-02-11  7:55 ` Christian König
2017-02-13  1:43   ` Zhang, Jerry
2017-02-13  7:24   ` Thierry Reding

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.