All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] drm/i915: Silence build error with UBSAN
@ 2018-10-15 20:34 Stephen Boyd
  2018-10-15 21:05 ` ✓ Fi.CI.BAT: success for " Patchwork
                   ` (5 more replies)
  0 siblings, 6 replies; 10+ messages in thread
From: Stephen Boyd @ 2018-10-15 20:34 UTC (permalink / raw)
  To: Jani Nikula, Joonas Lahtinen, Rodrigo Vivi
  Cc: linux-kernel, intel-gfx, dri-devel, Masahiro Yamada,
	Michal Marek, Andrey Ryabinin

When I enable UBSAN and compile this driver with clang I get the
following build error:

drivers/gpu/drm/i915/intel_engine_cs.o: In function `intel_engine_init_execlist':
drivers/gpu/drm/i915/intel_engine_cs.c:411: undefined reference to `__compiletime_assert_411'

from what I can figure out, the compiler can't optimize
execlists_num_ports() sufficiently enough at compile time to figure out
that the 'execlists->port_mask = 1' assignment one line above the
BUILD_BUG_ON_NOT_POWER_OF_2 check will make execlists_num_ports() return
2. Most likely that's because UBSAN is going to check the load inside
execlists_num_ports() and that check isn't omitted so the optimizer
can't optimize away the whole function.

So let's just change this check to cause a build error when the maximum
number of ports isn't a power of two. It looks like this is similar to
what's being checked here so this might work well enough.

Cc: Masahiro Yamada <yamada.masahiro@socionext.com>
Cc: Michal Marek <michal.lkml@markovi.net>
Cc: Andrey Ryabinin <aryabinin@virtuozzo.com>
Signed-off-by: Stephen Boyd <swboyd@chromium.org>
---
 drivers/gpu/drm/i915/intel_engine_cs.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/i915/intel_engine_cs.c b/drivers/gpu/drm/i915/intel_engine_cs.c
index 217ed3ee1cab..bdf75628ed83 100644
--- a/drivers/gpu/drm/i915/intel_engine_cs.c
+++ b/drivers/gpu/drm/i915/intel_engine_cs.c
@@ -463,7 +463,7 @@ static void intel_engine_init_execlist(struct intel_engine_cs *engine)
 	struct intel_engine_execlists * const execlists = &engine->execlists;
 
 	execlists->port_mask = 1;
-	BUILD_BUG_ON_NOT_POWER_OF_2(execlists_num_ports(execlists));
+	BUILD_BUG_ON_NOT_POWER_OF_2(EXECLIST_MAX_PORTS);
 	GEM_BUG_ON(execlists_num_ports(execlists) > EXECLIST_MAX_PORTS);
 
 	execlists->queue_priority = INT_MIN;
-- 
Sent by a computer through tubes


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

* ✓ Fi.CI.BAT: success for drm/i915: Silence build error with UBSAN
  2018-10-15 20:34 [PATCH] drm/i915: Silence build error with UBSAN Stephen Boyd
@ 2018-10-15 21:05 ` Patchwork
  2018-10-16  1:25 ` ✓ Fi.CI.IGT: " Patchwork
                   ` (4 subsequent siblings)
  5 siblings, 0 replies; 10+ messages in thread
From: Patchwork @ 2018-10-15 21:05 UTC (permalink / raw)
  To: Stephen Boyd; +Cc: intel-gfx

== Series Details ==

Series: drm/i915: Silence build error with UBSAN
URL   : https://patchwork.freedesktop.org/series/51025/
State : success

== Summary ==

= CI Bug Log - changes from CI_DRM_4983 -> Patchwork_10462 =

== Summary - SUCCESS ==

  No regressions found.

  External URL: https://patchwork.freedesktop.org/api/1.0/series/51025/revisions/1/mbox/

== Known issues ==

  Here are the changes found in Patchwork_10462 that come from known issues:

  === IGT changes ===

    ==== Issues hit ====

    igt@kms_pipe_crc_basic@nonblocking-crc-pipe-a:
      fi-byt-clapper:     PASS -> FAIL (fdo#107362)

    igt@prime_vgem@basic-fence-flip:
      fi-byt-n2820:       PASS -> FAIL (fdo#104008)

    
    ==== Possible fixes ====

    igt@gem_exec_suspend@basic-s4-devices:
      fi-blb-e6850:       INCOMPLETE (fdo#107718) -> PASS

    igt@kms_pipe_crc_basic@suspend-read-crc-pipe-a:
      fi-byt-clapper:     FAIL (fdo#107362, fdo#103191) -> PASS

    
  fdo#103191 https://bugs.freedesktop.org/show_bug.cgi?id=103191
  fdo#104008 https://bugs.freedesktop.org/show_bug.cgi?id=104008
  fdo#107362 https://bugs.freedesktop.org/show_bug.cgi?id=107362
  fdo#107718 https://bugs.freedesktop.org/show_bug.cgi?id=107718


== Participating hosts (52 -> 47) ==

  Additional (1): fi-kbl-r 
  Missing    (6): fi-ilk-m540 fi-hsw-4200u fi-byt-squawks fi-bsw-cyan fi-apl-guc fi-ctg-p8600 


== Build changes ==

    * Linux: CI_DRM_4983 -> Patchwork_10462

  CI_DRM_4983: dc8a59f4b22474cdc1ba4745d6ceadddbdff376e @ git://anongit.freedesktop.org/gfx-ci/linux
  IGT_4678: 9310a1265ceabeec736bdf0a76e1e0357c76c0b1 @ git://anongit.freedesktop.org/xorg/app/intel-gpu-tools
  Patchwork_10462: 95b8c305ff231405ace85692d0caf12f15c5206b @ git://anongit.freedesktop.org/gfx-ci/linux


== Linux commits ==

95b8c305ff23 drm/i915: Silence build error with UBSAN

== Logs ==

For more details see: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_10462/issues.html
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

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

* ✓ Fi.CI.IGT: success for drm/i915: Silence build error with UBSAN
  2018-10-15 20:34 [PATCH] drm/i915: Silence build error with UBSAN Stephen Boyd
  2018-10-15 21:05 ` ✓ Fi.CI.BAT: success for " Patchwork
