public inbox for intel-xe@lists.freedesktop.org
 help / color / mirror / Atom feed
* [PATCH 00/12] Fix MCR inconsistencies in RTP tables
@ 2026-01-16 22:12 Gustavo Sousa
  2026-01-16 22:12 ` [PATCH 01/12] drm/xe: Define CACHE_MODE_1 as MCR register Gustavo Sousa
                   ` (13 more replies)
  0 siblings, 14 replies; 30+ messages in thread
From: Gustavo Sousa @ 2026-01-16 22:12 UTC (permalink / raw)
  To: intel-xe; +Cc: Gustavo Sousa

The Xe driver uses struct xe_reg as base type to represent a register
definition, and defines struct xe_reg_mcr as a sort of subtype to
represent multicast replicated (MCR) registers.  It uses this subtyping
to "force" the use of the correct MCR-based API for MMIO operations on
MCR registers.

In regular driver code, usage of those MCR registers usually need some
reasoning about whether the access will need to be steered or a
multicast; and the correct MCR API will be selected.

For RTP tables, on the other hand, that's not the case.  The developer
when defining an action the developer can either select a regular or a
MCR register and the register save/restore logic will make the selection
between regular vs MCR MMIO access depending on the register instance
defined in the RTP action.

That allows some mistakes to go unnoticed: a non-MCR register instance
could be used for an RTP action against a platform where such a register
is actually MCR; and vice-versa.

This series fixes those mistakes and then goes on to update our KUnit
testing to prevent them from happening again.  It is organized as
follows:

* drm/xe: Define CACHE_MODE_1 as MCR register
* drm/xe: Define and use MCR version of COMMON_SLICE_CHICKEN1
* drm/xe: Define and use MCR version of COMMON_SLICE_CHICKEN4

    These patches fix the existing mistakes found in our RTP tables,
    which were found by running the Xe Kunit test xe_wa with the patches
    that follow.

drm/xe/kunit: Add xe_kunit_is_live_test()
drm/xe/kunit: Abort test if MMIO operation is attempted
drm/xe/kunit: Allow intercepting MMIO operations

    These patches add a framework that allows Xe Kunit tests to intercept
    MMIO operations or aborts the tests otherwise.  This was
    implemented to allow including hw_engines in we_wa_test.c, since
    FUNC(xe_rtp_cfeg_wmtp_disabled), used by one of the RTP entries,
    uses a MMIO read.

    Further workaround/tuning conditions that do MMIO reads could be
    added in the future, so this allows xe_wa_test.c to intercept them
    without intrusive changes to the code when that happens.

    Note that the implementation is generic enough to allow usage in
    other tests when necessary.

drm/xe: Extract xe_hw_engine_setup_reg_lrc()
drm/xe: Extract xe_hw_engines_setup_runtime_mask()
drm/xe/kunit: Use KUNIT_EXPECT_EQ() in xe_wa_gt()
drm/xe/kunit: Include hw_engines in xe_wa test

    These patches include hw_engines in xe_wa_test.c for greater
    coverage.  The first three patches of this seires, which fix
    existing inconsistent MCR usage, are for entries in RTP tables for
    hw_engines.

drm/xe/mcr: Extract reg_in_steering_type_ranges()
drm/xe/reg_sr: Do sanity check for MCR vs non-MCR

    These final patches add a sanity check in register save/restore
    logic to prevent the mistakes from happening again.

Signed-off-by: Gustavo Sousa <gustavo.sousa@intel.com>
---
Gustavo Sousa (12):
      drm/xe: Define CACHE_MODE_1 as MCR register
      drm/xe: Define and use MCR version of COMMON_SLICE_CHICKEN1
      drm/xe: Define and use MCR version of COMMON_SLICE_CHICKEN4
      drm/xe/kunit: Add xe_kunit_is_live_test()
      drm/xe/kunit: Abort test if MMIO operation is attempted
      drm/xe/kunit: Allow intercepting MMIO operations
      drm/xe: Extract xe_hw_engine_setup_reg_lrc()
      drm/xe: Extract xe_hw_engines_setup_runtime_mask()
      drm/xe/kunit: Use KUNIT_EXPECT_EQ() in xe_wa_gt()
      drm/xe/kunit: Include hw_engines in xe_wa test
      drm/xe/mcr: Extract reg_in_steering_type_ranges()
      drm/xe/reg_sr: Do sanity check for MCR vs non-MCR

 drivers/gpu/drm/xe/regs/xe_gt_regs.h         |   4 +-
 drivers/gpu/drm/xe/tests/Makefile            |   2 +
 drivers/gpu/drm/xe/tests/xe_kunit_helpers.c  |  25 ++++++
 drivers/gpu/drm/xe/tests/xe_kunit_helpers.h  |   4 +
 drivers/gpu/drm/xe/tests/xe_kunit_mmio.c     |  86 ++++++++++++++++++++
 drivers/gpu/drm/xe/tests/xe_kunit_mmio.h     |  46 +++++++++++
 drivers/gpu/drm/xe/tests/xe_mmio_intercept.c | 116 +++++++++++++++++++++++++++
 drivers/gpu/drm/xe/tests/xe_mmio_intercept.h |  26 ++++++
 drivers/gpu/drm/xe/tests/xe_rtp_test.c       |  71 ++++++++++++++--
 drivers/gpu/drm/xe/tests/xe_wa_test.c        |  63 ++++++++++++++-
 drivers/gpu/drm/xe/xe_gt.c                   |   7 +-
 drivers/gpu/drm/xe/xe_gt_mcr.c               |  64 ++++++++++-----
 drivers/gpu/drm/xe/xe_gt_mcr.h               |   1 +
 drivers/gpu/drm/xe/xe_hw_engine.c            |  24 ++++--
 drivers/gpu/drm/xe/xe_hw_engine.h            |   3 +-
 drivers/gpu/drm/xe/xe_mmio.c                 |  13 +++
 drivers/gpu/drm/xe/xe_reg_sr.c               |  36 +++++++++
 drivers/gpu/drm/xe/xe_wa.c                   |   8 +-
 18 files changed, 555 insertions(+), 44 deletions(-)
---
base-commit: 0f3aa82816dce3da347333a317ea112d16e5d237
change-id: 20260112-rtp-mcr-check-f976cb1adf94

Best regards,
--  
Gustavo Sousa <gustavo.sousa@intel.com>


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

end of thread, other threads:[~2026-05-05 19:39 UTC | newest]

Thread overview: 30+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-01-16 22:12 [PATCH 00/12] Fix MCR inconsistencies in RTP tables Gustavo Sousa
2026-01-16 22:12 ` [PATCH 01/12] drm/xe: Define CACHE_MODE_1 as MCR register Gustavo Sousa
2026-01-21  0:04   ` Matt Roper
2026-01-16 22:12 ` [PATCH 02/12] drm/xe: Define and use MCR version of COMMON_SLICE_CHICKEN1 Gustavo Sousa
2026-01-21  0:06   ` Matt Roper
2026-01-16 22:12 ` [PATCH 03/12] drm/xe: Define and use MCR version of COMMON_SLICE_CHICKEN4 Gustavo Sousa
2026-01-21  0:08   ` Matt Roper
2026-01-16 22:12 ` [PATCH 04/12] drm/xe/kunit: Add xe_kunit_is_live_test() Gustavo Sousa
2026-01-16 22:59   ` Michal Wajdeczko
2026-05-05 18:32     ` Gustavo Sousa
2026-01-16 22:12 ` [PATCH 05/12] drm/xe/kunit: Abort test if MMIO operation is attempted Gustavo Sousa
2026-01-16 23:15   ` Michal Wajdeczko
2026-05-05 19:11     ` Gustavo Sousa
2026-01-16 22:12 ` [PATCH 06/12] drm/xe/kunit: Allow intercepting MMIO operations Gustavo Sousa
2026-01-16 22:12 ` [PATCH 07/12] drm/xe: Extract xe_hw_engine_setup_reg_lrc() Gustavo Sousa
2026-01-21  0:12   ` Matt Roper
2026-01-16 22:12 ` [PATCH 08/12] drm/xe: Extract xe_hw_engines_setup_runtime_mask() Gustavo Sousa
2026-01-28 18:07   ` Matt Roper
2026-01-16 22:12 ` [PATCH 09/12] drm/xe/kunit: Use KUNIT_EXPECT_EQ() in xe_wa_gt() Gustavo Sousa
2026-01-16 23:29   ` Michal Wajdeczko
2026-01-28 18:09   ` Matt Roper
2026-01-16 22:12 ` [PATCH 10/12] drm/xe/kunit: Include hw_engines in xe_wa test Gustavo Sousa
2026-01-28 21:08   ` Matt Roper
2026-01-16 22:12 ` [PATCH 11/12] drm/xe/mcr: Extract reg_in_steering_type_ranges() Gustavo Sousa
2026-01-28 21:11   ` Matt Roper
2026-01-16 22:12 ` [PATCH 12/12] drm/xe/reg_sr: Do sanity check for MCR vs non-MCR Gustavo Sousa
2026-01-28 23:59   ` Matt Roper
2026-05-05 19:39     ` Gustavo Sousa
2026-01-16 23:15 ` ✗ CI.checkpatch: warning for Fix MCR inconsistencies in RTP tables Patchwork
2026-01-16 23:16 ` ✓ CI.KUnit: success " Patchwork

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox