* [linux-next:master 5267/5396] drivers/gpu/drm/i915/gem/i915_gem_object.h:39:6: error: shift count >= width of type
@ 2021-05-26 19:24 kernel test robot
2021-05-26 19:58 ` Andrew Morton
0 siblings, 1 reply; 2+ messages in thread
From: kernel test robot @ 2021-05-26 19:24 UTC (permalink / raw)
To: Mel Gorman
Cc: kbuild-all, clang-built-linux, Linux Memory Management List,
Yang Shi, Andrew Morton
[-- Attachment #1: Type: text/plain, Size: 8364 bytes --]
tree: https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git master
head: f6b46ef27317b3441138b902689bd89e4f82c6f4
commit: 55b24f9ce03ee4d6a06b874350c8297ac8135bf5 [5267/5396] mm/early_ioremap: add prototype for early_memremap_pgprot_adjust
config: x86_64-randconfig-a012-20210526 (attached as .config)
compiler: clang version 13.0.0 (https://github.com/llvm/llvm-project 99155e913e9bad5f7f8a247f8bb3a3ff3da74af1)
reproduce (this is a W=1 build):
wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
chmod +x ~/bin/make.cross
# install x86_64 cross compiling tool for clang build
# apt-get install binutils-x86-64-linux-gnu
# https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git/commit/?id=55b24f9ce03ee4d6a06b874350c8297ac8135bf5
git remote add linux-next https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git
git fetch --no-tags linux-next master
git checkout 55b24f9ce03ee4d6a06b874350c8297ac8135bf5
# save the attached .config to linux build tree
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross ARCH=x86_64
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@intel.com>
All errors (new ones prefixed by >>):
In file included from drivers/gpu/drm/i915/gem/i915_gem_dmabuf.c:7:
In file included from include/linux/dma-buf.h:16:
In file included from include/linux/dma-buf-map.h:9:
In file included from include/linux/io.h:13:
In file included from arch/x86/include/asm/io.h:44:
In file included from ./arch/x86/include/generated/asm/early_ioremap.h:1:
In file included from include/asm-generic/early_ioremap.h:6:
arch/x86/include/asm/fixmap.h:103:48: error: use of undeclared identifier 'NR_CPUS'
FIX_KMAP_END = FIX_KMAP_BEGIN + (KM_MAX_IDX * NR_CPUS) - 1,
^
In file included from drivers/gpu/drm/i915/gem/i915_gem_dmabuf.c:11:
In file included from drivers/gpu/drm/i915/i915_drv.h:83:
In file included from drivers/gpu/drm/i915/gt/intel_gt_types.h:18:
In file included from drivers/gpu/drm/i915/gt/uc/intel_uc.h:9:
In file included from drivers/gpu/drm/i915/gt/uc/intel_guc.h:17:
In file included from drivers/gpu/drm/i915/i915_vma.h:34:
>> drivers/gpu/drm/i915/gem/i915_gem_object.h:39:6: error: shift count >= width of type [-Werror,-Wshift-count-overflow]
if (overflows_type(size, obj->base.size))
~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
drivers/gpu/drm/i915/i915_utils.h:125:32: note: expanded from macro 'overflows_type'
(sizeof(x) > sizeof(T) && (x) >> BITS_PER_TYPE(T))
^
include/linux/compiler.h:56:47: note: expanded from macro 'if'
#define if(cond, ...) if ( __trace_if_var( !!(cond , ## __VA_ARGS__) ) )
~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~
include/linux/compiler.h:58:52: note: expanded from macro '__trace_if_var'
#define __trace_if_var(cond) (__builtin_constant_p(cond) ? (cond) : __trace_if_value(cond))
^~~~
In file included from drivers/gpu/drm/i915/gem/i915_gem_dmabuf.c:11:
In file included from drivers/gpu/drm/i915/i915_drv.h:83:
In file included from drivers/gpu/drm/i915/gt/intel_gt_types.h:18:
In file included from drivers/gpu/drm/i915/gt/uc/intel_uc.h:9:
In file included from drivers/gpu/drm/i915/gt/uc/intel_guc.h:17:
In file included from drivers/gpu/drm/i915/i915_vma.h:34:
>> drivers/gpu/drm/i915/gem/i915_gem_object.h:39:6: error: shift count >= width of type [-Werror,-Wshift-count-overflow]
if (overflows_type(size, obj->base.size))
~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
drivers/gpu/drm/i915/i915_utils.h:125:32: note: expanded from macro 'overflows_type'
(sizeof(x) > sizeof(T) && (x) >> BITS_PER_TYPE(T))
^
include/linux/compiler.h:56:47: note: expanded from macro 'if'
#define if(cond, ...) if ( __trace_if_var( !!(cond , ## __VA_ARGS__) ) )
~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~
include/linux/compiler.h:58:61: note: expanded from macro '__trace_if_var'
#define __trace_if_var(cond) (__builtin_constant_p(cond) ? (cond) : __trace_if_value(cond))
^~~~
In file included from drivers/gpu/drm/i915/gem/i915_gem_dmabuf.c:11:
In file included from drivers/gpu/drm/i915/i915_drv.h:83:
In file included from drivers/gpu/drm/i915/gt/intel_gt_types.h:18:
In file included from drivers/gpu/drm/i915/gt/uc/intel_uc.h:9:
In file included from drivers/gpu/drm/i915/gt/uc/intel_guc.h:17:
In file included from drivers/gpu/drm/i915/i915_vma.h:34:
>> drivers/gpu/drm/i915/gem/i915_gem_object.h:39:6: error: shift count >= width of type [-Werror,-Wshift-count-overflow]
if (overflows_type(size, obj->base.size))
~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
drivers/gpu/drm/i915/i915_utils.h:125:32: note: expanded from macro 'overflows_type'
(sizeof(x) > sizeof(T) && (x) >> BITS_PER_TYPE(T))
^
include/linux/compiler.h:56:47: note: expanded from macro 'if'
#define if(cond, ...) if ( __trace_if_var( !!(cond , ## __VA_ARGS__) ) )
~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~
include/linux/compiler.h:58:86: note: expanded from macro '__trace_if_var'
#define __trace_if_var(cond) (__builtin_constant_p(cond) ? (cond) : __trace_if_value(cond))
~~~~~~~~~~~~~~~~~^~~~~
include/linux/compiler.h:69:3: note: expanded from macro '__trace_if_value'
(cond) ? \
^~~~
4 errors generated.
vim +39 drivers/gpu/drm/i915/gem/i915_gem_object.h
f0e4a06397526d Chris Wilson 2019-05-28 18
ae2fb480f32f65 Matthew Auld 2021-01-22 19 /*
ae2fb480f32f65 Matthew Auld 2021-01-22 20 * XXX: There is a prevalence of the assumption that we fit the
ae2fb480f32f65 Matthew Auld 2021-01-22 21 * object's page count inside a 32bit _signed_ variable. Let's document
ae2fb480f32f65 Matthew Auld 2021-01-22 22 * this and catch if we ever need to fix it. In the meantime, if you do
ae2fb480f32f65 Matthew Auld 2021-01-22 23 * spot such a local variable, please consider fixing!
ae2fb480f32f65 Matthew Auld 2021-01-22 24 *
ae2fb480f32f65 Matthew Auld 2021-01-22 25 * Aside from our own locals (for which we have no excuse!):
ae2fb480f32f65 Matthew Auld 2021-01-22 26 * - sg_table embeds unsigned int for num_pages
ae2fb480f32f65 Matthew Auld 2021-01-22 27 * - get_user_pages*() mixed ints with longs
ae2fb480f32f65 Matthew Auld 2021-01-22 28 */
ae2fb480f32f65 Matthew Auld 2021-01-22 29 #define GEM_CHECK_SIZE_OVERFLOW(sz) \
ae2fb480f32f65 Matthew Auld 2021-01-22 30 GEM_WARN_ON((sz) >> PAGE_SHIFT > INT_MAX)
ae2fb480f32f65 Matthew Auld 2021-01-22 31
ae2fb480f32f65 Matthew Auld 2021-01-22 32 static inline bool i915_gem_object_size_2big(u64 size)
ae2fb480f32f65 Matthew Auld 2021-01-22 33 {
ae2fb480f32f65 Matthew Auld 2021-01-22 34 struct drm_i915_gem_object *obj;
ae2fb480f32f65 Matthew Auld 2021-01-22 35
ae2fb480f32f65 Matthew Auld 2021-01-22 36 if (GEM_CHECK_SIZE_OVERFLOW(size))
ae2fb480f32f65 Matthew Auld 2021-01-22 37 return true;
ae2fb480f32f65 Matthew Auld 2021-01-22 38
ae2fb480f32f65 Matthew Auld 2021-01-22 @39 if (overflows_type(size, obj->base.size))
ae2fb480f32f65 Matthew Auld 2021-01-22 40 return true;
ae2fb480f32f65 Matthew Auld 2021-01-22 41
ae2fb480f32f65 Matthew Auld 2021-01-22 42 return false;
ae2fb480f32f65 Matthew Auld 2021-01-22 43 }
ae2fb480f32f65 Matthew Auld 2021-01-22 44
:::::: The code at line 39 was first introduced by commit
:::::: ae2fb480f32f657d896d78b6214c2efebfa61993 drm/i915/gem: consolidate 2big error checking for object sizes
:::::: TO: Matthew Auld <matthew.auld@intel.com>
:::::: CC: Daniel Vetter <daniel.vetter@ffwll.ch>
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
[-- Attachment #2: .config.gz --]
[-- Type: application/gzip, Size: 43566 bytes --]
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: [linux-next:master 5267/5396] drivers/gpu/drm/i915/gem/i915_gem_object.h:39:6: error: shift count >= width of type
2021-05-26 19:24 [linux-next:master 5267/5396] drivers/gpu/drm/i915/gem/i915_gem_object.h:39:6: error: shift count >= width of type kernel test robot
@ 2021-05-26 19:58 ` Andrew Morton
0 siblings, 0 replies; 2+ messages in thread
From: Andrew Morton @ 2021-05-26 19:58 UTC (permalink / raw)
To: kernel test robot
Cc: Mel Gorman, kbuild-all, clang-built-linux,
Linux Memory Management List, Yang Shi
On Thu, 27 May 2021 03:24:25 +0800 kernel test robot <lkp@intel.com> wrote:
> tree: https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git master
> head: f6b46ef27317b3441138b902689bd89e4f82c6f4
> commit: 55b24f9ce03ee4d6a06b874350c8297ac8135bf5 [5267/5396] mm/early_ioremap: add prototype for early_memremap_pgprot_adjust
> config: x86_64-randconfig-a012-20210526 (attached as .config)
> compiler: clang version 13.0.0 (https://github.com/llvm/llvm-project 99155e913e9bad5f7f8a247f8bb3a3ff3da74af1)
> reproduce (this is a W=1 build):
> wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
> chmod +x ~/bin/make.cross
> # install x86_64 cross compiling tool for clang build
> # apt-get install binutils-x86-64-linux-gnu
> # https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git/commit/?id=55b24f9ce03ee4d6a06b874350c8297ac8135bf5
> git remote add linux-next https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git
> git fetch --no-tags linux-next master
> git checkout 55b24f9ce03ee4d6a06b874350c8297ac8135bf5
> # save the attached .config to linux build tree
> COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross ARCH=x86_64
>
> If you fix the issue, kindly add following tag as appropriate
> Reported-by: kernel test robot <lkp@intel.com>
>
> All errors (new ones prefixed by >>):
>
> In file included from drivers/gpu/drm/i915/gem/i915_gem_dmabuf.c:7:
> In file included from include/linux/dma-buf.h:16:
> In file included from include/linux/dma-buf-map.h:9:
> In file included from include/linux/io.h:13:
> In file included from arch/x86/include/asm/io.h:44:
> In file included from ./arch/x86/include/generated/asm/early_ioremap.h:1:
> In file included from include/asm-generic/early_ioremap.h:6:
> arch/x86/include/asm/fixmap.h:103:48: error: use of undeclared identifier 'NR_CPUS'
> FIX_KMAP_END = FIX_KMAP_BEGIN + (KM_MAX_IDX * NR_CPUS) - 1,
> ^
urgh, so x86_64 asm/fixmap.h isn't standalone - it needs threads.h for
NR_CPUS.
We have a lot of asm/fixmap.h's, so lazyass here will try this:
--- a/include/asm-generic/early_ioremap.h~mm-early_ioremap-add-prototype-for-early_memremap_pgprot_adjust-fix
+++ a/include/asm-generic/early_ioremap.h
@@ -3,6 +3,7 @@
#define _ASM_EARLY_IOREMAP_H_
#include <linux/types.h>
+#include <linux/threads.h> /* x86 fixmap.h needs NR_CPUS */
#include <asm/fixmap.h>
/*
but really we should make those fixmap.h's standalone.
> >> drivers/gpu/drm/i915/gem/i915_gem_object.h:39:6: error: shift count >= width of type [-Werror,-Wshift-count-overflow]
> if (overflows_type(size, obj->base.size))
> ~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> drivers/gpu/drm/i915/i915_utils.h:125:32: note: expanded from macro 'overflows_type'
> (sizeof(x) > sizeof(T) && (x) >> BITS_PER_TYPE(T))
Hopefully this is just fallout from the first error.
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2021-05-26 19:58 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-05-26 19:24 [linux-next:master 5267/5396] drivers/gpu/drm/i915/gem/i915_gem_object.h:39:6: error: shift count >= width of type kernel test robot
2021-05-26 19:58 ` Andrew Morton
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).