@ 2018-10-16  1:25 ` Patchwork
  2018-10-16  9:59 ` [PATCH] " Jani Nikula
                   ` (3 subsequent siblings)
  5 siblings, 0 replies; 10+ messages in thread
From: Patchwork @ 2018-10-16  1:25 UTC (permalink / raw)
  To: Stephen Boyd; +Cc: intel-gfx

== Series Details ==

Series: drm/i915: Silence build error with UBSAN
URL   : https://patchwork.freedesktop.org/series/51025/
State : success

== Summary ==

= CI Bug Log - changes from CI_DRM_4983_full -> Patchwork_10462_full =

== Summary - WARNING ==

  Minor unknown changes coming with Patchwork_10462_full need to be verified
  manually.
  
  If you think the reported changes have nothing to do with the changes
  introduced in Patchwork_10462_full, please notify your bug team to allow them
  to document this new failure mode, which will reduce false positives in CI.

  

== Possible new issues ==

  Here are the unknown changes that may have been introduced in Patchwork_10462_full:

  === IGT changes ===

    ==== Warnings ====

    igt@kms_plane@plane-position-covered-pipe-b-planes:
      shard-snb:          PASS -> SKIP +2

    
== Known issues ==

  Here are the changes found in Patchwork_10462_full that come from known issues:

  === IGT changes ===

    ==== Issues hit ====

    igt@drv_suspend@forcewake:
      shard-snb:          PASS -> DMESG-WARN (fdo#102365)

    igt@gem_exec_schedule@pi-ringfull-bsd:
      shard-skl:          NOTRUN -> FAIL (fdo#103158)

    igt@gem_ppgtt@blt-vs-render-ctx0:
      shard-skl:          NOTRUN -> TIMEOUT (fdo#108039)

    igt@gem_pwrite_pread@uncached-pwrite-blt-gtt_mmap-performance:
      shard-apl:          PASS -> INCOMPLETE (fdo#103927)

    igt@gem_render_tiled_blits@basic:
      shard-kbl:          PASS -> INCOMPLETE (fdo#103665)

    igt@kms_busy@extended-modeset-hang-newfb-with-reset-render-b:
      shard-skl:          NOTRUN -> DMESG-WARN (fdo#107956) +2

    igt@kms_color@pipe-a-legacy-gamma:
      shard-skl:          NOTRUN -> FAIL (fdo#104782, fdo#108145)

    igt@kms_cursor_crc@cursor-128x128-dpms:
      shard-apl:          PASS -> FAIL (fdo#103232)

    igt@kms_cursor_crc@cursor-64x64-sliding:
      shard-skl:          NOTRUN -> FAIL (fdo#103232)

    igt@kms_frontbuffer_tracking@fbc-1p-primscrn-cur-indfb-draw-render:
      shard-apl:          PASS -> FAIL (fdo#103167)

    igt@kms_frontbuffer_tracking@fbc-1p-rte:
      shard-glk:          PASS -> FAIL (fdo#103167, fdo#105682)
      shard-apl:          PASS -> FAIL (fdo#103167, fdo#105682)

    igt@kms_frontbuffer_tracking@psr-1p-primscrn-cur-indfb-draw-mmap-wc:
      shard-skl:          NOTRUN -> FAIL (fdo#103167)

    igt@kms_pipe_crc_basic@hang-read-crc-pipe-a:
      shard-skl:          NOTRUN -> FAIL (fdo#107362, fdo#103191)

    igt@kms_plane_alpha_blend@pipe-a-alpha-7efc:
      shard-skl:          NOTRUN -> FAIL (fdo#108145) +2

    igt@kms_plane_alpha_blend@pipe-c-coverage-7efc:
      shard-skl:          NOTRUN -> FAIL (fdo#108146) +2

    igt@kms_setmode@basic:
      shard-kbl:          PASS -> FAIL (fdo#99912)

    
    ==== Possible fixes ====

    igt@drv_suspend@debugfs-reader:
      shard-skl:          INCOMPLETE (fdo#104108) -> PASS

    igt@gem_wait@busy-default:
      shard-snb:          INCOMPLETE (fdo#105411) -> PASS

    igt@kms_cursor_legacy@cursorb-vs-flipb-toggle:
      shard-glk:          DMESG-WARN (fdo#105763, fdo#106538) -> PASS

    igt@kms_frontbuffer_tracking@fbc-1p-primscrn-spr-indfb-draw-mmap-gtt:
      shard-apl:          FAIL (fdo#103167) -> PASS +2

    igt@kms_plane_multiple@atomic-pipe-c-tiling-yf:
      shard-apl:          FAIL (fdo#103166) -> PASS +2

    
  fdo#102365 https://bugs.freedesktop.org/show_bug.cgi?id=102365
  fdo#103158 https://bugs.freedesktop.org/show_bug.cgi?id=103158
  fdo#103166 https://bugs.freedesktop.org/show_bug.cgi?id=103166
  fdo#103167 https://bugs.freedesktop.org/show_bug.cgi?id=103167
  fdo#103191 https://bugs.freedesktop.org/show_bug.cgi?id=103191
  fdo#103232 https://bugs.freedesktop.org/show_bug.cgi?id=103232
  fdo#103665 https://bugs.freedesktop.org/show_bug.cgi?id=103665
  fdo#103927 https://bugs.freedesktop.org/show_bug.cgi?id=103927
  fdo#104108 https://bugs.freedesktop.org/show_bug.cgi?id=104108
  fdo#104782 https://bugs.freedesktop.org/show_bug.cgi?id=104782
  fdo#105411 https://bugs.freedesktop.org/show_bug.cgi?id=105411
  fdo#105682 https://bugs.freedesktop.org/show_bug.cgi?id=105682
  fdo#105763 https://bugs.freedesktop.org/show_bug.cgi?id=105763
  fdo#106538 https://bugs.freedesktop.org/show_bug.cgi?id=106538
  fdo#107362 https://bugs.freedesktop.org/show_bug.cgi?id=107362
  fdo#107956 https://bugs.freedesktop.org/show_bug.cgi?id=107956
  fdo#108039 https://bugs.freedesktop.org/show_bug.cgi?id=108039
  fdo#108145 https://bugs.freedesktop.org/show_bug.cgi?id=108145
  fdo#108146 https://bugs.freedesktop.org/show_bug.cgi?id=108146
  fdo#99912 https://bugs.freedesktop.org/show_bug.cgi?id=99912


== Participating hosts (6 -> 6) ==

  No changes in participating hosts


== Build changes ==

    * Linux: CI_DRM_4983 -> Patchwork_10462

  CI_DRM_4983: dc8a59f4b22474cdc1ba4745d6ceadddbdff376e @ git://anongit.freedesktop.org/gfx-ci/linux
  IGT_4678: 9310a1265ceabeec736bdf0a76e1e0357c76c0b1 @ git://anongit.freedesktop.org/xorg/app/intel-gpu-tools
  Patchwork_10462: 95b8c305ff231405ace85692d0caf12f15c5206b @ git://anongit.freedesktop.org/gfx-ci/linux
  piglit_4509: fdc5a4ca11124ab8413c7988896eec4c97336694 @ git://anongit.freedesktop.org/piglit

== Logs ==

For more details see: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_10462/shards.html
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

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

* Re: [PATCH] drm/i915: Silence build error with UBSAN
  2018-10-15 20:34 [PATCH] drm/i915: Silence build error with UBSAN Stephen Boyd
  2018-10-15 21:05 ` ✓ Fi.CI.BAT: success for " Patchwork
  2018-10-16  1:25 ` ✓ Fi.CI.IGT: " Patchwork
@ 2018-10-16  9:59 ` Jani Nikula
  2018-10-16 10:07     ` Chris Wilson
  2018-10-16 10:33 ` ✗ Fi.CI.CHECKPATCH: warning for drm/i915: Silence build error with UBSAN (rev2) Patchwork
                   ` (2 subsequent siblings)
  5 siblings, 1 reply; 10+ messages in thread
From: Jani Nikula @ 2018-10-16  9:59 UTC (permalink / raw)
  To: Stephen Boyd, Joonas Lahtinen, Rodrigo Vivi
  Cc: linux-kernel, intel-gfx, dri-devel, Masahiro Yamada,
	Michal Marek, Andrey Ryabinin

On Mon, 15 Oct 2018, Stephen Boyd <swboyd@chromium.org> wrote:
> When I enable UBSAN and compile this driver with clang I get the
> following build error:
>
> drivers/gpu/drm/i915/intel_engine_cs.o: In function `intel_engine_init_execlist':
> drivers/gpu/drm/i915/intel_engine_cs.c:411: undefined reference to `__compiletime_assert_411'
>
> from what I can figure out, the compiler can't optimize
> execlists_num_ports() sufficiently enough at compile time to figure out
> that the 'execlists->port_mask = 1' assignment one line above the
> BUILD_BUG_ON_NOT_POWER_OF_2 check will make execlists_num_ports() return
> 2. Most likely that's because UBSAN is going to check the load inside
> execlists_num_ports() and that check isn't omitted so the optimizer
> can't optimize away the whole function.

See [1] for a better explanation.

[1] http://mid.mail-archive.com/20181009171401.14980-1-natechancellor@gmail.com

> So let's just change this check to cause a build error when the maximum
> number of ports isn't a power of two. It looks like this is similar to
> what's being checked here so this might work well enough.

That's not the same thing. I guess I'd go with the below instead,
similar to the check on the next line. I guess both of the checks could
be static on gcc.

BR,
Jani.


diff --git a/drivers/gpu/drm/i915/intel_engine_cs.c b/drivers/gpu/drm/i915/intel_engine_cs.c
index f27dbe26bcc1..897d5a557d88 100644
--- a/drivers/gpu/drm/i915/intel_engine_cs.c
+++ b/drivers/gpu/drm/i915/intel_engine_cs.c
@@ -461,12 +461,14 @@ static void intel_engine_init_batch_pool(struct intel_engine_cs *engine)
 	i915_gem_batch_pool_init(&engine->batch_pool, engine);
 }
 
+#define IS_POWER_OF_2(n) ((n) != 0 && ((n) & ((n) - 1)) == 0)
+
 static void intel_engine_init_execlist(struct intel_engine_cs *engine)
 {
 	struct intel_engine_execlists * const execlists = &engine->execlists;
 
 	execlists->port_mask = 1;
-	BUILD_BUG_ON_NOT_POWER_OF_2(execlists_num_ports(execlists));
+	GEM_BUG_ON(!IS_POWER_OF_2(execlists_num_ports(execlists)));
 	GEM_BUG_ON(execlists_num_ports(execlists) > EXECLIST_MAX_PORTS);
 
 	execlists->queue_priority = INT_MIN;

---


>
> Cc: Masahiro Yamada <yamada.masahiro@socionext.com>
> Cc: Michal Marek <michal.lkml@markovi.net>
> Cc: Andrey Ryabinin <aryabinin@virtuozzo.com>
> Signed-off-by: Stephen Boyd <swboyd@chromium.org>
> ---
>  drivers/gpu/drm/i915/intel_engine_cs.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/gpu/drm/i915/intel_engine_cs.c b/drivers/gpu/drm/i915/intel_engine_cs.c
> index 217ed3ee1cab..bdf75628ed83 100644
> --- a/drivers/gpu/drm/i915/intel_engine_cs.c
> +++ b/drivers/gpu/drm/i915/intel_engine_cs.c
> @@ -463,7 +463,7 @@ static void intel_engine_init_execlist(struct intel_engine_cs *engine)
>  	struct intel_engine_execlists * const execlists = &engine->execlists;
>  
>  	execlists->port_mask = 1;
> -	BUILD_BUG_ON_NOT_POWER_OF_2(execlists_num_ports(execlists));
> +	BUILD_BUG_ON_NOT_POWER_OF_2(EXECLIST_MAX_PORTS);
>  	GEM_BUG_ON(execlists_num_ports(execlists) > EXECLIST_MAX_PORTS);
>  
>  	execlists->queue_priority = INT_MIN;

-- 
Jani Nikula, Intel Open Source Graphics Center

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

* Re: [PATCH] drm/i915: Silence build error with UBSAN
  2018-10-16  9:59 ` [PATCH] " Jani Nikula
@ 2018-10-16 10:07     ` Chris Wilson
  0 siblings, 0 replies; 10+ messages in thread
From: Chris Wilson @ 2018-10-16 10:07 UTC (permalink / raw)
  To: Jani Nikula, Joonas Lahtinen, Rodrigo Vivi, Stephen Boyd
  Cc: Michal Marek, intel-gfx, linux-kernel, dri-devel,
	Masahiro Yamada, Andrey Ryabinin

Quoting Jani Nikula (2018-10-16 10:59:42)
> On Mon, 15 Oct 2018, Stephen Boyd <swboyd@chromium.org> wrote:
> > When I enable UBSAN and compile this driver with clang I get the
> > following build error:
> >
> > drivers/gpu/drm/i915/intel_engine_cs.o: In function `intel_engine_init_execlist':
> > drivers/gpu/drm/i915/intel_engine_cs.c:411: undefined reference to `__compiletime_assert_411'
> >
> > from what I can figure out, the compiler can't optimize
> > execlists_num_ports() sufficiently enough at compile time to figure out
> > that the 'execlists->port_mask = 1' assignment one line above the
> > BUILD_BUG_ON_NOT_POWER_OF_2 check will make execlists_num_ports() return
> > 2. Most likely that's because UBSAN is going to check the load inside
> > execlists_num_ports() and that check isn't omitted so the optimizer
> > can't optimize away the whole function.
> 
> See [1] for a better explanation.
> 
> [1] http://mid.mail-archive.com/20181009171401.14980-1-natechancellor@gmail.com
> 
> > So let's just change this check to cause a build error when the maximum
> > number of ports isn't a power of two. It looks like this is similar to
> > what's being checked here so this might work well enough.
> 
> That's not the same thing. I guess I'd go with the below instead,
> similar to the check on the next line. I guess both of the checks could
> be static on gcc.
> 
> BR,
> Jani.
> 
> 
> diff --git a/drivers/gpu/drm/i915/intel_engine_cs.c b/drivers/gpu/drm/i915/intel_engine_cs.c
> index f27dbe26bcc1..897d5a557d88 100644
> --- a/drivers/gpu/drm/i915/intel_engine_cs.c
> +++ b/drivers/gpu/drm/i915/intel_engine_cs.c
> @@ -461,12 +461,14 @@ static void intel_engine_init_batch_pool(struct intel_engine_cs *engine)
>         i915_gem_batch_pool_init(&engine->batch_pool, engine);
>  }
>  
> +#define IS_POWER_OF_2(n) ((n) != 0 && ((n) & ((n) - 1)) == 0)
> +
>  static void intel_engine_init_execlist(struct intel_engine_cs *engine)
>  {
>         struct intel_engine_execlists * const execlists = &engine->execlists;
>  
>         execlists->port_mask = 1;
> -       BUILD_BUG_ON_NOT_POWER_OF_2(execlists_num_ports(execlists));
> +       GEM_BUG_ON(!IS_POWER_OF_2(execlists_num_ports(execlists)));

That should be happy with is_power_of_2() from log2.h
-Chris

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

* Re: [PATCH] drm/i915: Silence build error with UBSAN
@ 2018-10-16 10:07     ` Chris Wilson
  0 siblings, 0 replies; 10+ messages in thread
From: Chris Wilson @ 2018-10-16 10:07 UTC (permalink / raw)
  To: Jani Nikula, Joonas Lahtinen, Rodrigo Vivi, Stephen Boyd
  Cc: Michal Marek, intel-gfx, linux-kernel, dri-devel,
	Masahiro Yamada, Andrey Ryabinin

Quoting Jani Nikula (2018-10-16 10:59:42)
> On Mon, 15 Oct 2018, Stephen Boyd <swboyd@chromium.org> wrote:
> > When I enable UBSAN and compile this driver with clang I get the
> > following build error:
> >
> > drivers/gpu/drm/i915/intel_engine_cs.o: In function `intel_engine_init_execlist':
> > drivers/gpu/drm/i915/intel_engine_cs.c:411: undefined reference to `__compiletime_assert_411'
> >
> > from what I can figure out, the compiler can't optimize
> > execlists_num_ports() sufficiently enough at compile time to figure out
> > that the 'execlists->port_mask = 1' assignment one line above the
> > BUILD_BUG_ON_NOT_POWER_OF_2 check will make execlists_num_ports() return
> > 2. Most likely that's because UBSAN is going to check the load inside
> > execlists_num_ports() and that check isn't omitted so the optimizer
> > can't optimize away the whole function.
> 
> See [1] for a better explanation.
> 
> [1] http://mid.mail-archive.com/20181009171401.14980-1-natechancellor@gmail.com
> 
> > So let's just change this check to cause a build error when the maximum
> > number of ports isn't a power of two. It looks like this is similar to
> > what's being checked here so this might work well enough.
> 
> That's not the same thing. I guess I'd go with the below instead,
> similar to the check on the next line. I guess both of the checks could
> be static on gcc.
> 
> BR,
> Jani.
> 
> 
> diff --git a/drivers/gpu/drm/i915/intel_engine_cs.c b/drivers/gpu/drm/i915/intel_engine_cs.c
> index f27dbe26bcc1..897d5a557d88 100644
> --- a/drivers/gpu/drm/i915/intel_engine_cs.c
> +++ b/drivers/gpu/drm/i915/intel_engine_cs.c
> @@ -461,12 +461,14 @@ static void intel_engine_init_batch_pool(struct intel_engine_cs *engine)
>         i915_gem_batch_pool_init(&engine->batch_pool, engine);
>  }
>  
> +#define IS_POWER_OF_2(n) ((n) != 0 && ((n) & ((n) - 1)) == 0)
> +
>  static void intel_engine_init_execlist(struct intel_engine_cs *engine)
>  {
>         struct intel_engine_execlists * const execlists = &engine->execlists;
>  
>         execlists->port_mask = 1;
> -       BUILD_BUG_ON_NOT_POWER_OF_2(execlists_num_ports(execlists));
> +       GEM_BUG_ON(!IS_POWER_OF_2(execlists_num_ports(execlists)));

That should be happy with is_power_of_2() from log2.h
-Chris
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

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

* ✗ Fi.CI.CHECKPATCH: warning for drm/i915: Silence build error with UBSAN (rev2)
  2018-10-15 20:34 [PATCH] drm/i915: Silence build error with UBSAN Stephen Boyd
                   ` (2 preceding siblings ...)
  2018-10-16  9:59 ` [PATCH] " Jani Nikula
@ 2018-10-16 10:33 ` Patchwork
  2018-10-16 10:50 ` ✓ Fi.CI.BAT: success " Patchwork
  2018-10-16 11:43 ` ✓ Fi.CI.IGT: " Patchwork
  5 siblings, 0 replies; 10+ messages in thread
From: Patchwork @ 2018-10-16 10:33 UTC (permalink / raw)
  To: Jani Nikula; +Cc: intel-gfx

== Series Details ==

Series: drm/i915: Silence build error with UBSAN (rev2)
URL   : https://patchwork.freedesktop.org/series/51025/
State : warning

== Summary ==

$ dim checkpatch origin/drm-tip
8d9d30d99fd4 drm/i915: Silence build error with UBSAN
-:10: WARNING:COMMIT_LOG_LONG_LINE: Possible unwrapped commit description (prefer a maximum 75 chars per line)
#10: 
> drivers/gpu/drm/i915/intel_engine_cs.o: In function `intel_engine_init_execlist':

-:44: CHECK:MACRO_ARG_REUSE: Macro argument reuse 'n' - possible side-effects?
#44: FILE: drivers/gpu/drm/i915/intel_engine_cs.c:464:
+#define IS_POWER_OF_2(n) ((n) != 0 && ((n) & ((n) - 1)) == 0)

-:55: ERROR:MISSING_SIGN_OFF: Missing Signed-off-by: line(s)

total: 1 errors, 1 warnings, 1 checks, 15 lines checked

_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

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

* ✓ Fi.CI.BAT: success for drm/i915: Silence build error with UBSAN (rev2)
  2018-10-15 20:34 [PATCH] drm/i915: Silence build error with UBSAN Stephen Boyd
                   ` (3 preceding siblings ...)
  2018-10-16 10:33 ` ✗ Fi.CI.CHECKPATCH: warning for drm/i915: Silence build error with UBSAN (rev2) Patchwork
@ 2018-10-16 10:50 ` Patchwork
  2018-10-16 11:43 ` ✓ Fi.CI.IGT: " Patchwork
  5 siblings, 0 replies; 10+ messages in thread
From: Patchwork @ 2018-10-16 10:50 UTC (permalink / raw)
  To: Jani Nikula; +Cc: intel-gfx

== Series Details ==

Series: drm/i915: Silence build error with UBSAN (rev2)
URL   : https://patchwork.freedesktop.org/series/51025/
State : success

== Summary ==

= CI Bug Log - changes from CI_DRM_4984 -> Patchwork_10470 =

== Summary - SUCCESS ==

  No regressions found.

  External URL: https://patchwork.freedesktop.org/api/1.0/series/51025/revisions/2/mbox/

== Known issues ==

  Here are the changes found in Patchwork_10470 that come from known issues:

  === IGT changes ===

    ==== Issues hit ====

    igt@drv_module_reload@basic-reload:
      fi-glk-j4005:       PASS -> DMESG-WARN (fdo#106248, fdo#106725)

    igt@drv_module_reload@basic-reload-inject:
      fi-glk-j4005:       PASS -> DMESG-WARN (fdo#106097, fdo#106000)

    igt@pm_rpm@module-reload:
      fi-glk-j4005:       PASS -> DMESG-WARN (fdo#107726)

    
    ==== Possible fixes ====

    igt@kms_frontbuffer_tracking@basic:
      fi-byt-clapper:     FAIL (fdo#103167) -> PASS

    igt@kms_pipe_crc_basic@suspend-read-crc-pipe-b:
      fi-blb-e6850:       INCOMPLETE (fdo#107718) -> PASS

    
  fdo#103167 https://bugs.freedesktop.org/show_bug.cgi?id=103167
  fdo#106000 https://bugs.freedesktop.org/show_bug.cgi?id=106000
  fdo#106097 https://bugs.freedesktop.org/show_bug.cgi?id=106097
  fdo#106248 https://bugs.freedesktop.org/show_bug.cgi?id=106248
  fdo#106725 https://bugs.freedesktop.org/show_bug.cgi?id=106725
  fdo#107718 https://bugs.freedesktop.org/show_bug.cgi?id=107718
  fdo#107726 https://bugs.freedesktop.org/show_bug.cgi?id=107726


== Participating hosts (53 -> 43) ==

  Missing    (10): fi-ilk-m540 fi-hsw-4200u fi-bdw-gvtdvm fi-glk-dsi fi-byt-squawks fi-bsw-cyan fi-ctg-p8600 fi-pnv-d510 fi-ivb-3520m fi-byt-n2820 


== Build changes ==

    * Linux: CI_DRM_4984 -> Patchwork_10470

  CI_DRM_4984: 90b59df999a13a6405f8d7ece08a69120a9b361a @ git://anongit.freedesktop.org/gfx-ci/linux
  IGT_4678: 9310a1265ceabeec736bdf0a76e1e0357c76c0b1 @ git://anongit.freedesktop.org/xorg/app/intel-gpu-tools
  Patchwork_10470: 8d9d30d99fd4f017570c555517445933642f4e17 @ git://anongit.freedesktop.org/gfx-ci/linux


== Linux commits ==

8d9d30d99fd4 drm/i915: Silence build error with UBSAN

== Logs ==

For more details see: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_10470/issues.html
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

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

* ✓ Fi.CI.IGT: success for drm/i915: Silence build error with UBSAN (rev2)
  2018-10-15 20:34 [PATCH] drm/i915: Silence build error with UBSAN Stephen Boyd
                   ` (4 preceding siblings ...)
  2018-10-16 10:50 ` ✓ Fi.CI.BAT: success " Patchwork
@ 2018-10-16 11:43 ` Patchwork
  5 siblings, 0 replies; 10+ messages in thread
From: Patchwork @ 2018-10-16 11:43 UTC (permalink / raw)
  To: Jani Nikula; +Cc: intel-gfx

== Series Details ==

Series: drm/i915: Silence build error with UBSAN (rev2)
URL   : https://patchwork.freedesktop.org/series/51025/
State : success

== Summary ==

= CI Bug Log - changes from CI_DRM_4984_full -> Patchwork_10470_full =

== Summary - WARNING ==

  Minor unknown changes coming with Patchwork_10470_full need to be verified
  manually.
  
  If you think the reported changes have nothing to do with the changes
  introduced in Patchwork_10470_full, please notify your bug team to allow them
  to document this new failure mode, which will reduce false positives in CI.

  

== Possible new issues ==

  Here are the unknown changes that may have been introduced in Patchwork_10470_full:

  === IGT changes ===

    ==== Warnings ====

    igt@kms_frontbuffer_tracking@fbc-1p-primscrn-spr-indfb-move:
      shard-snb:          PASS -> SKIP +1

    
== Known issues ==

  Here are the changes found in Patchwork_10470_full that come from known issues:

  === IGT changes ===

    ==== Issues hit ====

    igt@drv_suspend@shrink:
      shard-skl:          PASS -> INCOMPLETE (fdo#106886)

    igt@gem_cpu_reloc@full:
      shard-skl:          NOTRUN -> INCOMPLETE (fdo#108073)

    igt@gem_exec_schedule@pi-ringfull-vebox:
      shard-skl:          NOTRUN -> FAIL (fdo#103158)

    igt@gem_ppgtt@blt-vs-render-ctxn:
      shard-skl:          NOTRUN -> TIMEOUT (fdo#108039)

    igt@kms_busy@extended-modeset-hang-newfb-with-reset-render-a:
      shard-skl:          NOTRUN -> DMESG-WARN (fdo#107956)

    igt@kms_ccs@pipe-a-crc-sprite-planes-basic:
      shard-skl:          NOTRUN -> FAIL (fdo#105458)

    igt@kms_cursor_crc@cursor-256x256-dpms:
      shard-apl:          PASS -> FAIL (fdo#103232) +1

    igt@kms_draw_crc@fill-fb:
      shard-skl:          NOTRUN -> FAIL (fdo#103184)

    igt@kms_frontbuffer_tracking@fbc-1p-primscrn-spr-indfb-draw-render:
      shard-apl:          PASS -> FAIL (fdo#103167) +1

    igt@kms_frontbuffer_tracking@fbcpsr-1p-primscrn-spr-indfb-fullscreen:
      shard-skl:          NOTRUN -> FAIL (fdo#105682)

    igt@kms_frontbuffer_tracking@fbcpsr-stridechange:
      shard-skl:          NOTRUN -> FAIL (fdo#105683)

    igt@kms_panel_fitting@legacy:
      shard-skl:          NOTRUN -> FAIL (fdo#105456)

    igt@kms_plane@pixel-format-pipe-a-planes:
      shard-skl:          NOTRUN -> DMESG-FAIL (fdo#103166, fdo#106885)

    igt@kms_plane@plane-position-covered-pipe-b-planes:
      shard-glk:          PASS -> FAIL (fdo#103166)

    igt@kms_plane_alpha_blend@pipe-a-alpha-opaque-fb:
      shard-apl:          PASS -> FAIL (fdo#108145)

    igt@kms_plane_alpha_blend@pipe-a-alpha-transparant-fb:
      shard-skl:          NOTRUN -> FAIL (fdo#108145) +3

    igt@kms_plane_alpha_blend@pipe-c-constant-alpha-max:
      shard-glk:          PASS -> FAIL (fdo#108145)

    igt@kms_plane_multiple@atomic-pipe-a-tiling-yf:
      shard-apl:          PASS -> FAIL (fdo#103166) +1

    igt@kms_rotation_crc@exhaust-fences:
      shard-skl:          NOTRUN -> DMESG-WARN (fdo#105748)

    igt@kms_setmode@basic:
      shard-kbl:          PASS -> FAIL (fdo#99912)

    igt@kms_sysfs_edid_timing:
      shard-skl:          NOTRUN -> FAIL (fdo#100047)

    igt@kms_vblank@pipe-c-wait-idle:
      shard-kbl:          PASS -> DMESG-WARN (fdo#105602, fdo#103558) +2

    
    ==== Possible fixes ====

    igt@kms_cursor_crc@cursor-256x256-random:
      shard-glk:          FAIL (fdo#103232) -> PASS

    igt@kms_flip_tiling@flip-yf-tiled:
      shard-apl:          DMESG-WARN (fdo#105602, fdo#103558) -> PASS +2

    igt@kms_frontbuffer_tracking@fbc-1p-primscrn-spr-indfb-draw-blt:
      shard-apl:          FAIL (fdo#103167) -> PASS

    igt@kms_frontbuffer_tracking@fbc-1p-primscrn-spr-indfb-draw-mmap-wc:
      shard-glk:          FAIL (fdo#103167) -> PASS +1

    igt@kms_frontbuffer_tracking@fbc-1p-rte:
      shard-apl:          DMESG-FAIL (fdo#105602, fdo#103167, fdo#103558) -> PASS

    igt@kms_plane@plane-panning-bottom-right-suspend-pipe-c-planes:
      shard-skl:          INCOMPLETE (fdo#104108) -> PASS

    igt@kms_plane_lowres@pipe-a-tiling-yf:
      shard-kbl:          DMESG-WARN (fdo#105345) -> PASS

    igt@kms_plane_multiple@atomic-pipe-c-tiling-y:
      shard-glk:          FAIL (fdo#103166) -> PASS +1

    igt@kms_plane_multiple@atomic-pipe-c-tiling-yf:
      shard-apl:          FAIL (fdo#103166) -> PASS +2

    igt@kms_setmode@basic:
      shard-apl:          FAIL (fdo#99912) -> PASS

    
  fdo#100047 https://bugs.freedesktop.org/show_bug.cgi?id=100047
  fdo#103158 https://bugs.freedesktop.org/show_bug.cgi?id=103158
  fdo#103166 https://bugs.freedesktop.org/show_bug.cgi?id=103166
  fdo#103167 https://bugs.freedesktop.org/show_bug.cgi?id=103167
  fdo#103184 https://bugs.freedesktop.org/show_bug.cgi?id=103184
  fdo#103232 https://bugs.freedesktop.org/show_bug.cgi?id=103232
  fdo#103558 https://bugs.freedesktop.org/show_bug.cgi?id=103558
  fdo#104108 https://bugs.freedesktop.org/show_bug.cgi?id=104108
  fdo#105345 https://bugs.freedesktop.org/show_bug.cgi?id=105345
  fdo#105456 https://bugs.freedesktop.org/show_bug.cgi?id=105456
  fdo#105458 https://bugs.freedesktop.org/show_bug.cgi?id=105458
  fdo#105602 https://bugs.freedesktop.org/show_bug.cgi?id=105602
  fdo#105682 https://bugs.freedesktop.org/show_bug.cgi?id=105682
  fdo#105683 https://bugs.freedesktop.org/show_bug.cgi?id=105683
  fdo#105748 https://bugs.freedesktop.org/show_bug.cgi?id=105748
  fdo#106885 https://bugs.freedesktop.org/show_bug.cgi?id=106885
  fdo#106886 https://bugs.freedesktop.org/show_bug.cgi?id=106886
  fdo#107956 https://bugs.freedesktop.org/show_bug.cgi?id=107956
  fdo#108039 https://bugs.freedesktop.org/show_bug.cgi?id=108039
  fdo#108073 https://bugs.freedesktop.org/show_bug.cgi?id=108073
  fdo#108145 https://bugs.freedesktop.org/show_bug.cgi?id=108145
  fdo#99912 https://bugs.freedesktop.org/show_bug.cgi?id=99912


== Participating hosts (6 -> 6) ==

  No changes in participating hosts


== Build changes ==

    * Linux: CI_DRM_4984 -> Patchwork_10470

  CI_DRM_4984: 90b59df999a13a6405f8d7ece08a69120a9b361a @ git://anongit.freedesktop.org/gfx-ci/linux
  IGT_4678: 9310a1265ceabeec736bdf0a76e1e0357c76c0b1 @ git://anongit.freedesktop.org/xorg/app/intel-gpu-tools
  Patchwork_10470: 8d9d30d99fd4f017570c555517445933642f4e17 @ git://anongit.freedesktop.org/gfx-ci/linux
  piglit_4509: fdc5a4ca11124ab8413c7988896eec4c97336694 @ git://anongit.freedesktop.org/piglit

== Logs ==

For more details see: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_10470/shards.html
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

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

* Re: [PATCH] drm/i915: Silence build error with UBSAN
  2018-10-16 10:07     ` Chris Wilson
  (?)
@ 2018-10-16 11:48     ` Jani Nikula
  -1 siblings, 0 replies; 10+ messages in thread
From: Jani Nikula @ 2018-10-16 11:48 UTC (permalink / raw)
  To: Chris Wilson, Joonas Lahtinen, Rodrigo Vivi, Stephen Boyd
  Cc: Michal Marek, intel-gfx, linux-kernel, dri-devel,
	Masahiro Yamada, Andrey Ryabinin

On Tue, 16 Oct 2018, Chris Wilson <chris@chris-wilson.co.uk> wrote:
> Quoting Jani Nikula (2018-10-16 10:59:42)
>> diff --git a/drivers/gpu/drm/i915/intel_engine_cs.c b/drivers/gpu/drm/i915/intel_engine_cs.c
>> index f27dbe26bcc1..897d5a557d88 100644
>> --- a/drivers/gpu/drm/i915/intel_engine_cs.c
>> +++ b/drivers/gpu/drm/i915/intel_engine_cs.c
>> @@ -461,12 +461,14 @@ static void intel_engine_init_batch_pool(struct intel_engine_cs *engine)
>>         i915_gem_batch_pool_init(&engine->batch_pool, engine);
>>  }
>>  
>> +#define IS_POWER_OF_2(n) ((n) != 0 && ((n) & ((n) - 1)) == 0)
>> +
>>  static void intel_engine_init_execlist(struct intel_engine_cs *engine)
>>  {
>>         struct intel_engine_execlists * const execlists = &engine->execlists;
>>  
>>         execlists->port_mask = 1;
>> -       BUILD_BUG_ON_NOT_POWER_OF_2(execlists_num_ports(execlists));
>> +       GEM_BUG_ON(!IS_POWER_OF_2(execlists_num_ports(execlists)));
>
> That should be happy with is_power_of_2() from log2.h

D'oh. Thanks. I was sure there was one, I looked for it, but my git
greps were all upper case. :/

I'll spin a new version, along with the other clang build fix.

BR,
Jani.


-- 
Jani Nikula, Intel Open Source Graphics Center

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

end of thread, other threads:[~2018-10-16 11:48 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-10-15 20:34 [PATCH] drm/i915: Silence build error with UBSAN Stephen Boyd
2018-10-15 21:05 ` ✓ Fi.CI.BAT: success for " Patchwork
2018-10-16  1:25 ` ✓ Fi.CI.IGT: " Patchwork
2018-10-16  9:59 ` [PATCH] " Jani Nikula
2018-10-16 10:07   ` Chris Wilson
2018-10-16 10:07     ` Chris Wilson
2018-10-16 11:48     ` Jani Nikula
2018-10-16 10:33 ` ✗ Fi.CI.CHECKPATCH: warning for drm/i915: Silence build error with UBSAN (rev2) Patchwork
2018-10-16 10:50 ` ✓ Fi.CI.BAT: success " Patchwork
2018-10-16 11:43 ` ✓ Fi.CI.IGT: " Patchwork

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.