Igt-dev Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Matt Atwood <matthew.s.atwood@intel.com>
To: Gustavo Sousa <gustavo.sousa@intel.com>
Cc: <igt-dev@lists.freedesktop.org>
Subject: Re: [PATCH i-g-t 10/10] intel: Implement Wa_14026539277
Date: Wed, 26 Aug 2026 13:26:33 -0700	[thread overview]
Message-ID: <20260826202633.GA56250@msatwood-mobl> (raw)
In-Reply-To: <20260721-wa_14026539277-v1-10-0c147eeefefa@intel.com>

On Tue, Jul 21, 2026 at 04:00:03PM -0300, Gustavo Sousa wrote:
> Implement the adaptations in IGT required for Wa_14026539277, which is
> basically selecting an alternative PAT index instead of 2-way-coherent
> ones.
> 
> Because xe_pat_cache->wb is expected to be at least 1-way-coherent, we
> need to select an alternative that fulfills that requirement.  Let's
> use the XA 1-way-coherent index for that (PAT index 19), because other
> 1-way coherent configurations do not cause GPU caches to be
> automatically flushed at the end of a batch in certain occasions due
> to the L2 Flush Optimization feature in Xe3p.
> 
> In the specific case of the xe_pat "false-sharing" subtest, it already
> checks for XA 1-way-coherent, so it is just simpler to skip the
> creation of the dynamic subtest for the 2-way-coherent PAT indices,
> which are tagged as reserved by the KMD on the debugfs dump of
> pat_sw_config when the workaround is active.
> 
> Signed-off-by: Gustavo Sousa <gustavo.sousa@intel.com>
Obviously some feedback from others on early parts of this series, however if
this stays the same after...
LGTM
Reviewed-by: Matt Atwood <matthew.s.atwood@intel.com>
> ---
>  lib/intel_pat.c      |  4 ++++
>  tests/intel/xe_pat.c | 28 ++++++++++++++++++++--------
>  2 files changed, 24 insertions(+), 8 deletions(-)
> 
> diff --git a/lib/intel_pat.c b/lib/intel_pat.c
> index ebf5cd428c68..caac00ad68fc 100644
> --- a/lib/intel_pat.c
> +++ b/lib/intel_pat.c
> @@ -7,6 +7,7 @@
>  #include "igt.h"
>  #include "intel_pat.h"
>  #include "xe/xe_query.h"
> +#include "xe/xe_wa.h"
>  
>  enum xe_pat_config {
>  	PAT_SW_CONFIG,
> @@ -109,6 +110,9 @@ static int32_t xe_get_pat_config(struct xe_device *xe_dev, struct intel_pat_cach
>  	free(line);
>  	fclose(dbgfs_file);
>  
> +	if (xe_wa_from_cache(xe_dev, "14026539277"))
> +		xe_pat_cache->wb = 19; /* XA 1-way-coherent. */
> +
>  	return parsed;
>  }
>  
> diff --git a/tests/intel/xe_pat.c b/tests/intel/xe_pat.c
> index bb2975b545e6..e1d329637aa1 100644
> --- a/tests/intel/xe_pat.c
> +++ b/tests/intel/xe_pat.c
> @@ -32,6 +32,7 @@
>  #include "xe/xe_ioctl.h"
>  #include "xe/xe_query.h"
>  #include "xe/xe_util.h"
> +#include "xe/xe_wa.h"
>  
>  #define XE_COH_NONE          1
>  #define XE_COH_AT_LEAST_1WAY 2
> @@ -1865,30 +1866,41 @@ static void false_sharing(int fd)
>  	uint16_t dev_id = intel_get_drm_devid(fd);
>  	uint32_t graphics_ver = intel_get_device_info(dev_id)->graphics_ver;
>  	bool is_dgfx = xe_has_vram(fd);
> -
>  	const struct fs_pat_entry *fs_entries;
> -	int num_entries;
> +	int num_fs_entries;
> +	struct intel_pat_cache pat_sw_config;
> +	int num_pat_entries;
> +
> +	if (xe_wa(fd, "14026539277"))
> +		num_pat_entries = xe_fetch_pat_sw_config(fd, &pat_sw_config);
>  
>  	if (intel_graphics_ver(dev_id) == IP_VER(35, 11)) {
> -		num_entries = ARRAY_SIZE(fs_xe3p_xpc);
> +		num_fs_entries = ARRAY_SIZE(fs_xe3p_xpc);
>  		fs_entries = fs_xe3p_xpc;
>  	} else if (intel_graphics_ver(dev_id) == IP_VER(35, 10)) {
> -		num_entries = ARRAY_SIZE(fs_xe3p_lpg);
> +		num_fs_entries = ARRAY_SIZE(fs_xe3p_lpg);
>  		fs_entries = fs_xe3p_lpg;
>  	} else if (graphics_ver == 20) {
>  		if (is_dgfx) {
> -			num_entries = ARRAY_SIZE(fs_xe2_discrete);
> +			num_fs_entries = ARRAY_SIZE(fs_xe2_discrete);
>  			fs_entries = fs_xe2_discrete;
>  		} else {
> -			num_entries = ARRAY_SIZE(fs_xe2_integrated);
> +			num_fs_entries = ARRAY_SIZE(fs_xe2_integrated);
>  			fs_entries = fs_xe2_integrated;
>  		}
>  	} else {
> -		num_entries = ARRAY_SIZE(fs_xe3);
> +		num_fs_entries = ARRAY_SIZE(fs_xe3);
>  		fs_entries = fs_xe3;
>  	}
>  
> -	for (int i = 0; i < num_entries; i++) {
> +	for (int i = 0; i < num_fs_entries; i++) {
> +		if (xe_wa(fd, "14026539277")) {
> +			igt_assert(fs_entries[i].pat_index < num_pat_entries);
> +
> +			if (pat_sw_config.entries[fs_entries[i].pat_index].rsvd)
> +				continue;
> +		}
> +
>  		igt_dynamic_f("%s", fs_entries[i].name) {
>  			__false_sharing(fd, &fs_entries[i]);
>  		}
> 
> -- 
> 2.55.0
> 

  reply	other threads:[~2026-08-26 20:27 UTC|newest]

Thread overview: 41+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-07-21 18:59 [PATCH i-g-t 00/10] Implement Wa_14026539277 Gustavo Sousa
2026-07-21 18:59 ` [PATCH i-g-t 01/10] lib/xe: Move lib/intel_wa to lib/xe/xe_wa Gustavo Sousa
2026-07-29 21:04   ` Matt Roper
2026-07-29 21:09     ` Gustavo Sousa
2026-07-21 18:59 ` [PATCH i-g-t 02/10] lib/xe: Use stricter line-equality check when checking for workarounds Gustavo Sousa
2026-07-29 21:23   ` Matt Roper
2026-08-18 18:40     ` Gustavo Sousa
2026-08-19 19:32       ` Gustavo Sousa
2026-08-19 20:55         ` Matt Roper
2026-08-19 21:36           ` Gustavo Sousa
2026-08-20 10:35             ` Kamil Konieczny
2026-09-23 17:57               ` Gustavo Sousa
2026-07-21 18:59 ` [PATCH i-g-t 03/10] lib/xe: Gather workarounds debugfs dumps Gustavo Sousa
2026-07-29 21:39   ` Matt Roper
2026-07-21 18:59 ` [PATCH i-g-t 04/10] lib/xe: Cache workaround information in xe_device Gustavo Sousa
2026-07-29 21:58   ` Matt Roper
2026-08-18 18:02     ` Gustavo Sousa
2026-09-23 14:31       ` Gustavo Sousa
2026-07-21 18:59 ` [PATCH i-g-t 05/10] lib/xe: Return boolean from xe_wa() Gustavo Sousa
2026-07-29 22:14   ` Matt Roper
2026-08-18 18:08     ` Gustavo Sousa
2026-08-19 20:50       ` Matt Roper
2026-08-19 21:40         ` Gustavo Sousa
2026-09-23 17:11           ` Gustavo Sousa
2026-07-21 18:59 ` [PATCH i-g-t 06/10] tests/intel/xe_pat: Adapt pat_entry_is_wb() to Xe3p Gustavo Sousa
2026-07-29 22:16   ` Matt Roper
2026-07-21 19:00 ` [PATCH i-g-t 07/10] lib/xe: Add xe_wa_from_cache() Gustavo Sousa
2026-07-29 22:20   ` Matt Roper
2026-07-21 19:00 ` [PATCH i-g-t 08/10] lib/intel_pat: Encapsulate management of xe_device's pat_cache Gustavo Sousa
2026-07-29 22:35   ` Matt Roper
2026-08-18 18:25     ` Gustavo Sousa
2026-08-19 20:43       ` Matt Roper
2026-09-23 17:40         ` Gustavo Sousa
2026-07-21 19:00 ` [PATCH i-g-t 09/10] lib/intel_pat: Pass xe_device to xe_get_pat_config() Gustavo Sousa
2026-07-29 22:38   ` Matt Roper
2026-07-21 19:00 ` [PATCH i-g-t 10/10] intel: Implement Wa_14026539277 Gustavo Sousa
2026-08-26 20:26   ` Matt Atwood [this message]
2026-07-21 23:18 ` ✓ Xe.CI.BAT: success for " Patchwork
2026-07-21 23:56 ` ✓ i915.CI.BAT: " Patchwork
2026-07-22 14:09 ` ✓ Xe.CI.FULL: " Patchwork
2026-07-22 22:52 ` ✗ i915.CI.Full: failure " Patchwork

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=20260826202633.GA56250@msatwood-mobl \
    --to=matthew.s.atwood@intel.com \
    --cc=gustavo.sousa@intel.com \
    --cc=igt-dev@lists.freedesktop.org \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox