All of lore.kernel.org
 help / color / mirror / Atom feed
From: Nick Desaulniers <ndesaulniers@google.com>
To: jose.souza@intel.com
Cc: clang-built-linux@googlegroups.com,
	intel-gfx@lists.freedesktop.org, bot@kernelci.org
Subject: Re: [Intel-gfx] [PATCH 2/2] drm/i915/tgl: Move and restrict Wa_1408615072
Date: Thu,  5 Mar 2020 11:08:11 -0800	[thread overview]
Message-ID: <20200305190811.3009-1-ndesaulniers@google.com> (raw)
In-Reply-To: <d5d0609ac6a81f940d91bf93a11506b0af0ce631.camel@intel.com>

Hello Jose,
So this is triggering a very subtle bug in 2 separate CI systems:
- KernelCI: https://storage.kernelci.org/next/master/next-20200305/x86_64/x86_64_defconfig/clang-9/build.log
- our CI: https://travis-ci.com/ClangBuiltLinux/continuous-integration/jobs/293826383

commit 50148a2 ("drm/i915/tgl: Move and restrict Wa_1408615072")

for Clang builds.  It seems that Clang is inlining `wa_masked_en` into
`rcs_engine_wa_init`, which has implications for `__builtin_constant_p`
evaluation.

The relevant call chain looks like:

rcs_engine_wa_init (drivers/gpu/drm/i915/gt/intel_workarounds.c) ->
  wa_masked_en (drivers/gpu/drm/i915/gt/intel_workarounds.c) ->
    _MASKED_BIT_ENABLE (drivers/gpu/drm/i915/i915_reg.h) ->
      _MASKED_FIELD (drivers/gpu/drm/i915/i915_reg.h)

So it looks like there's build time validation that the masks and values have
their bottom 2 bytes unset (mask & 0xffff0000, little endian).  (There doesn't
seem to be equivalent runtime checks that the masks & values obey this
invariant when they're not "integer constant expressions").

This will break should GCC ever decide to inline `wa_masked_en` into
`rcs_engine_wa_init`.

VSUNIT_CLKGATE_DIS_TGL is defined as `REG_BIT(19)` which evaluates to
0x00080000, which would fail the check against
0xffff0000.

Can you please validate that VSUNIT_CLKGATE_DIS_TGL has the correct value, or
if the invariant that the bottom two bytes of values passed to
`_MASKED_BIT_ENABLE` must be set?

I would expect one of those two to be incorrect.

Link: https://github.com/ClangBuiltLinux/linux/issues/918
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

  reply	other threads:[~2020-03-05 19:08 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-03-02 23:14 [Intel-gfx] [PATCH 1/2] drm/i915/gen11: Moving WAs to rcs_engine_wa_init() José Roberto de Souza
2020-03-02 23:14 ` [Intel-gfx] [PATCH 2/2] drm/i915/tgl: Move and restrict Wa_1408615072 José Roberto de Souza
2020-03-03 20:21   ` Matt Roper
2020-03-03 21:34     ` Souza, Jose
2020-03-05 19:08       ` Nick Desaulniers [this message]
2020-03-05 19:15         ` Nick Desaulniers
2020-03-03  0:20 ` [Intel-gfx] ✗ Fi.CI.DOCS: warning for series starting with [1/2] drm/i915/gen11: Moving WAs to rcs_engine_wa_init() Patchwork
2020-03-03  0:31 ` [Intel-gfx] ✓ Fi.CI.BAT: success " Patchwork
2020-03-03 13:36 ` [Intel-gfx] ✓ Fi.CI.IGT: " Patchwork
2020-03-03 20:19 ` [Intel-gfx] [PATCH 1/2] " Matt Roper

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20200305190811.3009-1-ndesaulniers@google.com \
    --to=ndesaulniers@google.com \
    --cc=bot@kernelci.org \
    --cc=clang-built-linux@googlegroups.com \
    --cc=intel-gfx@lists.freedesktop.org \
    --cc=jose.souza@intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.