[jsarha:topic/chromeos-4.19-s0ix 7536/9999] drivers/gpu/drm/i915/i915_gem.c:3202:30: error: format specifies type 'int' but the argument has type 'u64' (aka 'unsigned long long')
From: kernel test robot
Date: Tue Aug 23 2022 - 03:41:28 EST
Hi Christian,
FYI, the error/warning still remains.
tree: https://github.com/jsarha/linux topic/chromeos-4.19-s0ix
head: 430bdaa0a8c38697780f45a148964d71951df11f
commit: 88445be194e93603d722c82108ed8c47c3f60e65 [7536/9999] UPSTREAM: dma-buf: make fence sequence numbers 64 bit v2
config: x86_64-randconfig-a005-20220822 (https://download.01.org/0day-ci/archive/20220823/202208231552.C5IkgSE2-lkp@xxxxxxxxx/config)
compiler: clang version 14.0.6 (https://github.com/llvm/llvm-project f28c006a5895fc0e329fe15fead81e37457cb1d1)
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
# https://github.com/jsarha/linux/commit/88445be194e93603d722c82108ed8c47c3f60e65
git remote add jsarha https://github.com/jsarha/linux
git fetch --no-tags jsarha topic/chromeos-4.19-s0ix
git checkout 88445be194e93603d722c82108ed8c47c3f60e65
# save the config file
mkdir build_dir && cp config build_dir/.config
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross W=1 O=build_dir ARCH=x86_64 SHELL=/bin/bash arch/x86/mm/ drivers/gpu/drm/i915/
If you fix the issue, kindly add following tag where applicable
Reported-by: kernel test robot <lkp@xxxxxxxxx>
All errors (new ones prefixed by >>):
In file included from include/linux/thread_info.h:38:
arch/x86/include/asm/thread_info.h:229:13: error: calling '__builtin_frame_address' with a nonzero argument is unsafe [-Werror,-Wframe-address]
oldframe = __builtin_frame_address(1);
^~~~~~~~~~~~~~~~~~~~~~~~~~
arch/x86/include/asm/thread_info.h:231:11: error: calling '__builtin_frame_address' with a nonzero argument is unsafe [-Werror,-Wframe-address]
frame = __builtin_frame_address(2);
^~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from drivers/gpu/drm/i915/i915_gem.c:31:
In file included from drivers/gpu/drm/i915/i915_drv.h:44:
In file included from include/linux/perf_event.h:48:
include/linux/ftrace.h:706:9: error: calling '__builtin_return_address' with a nonzero argument is unsafe [-Werror,-Wframe-address]
addr = CALLER_ADDR1;
^~~~~~~~~~~~
include/linux/ftrace.h:693:38: note: expanded from macro 'CALLER_ADDR1'
#define CALLER_ADDR1 ((unsigned long)ftrace_return_address(1))
^~~~~~~~~~~~~~~~~~~~~~~~
include/linux/ftrace.h:686:36: note: expanded from macro 'ftrace_return_address'
# define ftrace_return_address(n) __builtin_return_address(n)
^~~~~~~~~~~~~~~~~~~~~~~~~~~
include/linux/ftrace.h:709:9: error: calling '__builtin_return_address' with a nonzero argument is unsafe [-Werror,-Wframe-address]
return CALLER_ADDR2;
^~~~~~~~~~~~
include/linux/ftrace.h:694:38: note: expanded from macro 'CALLER_ADDR2'
#define CALLER_ADDR2 ((unsigned long)ftrace_return_address(2))
^~~~~~~~~~~~~~~~~~~~~~~~
include/linux/ftrace.h:686:36: note: expanded from macro 'ftrace_return_address'
# define ftrace_return_address(n) __builtin_return_address(n)
^~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from drivers/gpu/drm/i915/i915_gem.c:31:
drivers/gpu/drm/i915/i915_drv.h:3199:9: error: use of bitwise '|' with boolean operands [-Werror,-Wbitwise-instead-of-logical]
return i915_reset_backoff(error) | i915_terminally_wedged(error);
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
||
drivers/gpu/drm/i915/i915_drv.h:3199:9: note: cast one or both operands to int to silence this warning
drivers/gpu/drm/i915/i915_gem.c:142:2: error: format string is not a string literal (potentially insecure) [-Werror,-Wformat-security]
GEM_TRACE("\n");
^~~~~~~~~~~~~~~
drivers/gpu/drm/i915/i915_gem.h:64:24: note: expanded from macro 'GEM_TRACE'
#define GEM_TRACE(...) trace_printk(__VA_ARGS__)
^~~~~~~~~~~~~~~~~~~~~~~~~
include/linux/kernel.h:719:3: note: expanded from macro 'trace_printk'
do_trace_printk(fmt, ##__VA_ARGS__); \
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
include/linux/kernel.h:733:30: note: expanded from macro 'do_trace_printk'
__trace_bprintk(_THIS_IP_, trace_printk_fmt, ##args); \
^~~~~~~~~~~~~~~~
drivers/gpu/drm/i915/i915_gem.c:142:2: note: treat the string as an argument to avoid this
drivers/gpu/drm/i915/i915_gem.h:64:24: note: expanded from macro 'GEM_TRACE'
#define GEM_TRACE(...) trace_printk(__VA_ARGS__)
^
include/linux/kernel.h:719:3: note: expanded from macro 'trace_printk'
do_trace_printk(fmt, ##__VA_ARGS__); \
^
include/linux/kernel.h:733:30: note: expanded from macro 'do_trace_printk'
__trace_bprintk(_THIS_IP_, trace_printk_fmt, ##args); \
^
drivers/gpu/drm/i915/i915_gem.c:186:2: error: format string is not a string literal (potentially insecure) [-Werror,-Wformat-security]
GEM_TRACE("\n");
^~~~~~~~~~~~~~~
drivers/gpu/drm/i915/i915_gem.h:64:24: note: expanded from macro 'GEM_TRACE'
#define GEM_TRACE(...) trace_printk(__VA_ARGS__)
^~~~~~~~~~~~~~~~~~~~~~~~~
include/linux/kernel.h:719:3: note: expanded from macro 'trace_printk'
do_trace_printk(fmt, ##__VA_ARGS__); \
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
include/linux/kernel.h:733:30: note: expanded from macro 'do_trace_printk'
__trace_bprintk(_THIS_IP_, trace_printk_fmt, ##args); \
^~~~~~~~~~~~~~~~
drivers/gpu/drm/i915/i915_gem.c:186:2: note: treat the string as an argument to avoid this
drivers/gpu/drm/i915/i915_gem.h:64:24: note: expanded from macro 'GEM_TRACE'
#define GEM_TRACE(...) trace_printk(__VA_ARGS__)
^
include/linux/kernel.h:719:3: note: expanded from macro 'trace_printk'
do_trace_printk(fmt, ##__VA_ARGS__); \
^
include/linux/kernel.h:733:30: note: expanded from macro 'do_trace_printk'
__trace_bprintk(_THIS_IP_, trace_printk_fmt, ##args); \
^
drivers/gpu/drm/i915/i915_gem.c:200:2: error: format string is not a string literal (potentially insecure) [-Werror,-Wformat-security]
GEM_TRACE("\n");
^~~~~~~~~~~~~~~
drivers/gpu/drm/i915/i915_gem.h:64:24: note: expanded from macro 'GEM_TRACE'
#define GEM_TRACE(...) trace_printk(__VA_ARGS__)
^~~~~~~~~~~~~~~~~~~~~~~~~
include/linux/kernel.h:719:3: note: expanded from macro 'trace_printk'
do_trace_printk(fmt, ##__VA_ARGS__); \
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
include/linux/kernel.h:733:30: note: expanded from macro 'do_trace_printk'
__trace_bprintk(_THIS_IP_, trace_printk_fmt, ##args); \
^~~~~~~~~~~~~~~~
drivers/gpu/drm/i915/i915_gem.c:200:2: note: treat the string as an argument to avoid this
drivers/gpu/drm/i915/i915_gem.h:64:24: note: expanded from macro 'GEM_TRACE'
#define GEM_TRACE(...) trace_printk(__VA_ARGS__)
^
include/linux/kernel.h:719:3: note: expanded from macro 'trace_printk'
do_trace_printk(fmt, ##__VA_ARGS__); \
^
include/linux/kernel.h:733:30: note: expanded from macro 'do_trace_printk'
__trace_bprintk(_THIS_IP_, trace_printk_fmt, ##args); \
^
>> drivers/gpu/drm/i915/i915_gem.c:3202:30: error: format specifies type 'int' but the argument has type 'u64' (aka 'unsigned long long') [-Werror,-Wformat]
request->fence.context, request->fence.seqno,
^~~~~~~~~~~~~~~~~~~~
drivers/gpu/drm/i915/i915_gem.h:64:37: note: expanded from macro 'GEM_TRACE'
#define GEM_TRACE(...) trace_printk(__VA_ARGS__)
^~~~~~~~~~~
include/linux/kernel.h:719:26: note: expanded from macro 'trace_printk'
do_trace_printk(fmt, ##__VA_ARGS__); \
~~~ ^~~~~~~~~~~
include/linux/kernel.h:730:37: note: expanded from macro 'do_trace_printk'
__trace_printk_check_format(fmt, ##args); \
~~~ ^~~~
include/linux/kernel.h:682:40: note: expanded from macro '__trace_printk_check_format'
____trace_printk_check_format(fmt, ##args); \
~~~ ^~~~
>> drivers/gpu/drm/i915/i915_gem.c:3202:30: error: format specifies type 'int' but the argument has type 'u64' (aka 'unsigned long long') [-Werror,-Wformat]
request->fence.context, request->fence.seqno,
^~~~~~~~~~~~~~~~~~~~
drivers/gpu/drm/i915/i915_gem.h:64:37: note: expanded from macro 'GEM_TRACE'
#define GEM_TRACE(...) trace_printk(__VA_ARGS__)
^~~~~~~~~~~
include/linux/kernel.h:719:26: note: expanded from macro 'trace_printk'
do_trace_printk(fmt, ##__VA_ARGS__); \
~~~ ^~~~~~~~~~~
include/linux/kernel.h:735:36: note: expanded from macro 'do_trace_printk'
__trace_printk(_THIS_IP_, fmt, ##args); \
~~~ ^~~~
drivers/gpu/drm/i915/i915_gem.c:3324:29: error: format specifies type 'int' but the argument has type 'u64' (aka 'unsigned long long') [-Werror,-Wformat]
request->fence.context, request->fence.seqno);
^~~~~~~~~~~~~~~~~~~~
drivers/gpu/drm/i915/i915_gem.h:64:37: note: expanded from macro 'GEM_TRACE'
#define GEM_TRACE(...) trace_printk(__VA_ARGS__)
^~~~~~~~~~~
include/linux/kernel.h:719:26: note: expanded from macro 'trace_printk'
do_trace_printk(fmt, ##__VA_ARGS__); \
~~~ ^~~~~~~~~~~
include/linux/kernel.h:730:37: note: expanded from macro 'do_trace_printk'
__trace_printk_check_format(fmt, ##args); \
~~~ ^~~~
include/linux/kernel.h:682:40: note: expanded from macro '__trace_printk_check_format'
____trace_printk_check_format(fmt, ##args); \
~~~ ^~~~
drivers/gpu/drm/i915/i915_gem.c:3324:29: error: format specifies type 'int' but the argument has type 'u64' (aka 'unsigned long long') [-Werror,-Wformat]
request->fence.context, request->fence.seqno);
^~~~~~~~~~~~~~~~~~~~
drivers/gpu/drm/i915/i915_gem.h:64:37: note: expanded from macro 'GEM_TRACE'
#define GEM_TRACE(...) trace_printk(__VA_ARGS__)
^~~~~~~~~~~
include/linux/kernel.h:719:26: note: expanded from macro 'trace_printk'
do_trace_printk(fmt, ##__VA_ARGS__); \
~~~ ^~~~~~~~~~~
include/linux/kernel.h:735:36: note: expanded from macro 'do_trace_printk'
__trace_printk(_THIS_IP_, fmt, ##args); \
~~~ ^~~~
drivers/gpu/drm/i915/i915_gem.c:3336:29: error: format specifies type 'int' but the argument has type 'u64' (aka 'unsigned long long') [-Werror,-Wformat]
request->fence.context, request->fence.seqno);
^~~~~~~~~~~~~~~~~~~~
drivers/gpu/drm/i915/i915_gem.h:64:37: note: expanded from macro 'GEM_TRACE'
#define GEM_TRACE(...) trace_printk(__VA_ARGS__)
^~~~~~~~~~~
include/linux/kernel.h:719:26: note: expanded from macro 'trace_printk'
do_trace_printk(fmt, ##__VA_ARGS__); \
~~~ ^~~~~~~~~~~
include/linux/kernel.h:730:37: note: expanded from macro 'do_trace_printk'
__trace_printk_check_format(fmt, ##args); \
~~~ ^~~~
include/linux/kernel.h:682:40: note: expanded from macro '__trace_printk_check_format'
____trace_printk_check_format(fmt, ##args); \
~~~ ^~~~
drivers/gpu/drm/i915/i915_gem.c:3336:29: error: format specifies type 'int' but the argument has type 'u64' (aka 'unsigned long long') [-Werror,-Wformat]
request->fence.context, request->fence.seqno);
^~~~~~~~~~~~~~~~~~~~
drivers/gpu/drm/i915/i915_gem.h:64:37: note: expanded from macro 'GEM_TRACE'
#define GEM_TRACE(...) trace_printk(__VA_ARGS__)
^~~~~~~~~~~
include/linux/kernel.h:719:26: note: expanded from macro 'trace_printk'
do_trace_printk(fmt, ##__VA_ARGS__); \
~~~ ^~~~~~~~~~~
include/linux/kernel.h:735:36: note: expanded from macro 'do_trace_printk'
__trace_printk(_THIS_IP_, fmt, ##args); \
~~~ ^~~~
drivers/gpu/drm/i915/i915_gem.c:3350:2: error: format string is not a string literal (potentially insecure) [-Werror,-Wformat-security]
GEM_TRACE("start\n");
^~~~~~~~~~~~~~~~~~~~
drivers/gpu/drm/i915/i915_gem.h:64:24: note: expanded from macro 'GEM_TRACE'
#define GEM_TRACE(...) trace_printk(__VA_ARGS__)
^~~~~~~~~~~~~~~~~~~~~~~~~
include/linux/kernel.h:719:3: note: expanded from macro 'trace_printk'
do_trace_printk(fmt, ##__VA_ARGS__); \
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
include/linux/kernel.h:733:30: note: expanded from macro 'do_trace_printk'
__trace_bprintk(_THIS_IP_, trace_printk_fmt, ##args); \
^~~~~~~~~~~~~~~~
drivers/gpu/drm/i915/i915_gem.c:3350:2: note: treat the string as an argument to avoid this
drivers/gpu/drm/i915/i915_gem.h:64:24: note: expanded from macro 'GEM_TRACE'
#define GEM_TRACE(...) trace_printk(__VA_ARGS__)
^
include/linux/kernel.h:719:3: note: expanded from macro 'trace_printk'
do_trace_printk(fmt, ##__VA_ARGS__); \
^
include/linux/kernel.h:733:30: note: expanded from macro 'do_trace_printk'
__trace_bprintk(_THIS_IP_, trace_printk_fmt, ##args); \
^
drivers/gpu/drm/i915/i915_gem.c:3421:2: error: format string is not a string literal (potentially insecure) [-Werror,-Wformat-security]
GEM_TRACE("end\n");
^~~~~~~~~~~~~~~~~~
drivers/gpu/drm/i915/i915_gem.h:64:24: note: expanded from macro 'GEM_TRACE'
#define GEM_TRACE(...) trace_printk(__VA_ARGS__)
^~~~~~~~~~~~~~~~~~~~~~~~~
include/linux/kernel.h:719:3: note: expanded from macro 'trace_printk'
do_trace_printk(fmt, ##__VA_ARGS__); \
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
include/linux/kernel.h:733:30: note: expanded from macro 'do_trace_printk'
__trace_bprintk(_THIS_IP_, trace_printk_fmt, ##args); \
^~~~~~~~~~~~~~~~
drivers/gpu/drm/i915/i915_gem.c:3421:2: note: treat the string as an argument to avoid this
vim +3202 drivers/gpu/drm/i915/i915_gem.c
36193acd54bdf1 Mika Kuoppala 2017-01-17 3171
d1d1ebf4120db0 Chris Wilson 2017-07-21 3172 /* Returns the request if it was guilty of the hang */
e61e0f51ba7974 Chris Wilson 2018-02-21 3173 static struct i915_request *
d1d1ebf4120db0 Chris Wilson 2017-07-21 3174 i915_gem_reset_request(struct intel_engine_cs *engine,
bba0869b18e44f Chris Wilson 2018-04-06 3175 struct i915_request *request,
bba0869b18e44f Chris Wilson 2018-04-06 3176 bool stalled)
61da536204ca0d Mika Kuoppala 2017-01-17 3177 {
71895a085879d7 Mika Kuoppala 2017-01-17 3178 /* The guilty request will get skipped on a hung engine.
71895a085879d7 Mika Kuoppala 2017-01-17 3179 *
71895a085879d7 Mika Kuoppala 2017-01-17 3180 * Users of client default contexts do not rely on logical
71895a085879d7 Mika Kuoppala 2017-01-17 3181 * state preserved between batches so it is safe to execute
71895a085879d7 Mika Kuoppala 2017-01-17 3182 * queued requests following the hang. Non default contexts
71895a085879d7 Mika Kuoppala 2017-01-17 3183 * rely on preserved state, so skipping a batch loses the
71895a085879d7 Mika Kuoppala 2017-01-17 3184 * evolution of the state and it needs to be considered corrupted.
71895a085879d7 Mika Kuoppala 2017-01-17 3185 * Executing more queued batches on top of corrupted state is
71895a085879d7 Mika Kuoppala 2017-01-17 3186 * risky. But we take the risk by trying to advance through
71895a085879d7 Mika Kuoppala 2017-01-17 3187 * the queued requests in order to make the client behaviour
71895a085879d7 Mika Kuoppala 2017-01-17 3188 * more predictable around resets, by not throwing away random
71895a085879d7 Mika Kuoppala 2017-01-17 3189 * amount of batches it has prepared for execution. Sophisticated
71895a085879d7 Mika Kuoppala 2017-01-17 3190 * clients can use gem_reset_stats_ioctl and dma fence status
71895a085879d7 Mika Kuoppala 2017-01-17 3191 * (exported via sync_file info ioctl on explicit fences) to observe
71895a085879d7 Mika Kuoppala 2017-01-17 3192 * when it loses the context state and should rebuild accordingly.
71895a085879d7 Mika Kuoppala 2017-01-17 3193 *
71895a085879d7 Mika Kuoppala 2017-01-17 3194 * The context ban, and ultimately the client ban, mechanism are safety
71895a085879d7 Mika Kuoppala 2017-01-17 3195 * valves if client submission ends up resulting in nothing more than
71895a085879d7 Mika Kuoppala 2017-01-17 3196 * subsequent hangs.
71895a085879d7 Mika Kuoppala 2017-01-17 3197 */
71895a085879d7 Mika Kuoppala 2017-01-17 3198
bba0869b18e44f Chris Wilson 2018-04-06 3199 if (i915_request_completed(request)) {
bba0869b18e44f Chris Wilson 2018-04-06 3200 GEM_TRACE("%s pardoned global=%d (fence %llx:%d), current %d\n",
bba0869b18e44f Chris Wilson 2018-04-06 3201 engine->name, request->global_seqno,
bba0869b18e44f Chris Wilson 2018-04-06 @3202 request->fence.context, request->fence.seqno,
bba0869b18e44f Chris Wilson 2018-04-06 3203 intel_engine_get_seqno(engine));
bba0869b18e44f Chris Wilson 2018-04-06 3204 stalled = false;
bba0869b18e44f Chris Wilson 2018-04-06 3205 }
bba0869b18e44f Chris Wilson 2018-04-06 3206
bba0869b18e44f Chris Wilson 2018-04-06 3207 if (stalled) {
4e0d64dba816ad Chris Wilson 2018-05-17 3208 i915_gem_context_mark_guilty(request->gem_context);
6dd7526f6f6c73 Chris Wilson 2018-07-06 3209 i915_request_skip(request, -EIO);
d1d1ebf4120db0 Chris Wilson 2017-07-21 3210
d1d1ebf4120db0 Chris Wilson 2017-07-21 3211 /* If this context is now banned, skip all pending requests. */
4e0d64dba816ad Chris Wilson 2018-05-17 3212 if (i915_gem_context_is_banned(request->gem_context))
d1d1ebf4120db0 Chris Wilson 2017-07-21 3213 engine_skip_context(request);
61da536204ca0d Mika Kuoppala 2017-01-17 3214 } else {
d1d1ebf4120db0 Chris Wilson 2017-07-21 3215 /*
d1d1ebf4120db0 Chris Wilson 2017-07-21 3216 * Since this is not the hung engine, it may have advanced
d1d1ebf4120db0 Chris Wilson 2017-07-21 3217 * since the hang declaration. Double check by refinding
d1d1ebf4120db0 Chris Wilson 2017-07-21 3218 * the active request at the time of the reset.
d1d1ebf4120db0 Chris Wilson 2017-07-21 3219 */
d1d1ebf4120db0 Chris Wilson 2017-07-21 3220 request = i915_gem_find_active_request(engine);
d1d1ebf4120db0 Chris Wilson 2017-07-21 3221 if (request) {
042ed2dbe5b294 Chris Wilson 2018-06-15 3222 unsigned long flags;
042ed2dbe5b294 Chris Wilson 2018-06-15 3223
4e0d64dba816ad Chris Wilson 2018-05-17 3224 i915_gem_context_mark_innocent(request->gem_context);
61da536204ca0d Mika Kuoppala 2017-01-17 3225 dma_fence_set_error(&request->fence, -EAGAIN);
d1d1ebf4120db0 Chris Wilson 2017-07-21 3226
d1d1ebf4120db0 Chris Wilson 2017-07-21 3227 /* Rewind the engine to replay the incomplete rq */
042ed2dbe5b294 Chris Wilson 2018-06-15 3228 spin_lock_irqsave(&engine->timeline.lock, flags);
d1d1ebf4120db0 Chris Wilson 2017-07-21 3229 request = list_prev_entry(request, link);
a89d1f921c1593 Chris Wilson 2018-05-02 3230 if (&request->link == &engine->timeline.requests)
d1d1ebf4120db0 Chris Wilson 2017-07-21 3231 request = NULL;
042ed2dbe5b294 Chris Wilson 2018-06-15 3232 spin_unlock_irqrestore(&engine->timeline.lock, flags);
d1d1ebf4120db0 Chris Wilson 2017-07-21 3233 }
61da536204ca0d Mika Kuoppala 2017-01-17 3234 }
61da536204ca0d Mika Kuoppala 2017-01-17 3235
d1d1ebf4120db0 Chris Wilson 2017-07-21 3236 return request;
61da536204ca0d Mika Kuoppala 2017-01-17 3237 }
61da536204ca0d Mika Kuoppala 2017-01-17 3238
:::::: The code at line 3202 was first introduced by commit
:::::: bba0869b18e44ff2f713c98575ddad8c7c5e9b10 drm/i915: Treat i915_reset_engine() as guilty until proven innocent
:::::: TO: Chris Wilson <chris@xxxxxxxxxxxxxxxxxx>
:::::: CC: Chris Wilson <chris@xxxxxxxxxxxxxxxxxx>
--
0-DAY CI Kernel Test Service
https://01.org/lkp