* [PATCH i-g-t 0/6] Add DG Diag error injection tests
@ 2026-11-26 7:46 Harish Chegondi
2026-11-26 7:46 ` [PATCH i-g-t 1/6] meson: Add IGSC as an IGT subproject Harish Chegondi
` (5 more replies)
0 siblings, 6 replies; 8+ messages in thread
From: Harish Chegondi @ 2026-11-26 7:46 UTC (permalink / raw)
To: igt-dev
Cc: kamil.konieczny, ravi.kishore.koppuravuri, zbigniew.kempczynski,
maarten.lankhorst, alexander.usyskin, anshuman.gupta,
soham.purkait, riana.tauro, nishit.sharma, Harish Chegondi
This series adds DG Diag error injection tests. These tests
inject errors through debugfs-based test interface for the
System Controller's RAS error injection command. The tests
require the DG Diag FW application to be loaded through
late binding. Intel Graphics System Controller (IGSC)
firmware update library API will be used to load the
DG Diag FW. RAS netlink counters will be read before and
after injection to make sure errors are injected.
The patch series is still under testing.
Harish Chegondi (6):
meson: Add IGSC as an IGT subproject
lib/xe: Add API for late binding from an input file
drm-uapi/xe: Sync with DRM RAS uapi updates
tests/intel/xe_err_injection: Add memory error injection tests
tests/intel/xe_err_injection: Add PUnit error injection test
tests/intel/xe_err_injection: Add CSC error injection tests
include/drm-uapi/xe_drm.h | 11 +-
lib/meson.build | 5 +
lib/xe/xe_igsc.c | 142 ++++++++++++++
lib/xe/xe_igsc.h | 13 ++
meson.build | 9 +
meson_options.txt | 5 +
subprojects/igsc.wrap | 5 +
tests/intel/xe_err_injection.c | 347 ++++++++++++++++++++++++++++++++-
tests/meson.build | 6 +
9 files changed, 540 insertions(+), 3 deletions(-)
create mode 100644 lib/xe/xe_igsc.c
create mode 100644 lib/xe/xe_igsc.h
create mode 100644 subprojects/igsc.wrap
--
2.43.0
^ permalink raw reply [flat|nested] 8+ messages in thread
* [PATCH i-g-t 1/6] meson: Add IGSC as an IGT subproject
2026-11-26 7:46 [PATCH i-g-t 0/6] Add DG Diag error injection tests Harish Chegondi
@ 2026-11-26 7:46 ` Harish Chegondi
2026-11-26 7:46 ` [PATCH i-g-t 2/6] lib/xe: Add API for late binding from an input file Harish Chegondi
` (4 subsequent siblings)
5 siblings, 0 replies; 8+ messages in thread
From: Harish Chegondi @ 2026-11-26 7:46 UTC (permalink / raw)
To: igt-dev
Cc: kamil.konieczny, ravi.kishore.koppuravuri, zbigniew.kempczynski,
maarten.lankhorst, alexander.usyskin, anshuman.gupta,
soham.purkait, riana.tauro, nishit.sharma, Harish Chegondi
Intel Graphics System Controller Firmware Update Library
(IGSC FUL) is a low level library that exposes a required
API to perform a firmware update of an Intel discrete
graphics device. It uses a cross platform library metee
in order to access the GSC (mei) device.
Signed-off-by: Harish Chegondi <harish.chegondi@intel.com>
---
meson.build | 9 +++++++++
meson_options.txt | 5 +++++
subprojects/igsc.wrap | 5 +++++
3 files changed, 19 insertions(+)
create mode 100644 subprojects/igsc.wrap
diff --git a/meson.build b/meson.build
index eec131375..2f1e4f82a 100644
--- a/meson.build
+++ b/meson.build
@@ -153,6 +153,15 @@ libpci = dependency('libpci', required : true)
libudev = dependency('libudev', required : true)
glib = dependency('glib-2.0', required : true)
+igsc = dependency('igsc',
+ required : get_option('igsc'),
+ fallback : ['igsc', 'igsc_dep_static'],
+ default_options : ['enable_cli=false'])
+if igsc.found()
+ config.set('HAVE_IGSC', 1)
+endif
+build_info += 'With igsc: @0@'.format(igsc.found())
+
libtsi = cc.find_library('TSI', required : false)
if libtsi.found()
diff --git a/meson_options.txt b/meson_options.txt
index fc824dda9..3eb98c1a4 100644
--- a/meson_options.txt
+++ b/meson_options.txt
@@ -57,6 +57,11 @@ option('libunwind',
type : 'feature',
description : 'Use libunwind')
+option('igsc',
+ type : 'feature',
+ value : 'auto',
+ description : 'Build tests/tools that use the Intel GSC firmware update library (igsc)')
+
option('runner',
type : 'feature',
description : 'Build test runner')
diff --git a/subprojects/igsc.wrap b/subprojects/igsc.wrap
new file mode 100644
index 000000000..5443e035e
--- /dev/null
+++ b/subprojects/igsc.wrap
@@ -0,0 +1,5 @@
+[wrap-git]
+url = https://github.com/intel/igsc
+directory = igsc
+revision = V1.3.0
+depth = 1
--
2.43.0
^ permalink raw reply related [flat|nested] 8+ messages in thread
* [PATCH i-g-t 2/6] lib/xe: Add API for late binding from an input file
2026-11-26 7:46 [PATCH i-g-t 0/6] Add DG Diag error injection tests Harish Chegondi
2026-11-26 7:46 ` [PATCH i-g-t 1/6] meson: Add IGSC as an IGT subproject Harish Chegondi
@ 2026-11-26 7:46 ` Harish Chegondi
2026-11-26 7:46 ` [PATCH i-g-t 3/6] drm-uapi/xe: Sync with DRM RAS uapi updates Harish Chegondi
` (3 subsequent siblings)
5 siblings, 0 replies; 8+ messages in thread
From: Harish Chegondi @ 2026-11-26 7:46 UTC (permalink / raw)
To: igt-dev
Cc: kamil.konieczny, ravi.kishore.koppuravuri, zbigniew.kempczynski,
maarten.lankhorst, alexander.usyskin, anshuman.gupta,
soham.purkait, riana.tauro, nishit.sharma, Harish Chegondi
IGSC library provides an API for late binding but the payload
data has to be in a buffer. Reuse functions from the IGSC library
to create an API for late binding which takes the payload data
in a file.
Signed-off-by: Harish Chegondi <harish.chegondi@intel.com>
---
lib/meson.build | 5 ++
lib/xe/xe_igsc.c | 142 +++++++++++++++++++++++++++++++++++++++++++++++
lib/xe/xe_igsc.h | 13 +++++
3 files changed, 160 insertions(+)
create mode 100644 lib/xe/xe_igsc.c
create mode 100644 lib/xe/xe_igsc.h
diff --git a/lib/meson.build b/lib/meson.build
index 3ed1369b5..a899047fb 100644
--- a/lib/meson.build
+++ b/lib/meson.build
@@ -258,6 +258,11 @@ if alsa.found()
lib_sources += 'igt_alsa.c'
endif
+if igsc.found()
+ lib_deps += igsc
+ lib_sources += 'xe/xe_igsc.c'
+endif
+
if chamelium.found()
lib_deps += chamelium
lib_sources += [ 'igt_chamelium.c', 'igt_chamelium_stream.c' ]
diff --git a/lib/xe/xe_igsc.c b/lib/xe/xe_igsc.c
new file mode 100644
index 000000000..4b6337a28
--- /dev/null
+++ b/lib/xe/xe_igsc.c
@@ -0,0 +1,142 @@
+// SPDX-License-Identifier: MIT
+/*
+ * Copyright(c) 2026 Intel Corporation. All rights reserved.
+ */
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+
+#include "igt_core.h"
+#include "xe_igsc.h"
+
+#define CONNECT_RETRIES_SLEEP_SEC 2
+#define MAX_CONNECT_RETRIES 3
+
+static int copy_file_to_buf(const char *p_path, uint8_t **buf, size_t *buf_len)
+{
+ FILE *fp = NULL;
+ uint8_t *pbuf = NULL;
+ long file_size;
+ int ret = 0;
+
+ fp = fopen(p_path, "rb");
+ if (!fp) {
+ igt_warn("Failed to open file %s\n", p_path);
+ ret = -1;
+ goto exit;
+ }
+ if (fseek(fp, 0L, SEEK_END) != 0) {
+ igt_warn("Failed to get file size %s\n", p_path);
+ ret = -1;
+ goto exit;
+ }
+ file_size = ftell(fp);
+ if (file_size < 0) {
+ igt_warn("Failed to get file size %s\n", p_path);
+ ret = -1;
+ goto exit;
+ }
+ if (file_size > IGSC_MAX_IMAGE_SIZE) {
+ igt_warn("Update image size (%ld) too large\n", file_size);
+ ret = -1;
+ goto exit;
+ }
+ if (fseek(fp, 0L, SEEK_SET) != 0) {
+ igt_warn("Failed to reset file position %s\n", p_path);
+ ret = -1;
+ goto exit;
+ }
+ pbuf = malloc((size_t)file_size);
+ if (!pbuf) {
+ igt_warn("Failed to allocate memory\n");
+ ret = -1;
+ goto exit;
+ }
+ if (fread(pbuf, 1, (size_t)file_size, fp) != (size_t)file_size) {
+ igt_warn("Failed to read file %s\n", p_path);
+ ret = -1;
+ free(pbuf);
+ goto exit;
+ }
+ *buf_len = (size_t)file_size;
+ *buf = pbuf;
+exit:
+ if (fp)
+ fclose(fp);
+ return ret;
+}
+
+static int
+late_binding(const char *device_path, const char *payload_path, uint32_t type, uint32_t flags)
+{
+ struct igsc_device_handle handle;
+ char *device_path_found = NULL;
+ unsigned int retries = 0;
+ size_t payload_size = 0;
+ uint8_t *payload = NULL;
+ uint32_t status = 0;
+ int ret;
+
+ memset(&handle, 0, sizeof(handle));
+
+ if (copy_file_to_buf(payload_path, &payload, &payload_size) != 0) {
+ igt_warn("Failed to copy file : %s\n", payload_path);
+ ret = -1;
+ goto exit;
+ }
+ ret = igsc_device_init_by_device(&handle, device_path);
+ if (ret) {
+ igt_warn("Cannot initialize device: %s\n", device_path);
+ goto exit;
+ }
+ while ((ret = igsc_device_update_late_binding_config2(&handle, type, flags,
+ payload, payload_size,
+ &status)) == IGSC_ERROR_BUSY) {
+ sleep(CONNECT_RETRIES_SLEEP_SEC);
+ if (++retries >= MAX_CONNECT_RETRIES)
+ break;
+ }
+ if (ret)
+ igt_warn("Failed to send late binding command: %d\n", ret);
+exit:
+ igsc_device_close(&handle);
+
+ free(device_path_found);
+ free(payload);
+ return ret;
+}
+
+/**
+ * xe_igsc_load_firmware:
+ * @fw_file: pointer to late binding payload file name and path.
+ *
+ * Reads the input payload file into a buffer and call function that
+ * sends a late binding HECI command to the firmware with the buffer.
+ *
+ * Returns IGSC_SUCCESS(0) if successful, otherwise error code.
+ */
+int xe_igsc_load_firmware(const char *fw_file)
+{
+ struct igsc_device_iterator *iter;
+ struct igsc_device_info info;
+ int ret;
+
+ if (!fw_file) {
+ igt_critical("Input file missing\n");
+ return -1;
+ }
+
+ ret = igsc_device_iterator_create(&iter);
+ if (ret != IGSC_SUCCESS) {
+ igt_critical("Cannot create device iterator\n");
+ return ret;
+ }
+ info.name[0] = '\0';
+ ret = igsc_device_iterator_next(iter, &info);
+ if (ret == IGSC_SUCCESS)
+ ret = late_binding(info.name, fw_file, CSC_LATE_BINDING_TYPE_DGDIAG, 0);
+ igsc_device_iterator_destroy(iter);
+
+ return ret;
+}
diff --git a/lib/xe/xe_igsc.h b/lib/xe/xe_igsc.h
new file mode 100644
index 000000000..24bb3110b
--- /dev/null
+++ b/lib/xe/xe_igsc.h
@@ -0,0 +1,13 @@
+/* SPDX-License-Identifier: MIT */
+/*
+ * Copyright(c) 2026 Intel Corporation. All rights reserved.
+ */
+
+#ifndef XE_IGSC_H
+#define XE_IGSC_H
+
+#include <igsc_lib.h>
+
+int xe_igsc_load_firmware(const char *fw_file);
+
+#endif /* XE_IGSC_H */
--
2.43.0
^ permalink raw reply related [flat|nested] 8+ messages in thread
* [PATCH i-g-t 3/6] drm-uapi/xe: Sync with DRM RAS uapi updates
2026-11-26 7:46 [PATCH i-g-t 0/6] Add DG Diag error injection tests Harish Chegondi
2026-11-26 7:46 ` [PATCH i-g-t 1/6] meson: Add IGSC as an IGT subproject Harish Chegondi
2026-11-26 7:46 ` [PATCH i-g-t 2/6] lib/xe: Add API for late binding from an input file Harish Chegondi
@ 2026-11-26 7:46 ` Harish Chegondi
2026-11-26 16:35 ` Kamil Konieczny
2026-11-26 7:46 ` [PATCH i-g-t 4/6] tests/intel/xe_err_injection: Add memory error injection tests Harish Chegondi
` (2 subsequent siblings)
5 siblings, 1 reply; 8+ messages in thread
From: Harish Chegondi @ 2026-11-26 7:46 UTC (permalink / raw)
To: igt-dev
Cc: kamil.konieczny, ravi.kishore.koppuravuri, zbigniew.kempczynski,
maarten.lankhorst, alexander.usyskin, anshuman.gupta,
soham.purkait, riana.tauro, nishit.sharma, Harish Chegondi
Align with kernel commit cdeb5e248de11537
("drm/xe/uapi: Add additional error components to xe drm_ras").
Signed-off-by: Harish Chegondi <harish.chegondi@intel.com>
---
include/drm-uapi/xe_drm.h | 11 ++++++++++-
1 file changed, 10 insertions(+), 1 deletion(-)
diff --git a/include/drm-uapi/xe_drm.h b/include/drm-uapi/xe_drm.h
index 5a96a7910..b07f1ef4a 100644
--- a/include/drm-uapi/xe_drm.h
+++ b/include/drm-uapi/xe_drm.h
@@ -2589,6 +2589,12 @@ enum drm_xe_ras_error_component {
DRM_XE_RAS_ERR_COMP_CORE_COMPUTE = 1,
/** @DRM_XE_RAS_ERR_COMP_SOC_INTERNAL: SoC Internal Error */
DRM_XE_RAS_ERR_COMP_SOC_INTERNAL,
+ /** @DRM_XE_RAS_ERR_COMP_DEVICE_MEMORY: Device Memory Error */
+ DRM_XE_RAS_ERR_COMP_DEVICE_MEMORY,
+ /** @DRM_XE_RAS_ERR_COMP_PCIE: PCIe Subsystem Error */
+ DRM_XE_RAS_ERR_COMP_PCIE,
+ /** @DRM_XE_RAS_ERR_COMP_FABRIC: Fabric Subsystem Error */
+ DRM_XE_RAS_ERR_COMP_FABRIC,
/** @DRM_XE_RAS_ERR_COMP_MAX: Max Error */
DRM_XE_RAS_ERR_COMP_MAX /* non-ABI */
};
@@ -2606,7 +2612,10 @@ enum drm_xe_ras_error_component {
*/
#define DRM_XE_RAS_ERROR_COMPONENT_NAMES { \
[DRM_XE_RAS_ERR_COMP_CORE_COMPUTE] = "core-compute", \
- [DRM_XE_RAS_ERR_COMP_SOC_INTERNAL] = "soc-internal" \
+ [DRM_XE_RAS_ERR_COMP_SOC_INTERNAL] = "soc-internal", \
+ [DRM_XE_RAS_ERR_COMP_DEVICE_MEMORY] = "device-memory", \
+ [DRM_XE_RAS_ERR_COMP_PCIE] = "pcie", \
+ [DRM_XE_RAS_ERR_COMP_FABRIC] = "fabric", \
}
#if defined(__cplusplus)
--
2.43.0
^ permalink raw reply related [flat|nested] 8+ messages in thread
* [PATCH i-g-t 4/6] tests/intel/xe_err_injection: Add memory error injection tests
2026-11-26 7:46 [PATCH i-g-t 0/6] Add DG Diag error injection tests Harish Chegondi
` (2 preceding siblings ...)
2026-11-26 7:46 ` [PATCH i-g-t 3/6] drm-uapi/xe: Sync with DRM RAS uapi updates Harish Chegondi
@ 2026-11-26 7:46 ` Harish Chegondi
2026-11-26 7:46 ` [PATCH i-g-t 5/6] tests/intel/xe_err_injection: Add PUnit error injection test Harish Chegondi
2026-11-26 7:46 ` [PATCH i-g-t 6/6] tests/intel/xe_err_injection: Add CSC error injection tests Harish Chegondi
5 siblings, 0 replies; 8+ messages in thread
From: Harish Chegondi @ 2026-11-26 7:46 UTC (permalink / raw)
To: igt-dev
Cc: kamil.konieczny, ravi.kishore.koppuravuri, zbigniew.kempczynski,
maarten.lankhorst, alexander.usyskin, anshuman.gupta,
soham.purkait, riana.tauro, nishit.sharma, Harish Chegondi
Inject RAS memory errors through debugfs interface
sc/ras_error_inject that exercises System Controller's
RAS error injection command. This requires DG Diag FW
application be loaded. The DG Diag FW file needs to be
passed as an input parameter. The FW will be loaded
through late binding through an IGSC library API.
The memory errors count will be fetched before and
after injection through the RAS netlink interface.
Memory errors can cause pages to be offlined which
show up in the debugfs vram_bad_pages. Count the
number of bad pages before and after injection.
Signed-off-by: Harish Chegondi <harish.chegondi@intel.com>
---
tests/intel/xe_err_injection.c | 246 ++++++++++++++++++++++++++++++++-
tests/meson.build | 6 +
2 files changed, 250 insertions(+), 2 deletions(-)
diff --git a/tests/intel/xe_err_injection.c b/tests/intel/xe_err_injection.c
index 74ae9b243..efdd8664b 100644
--- a/tests/intel/xe_err_injection.c
+++ b/tests/intel/xe_err_injection.c
@@ -30,6 +30,27 @@
#include "xe/xe_mmio.h"
#include "xe/xe_query.h"
+#ifdef HAVE_IGSC
+#include "xe/xe_igsc.h"
+#endif
+
+/* Error injection IP block IDs */
+#define RAS_MEM_BLOCK 2
+
+/* Memory error injection sub-block IDs */
+#define MEM_AXI_WRITE_SUB_BLOCK 2
+#define MEM_WR_2BIT_ECC_SUB_BLOCK 8
+
+/* Memory error injection type */
+#define MEM_WR_2BIT_ECC_ERR_INJ 1
+#define MEM_MB0_AXI_WRITE_POISON_ERR_INJ 3
+#define MEM_MB1_AXI_WRITE_POISON_ERR_INJ 4
+#define MEM_MB0_AXI_WRITE_PARITY_ERR_INJ 5
+#define MEM_MB1_AXI_WRITE_PARITY_ERR_INJ 6
+
+/* Memory error injection mask */
+#define MEM_MSU_MASK 1
+
/* Steering Control Register (MC_PKT_CTRL) */
#define XE_MC_PKT_CTRL_MGSR_3D_ADDRESS 0x00FD4
#define XE_MC_PKT_CTRL_MGSR_3D_VALUE 0x80000000
@@ -50,7 +71,9 @@
#define NODE_ID_UNCORRECTABLE_ERROR 1
/* Error types for error counter */
-#define ERROR_ID_CORE_COMPUTE 1
+#define ERROR_ID_CORE_COMPUTE 1
+#define ERROR_ID_SOC_INTERNAL 2
+#define ERROR_ID_DEVICE_MEMORY 3
/* Core Compute Correctable error injection */
#define XE_L2_BANK_ERR_INJ 0xB1B4
@@ -67,8 +90,18 @@ enum {
#define THRESHOLD_NONE 0
#define THRESHOLD_ONE 1
+#define VRAM_BAD_PAGES "vram_bad_pages"
+
time_t event_timeout = 10 * 1000; /* 10 seconds */
+static char *fw_file;
+const char *help_str = " --firmware | -f\t\tDG Diag firmware file\n";
+
+static struct option long_options[] = {
+ {"firmware", 0, 0, 'f'},
+ { NULL, 0, 0, 0 }
+};
+
static bool run_xe_compute_on_all_engines(int fd, bool state)
{
struct drm_xe_engine_class_instance *hwe;
@@ -288,6 +321,141 @@ static void ignore_aer_in_dmesg(void)
static bool uncorr_error_recovered;
+/* Count the number of bad pages in VRAM from vram_bad_pages in debugfs */
+static int count_bad_pages(int fd)
+{
+ char buf[4096];
+ int count = 0;
+ char *line;
+
+ /* Read file into buf. It automatically null-terminates inside. */
+ __igt_debugfs_read(fd, VRAM_BAD_PAGES, buf, sizeof(buf));
+
+ /* Check if the buffer is empty or could not be read */
+ if (buf[0] == '\0')
+ return 0;
+
+ /* Each entry line has format: "0x%08x : 0x%08x : %c\n" */
+ line = buf;
+ while ((line = strchr(line, '\n')) != NULL) {
+ count++;
+ line++;
+ }
+
+ /* Subtract the header line (max_pages : XXXX) */
+ if (count > 0)
+ count--;
+
+ return count;
+}
+
+/* Test mmap on VRAM */
+static void test_mmap(int fd)
+{
+ size_t bo_size = xe_get_default_alignment(fd);
+ uint32_t bo;
+ void *map;
+
+ bo = xe_bo_create(fd, 0, bo_size, vram_memory(fd, 0),
+ DRM_XE_GEM_CREATE_FLAG_NEEDS_VISIBLE_VRAM);
+
+ map = xe_bo_map(fd, bo, bo_size);
+ strcpy(map, "Write some data to the BO!");
+
+ munmap(map, bo_size);
+
+ gem_close(fd, bo);
+}
+
+static void inject_ras_error(int fd,
+ uint16_t block_id,
+ uint16_t sub_block_id,
+ uint16_t err_type,
+ uint32_t params)
+{
+ char path[128], cmd[256] = {0};
+
+ igt_assert(igt_debugfs_path(fd, path, sizeof(path)));
+ snprintf(cmd, sizeof(cmd) - 1, "echo %u %u %u %u > %s/sc/ras_error_inject",
+ block_id, sub_block_id, err_type, params, path);
+ igt_assert(system(cmd) == 0);
+}
+
+/**
+ * SUBTEST: mem-mb0-write-poison-err-injection
+ * Description: Verify memory MB0 write poison error injection
+ * Functionality: error injection
+ *
+ * SUBTEST: mem-mb1-write-poison-err-injection
+ * Description: Verify memory MB1 write poison error injection
+ * Functionality: error injection
+ *
+ * SUBTEST: mem-mb0-write-parity-err-injection
+ * Description: Verify memory MB0 write parity error injection
+ * Functionality: error injection
+ *
+ * SUBTEST: mem-mb1-write-parity-err-injection
+ * Description: Verify memory MB1 write parity error injection
+ * Functionality: error injection
+ *
+ * SUBTEST: mem-write-2bit-ecc-err-injection
+ * Description: Verify memory write 2-bit ECC error injection
+ * Functionality: error injection
+ */
+static void test_inject_memory_uncorr_errors(int fd,
+ uint16_t block_id,
+ uint16_t sub_block_id,
+ uint16_t err_type,
+ uint32_t params)
+{
+ int fw_handle;
+ struct igt_helper_process work_load = {};
+ uint32_t error_id = ERROR_ID_DEVICE_MEMORY;
+ uint32_t node_id = NODE_ID_UNCORRECTABLE_ERROR;
+ uint32_t error_count_before_inj, error_count_after_inj;
+ uint32_t bad_pages_count_before_inj, bad_pages_count_after_inj;
+
+ fw_handle = acquire_forcewake(fd);
+
+ error_count_before_inj = get_counter(node_id, error_id);
+ bad_pages_count_before_inj = count_bad_pages(fd);
+
+ igt_fork_helper(&work_load) {
+ int iter, devnull = open("/dev/null", O_WRONLY);
+
+ if (devnull != -1) {
+ dup2(devnull, STDOUT_FILENO);
+ dup2(devnull, STDERR_FILENO);
+ close(devnull);
+ }
+ /* Run mmap test several times as a workload */
+ for (iter = 0; iter < 100; iter++)
+ test_mmap(fd);
+ }
+ inject_ras_error(fd, block_id, sub_block_id, err_type, params);
+ igt_wait_helper(&work_load);
+
+ sleep(3);
+ error_count_after_inj = get_counter(node_id, error_id);
+ bad_pages_count_after_inj = count_bad_pages(fd);
+
+ release_forcewake(fw_handle);
+
+ igt_assert_f(error_count_before_inj != UINT32_MAX &&
+ error_count_after_inj != UINT32_MAX,
+ "Failed to fetch valid error counters: before=%u after=%u\n",
+ error_count_before_inj, error_count_after_inj);
+
+ igt_info("mem error counter: before injection=%u after injection=%u\n",
+ error_count_before_inj, error_count_after_inj);
+ igt_info("Bad pages in VRAM: before injection=%u after injection=%u\n",
+ bad_pages_count_before_inj, bad_pages_count_after_inj);
+ igt_assert_f(error_count_after_inj > error_count_before_inj,
+ "Uncorrectable memory error injection test failed: "
+ "error count before injection=%u after injection=%u\n",
+ error_count_before_inj, error_count_after_inj);
+}
+
/**
* SUBTEST: inject_core_compute_uncorr_error
* Description: Inject a Core Compute Uncorrectable error and verify
@@ -562,10 +730,35 @@ static void inject_error(enum xe_err_injection_type injection, struct xe_mmio *m
}
}
-int igt_main()
+static int opt_handler(int opt, int opt_index, void *data)
+{
+ switch (opt) {
+ case 'f':
+ fw_file = optarg;
+ break;
+ default:
+ return IGT_OPT_HANDLER_ERROR;
+ }
+
+ return IGT_OPT_HANDLER_SUCCESS;
+}
+
+static bool load_dgdiag_firmware(void)
+{
+ bool ret = false;
+
+#ifdef HAVE_IGSC
+ if (xe_igsc_load_firmware(fw_file) == IGSC_SUCCESS)
+ ret = true;
+#endif
+ return ret;
+}
+
+int igt_main_args("f:", long_options, help_str, opt_handler, NULL)
{
int fd;
struct xe_mmio mmio;
+ bool dgdiag_fw_present = false;
igt_fixture() {
fd = drm_open_driver(DRIVER_XE);
@@ -579,6 +772,9 @@ int igt_main()
xe_mmio_access_init(fd, &mmio);
igt_require_f(xe_mmio_is_initialized(&mmio),
"Failed to initialize Xe MMIO access\n");
+
+ if (fw_file)
+ dgdiag_fw_present = load_dgdiag_firmware();
}
igt_describe("Inject core compute uncorrectable error and run post-recovery workload.");
@@ -608,6 +804,52 @@ int igt_main()
igt_subtest("inject_core_compute_corr_error_once")
inject_error(XE_CORE_COMPUTE_CORR_ERR_INJ_ONCE, &mmio, fd);
+ igt_describe("Verify memory MB0 write poison error injection");
+ igt_subtest("mem-mb0-write-poison-err-injection") {
+ igt_require(dgdiag_fw_present);
+ test_inject_memory_uncorr_errors(fd,
+ RAS_MEM_BLOCK,
+ MEM_AXI_WRITE_SUB_BLOCK,
+ MEM_MB0_AXI_WRITE_POISON_ERR_INJ,
+ MEM_MSU_MASK);
+ }
+ igt_describe("Verify memory MB1 write poison error injection");
+ igt_subtest("mem-mb1-write-poison-err-injection") {
+ igt_require(dgdiag_fw_present);
+ test_inject_memory_uncorr_errors(fd,
+ RAS_MEM_BLOCK,
+ MEM_AXI_WRITE_SUB_BLOCK,
+ MEM_MB1_AXI_WRITE_POISON_ERR_INJ,
+ MEM_MSU_MASK);
+ }
+ igt_describe("Verify memory MB0 write parity error injection");
+ igt_subtest("mem-mb0-write-parity-err-injection") {
+ igt_require(dgdiag_fw_present);
+ test_inject_memory_uncorr_errors(fd,
+ RAS_MEM_BLOCK,
+ MEM_AXI_WRITE_SUB_BLOCK,
+ MEM_MB0_AXI_WRITE_PARITY_ERR_INJ,
+ MEM_MSU_MASK);
+ }
+ igt_describe("Verify memory MB1 write parity error injection");
+ igt_subtest("mem-mb1-write-parity-err-injection") {
+ igt_require(dgdiag_fw_present);
+ test_inject_memory_uncorr_errors(fd,
+ RAS_MEM_BLOCK,
+ MEM_AXI_WRITE_SUB_BLOCK,
+ MEM_MB1_AXI_WRITE_PARITY_ERR_INJ,
+ MEM_MSU_MASK);
+ }
+ igt_describe("Verify memory write 2-bit ECC error injection");
+ igt_subtest("mem-write-2bit-ecc-err-injection") {
+ igt_require(dgdiag_fw_present);
+ test_inject_memory_uncorr_errors(fd,
+ RAS_MEM_BLOCK,
+ MEM_WR_2BIT_ECC_SUB_BLOCK,
+ MEM_WR_2BIT_ECC_ERR_INJ,
+ MEM_MSU_MASK);
+ }
+
igt_fixture() {
xe_mmio_access_fini(&mmio);
drm_close_driver(fd);
diff --git a/tests/meson.build b/tests/meson.build
index 806320a82..e8a5dcc1d 100644
--- a/tests/meson.build
+++ b/tests/meson.build
@@ -442,6 +442,12 @@ extra_dependencies = {
'xe_compute': [ igt_deps,lib_igt_perf,lib_igt_profiling,math ],
}
+# Tests using the Intel GSC firmware update library (igsc). Only registered
+# when the igsc dependency (subproject or system) is available.
+if igsc.found()
+ extra_dependencies += {'xe_err_injection' : [ igsc ]}
+endif
+
test_executables = []
test_list = []
testlist_files = []
--
2.43.0
^ permalink raw reply related [flat|nested] 8+ messages in thread
* [PATCH i-g-t 5/6] tests/intel/xe_err_injection: Add PUnit error injection test
2026-11-26 7:46 [PATCH i-g-t 0/6] Add DG Diag error injection tests Harish Chegondi
` (3 preceding siblings ...)
2026-11-26 7:46 ` [PATCH i-g-t 4/6] tests/intel/xe_err_injection: Add memory error injection tests Harish Chegondi
@ 2026-11-26 7:46 ` Harish Chegondi
2026-11-26 7:46 ` [PATCH i-g-t 6/6] tests/intel/xe_err_injection: Add CSC error injection tests Harish Chegondi
5 siblings, 0 replies; 8+ messages in thread
From: Harish Chegondi @ 2026-11-26 7:46 UTC (permalink / raw)
To: igt-dev
Cc: kamil.konieczny, ravi.kishore.koppuravuri, zbigniew.kempczynski,
maarten.lankhorst, alexander.usyskin, anshuman.gupta,
soham.purkait, riana.tauro, nishit.sharma, Harish Chegondi
Inject PUnit errors through debugfs interface sc/ras_error_inject
This requires DG Diag FW application be loaded. PUnit errors will be
counted as SOC errors. Count SOC errors before and after Punit error
injection.
Signed-off-by: Harish Chegondi <harish.chegondi@intel.com>
---
tests/intel/xe_err_injection.c | 55 ++++++++++++++++++++++++++++++++++
1 file changed, 55 insertions(+)
diff --git a/tests/intel/xe_err_injection.c b/tests/intel/xe_err_injection.c
index efdd8664b..b90091f20 100644
--- a/tests/intel/xe_err_injection.c
+++ b/tests/intel/xe_err_injection.c
@@ -36,6 +36,7 @@
/* Error injection IP block IDs */
#define RAS_MEM_BLOCK 2
+#define RAS_PUNIT_BLOCK 4
/* Memory error injection sub-block IDs */
#define MEM_AXI_WRITE_SUB_BLOCK 2
@@ -48,6 +49,12 @@
#define MEM_MB0_AXI_WRITE_PARITY_ERR_INJ 5
#define MEM_MB1_AXI_WRITE_PARITY_ERR_INJ 6
+/* PUnit error injection sub-block ID */
+#define PUNIT_SUB_BLOCK 1
+
+/* PUnit error injection type */
+#define PUNIT_DOUBLE_BIT_ERR_INJ 1
+
/* Memory error injection mask */
#define MEM_MSU_MASK 1
@@ -456,6 +463,46 @@ static void test_inject_memory_uncorr_errors(int fd,
error_count_before_inj, error_count_after_inj);
}
+/**
+ * SUBTEST: punit-double-bit-err-injection
+ * Description: Inject a PUnit double bit uncorrectable error and verify
+ * Functionality: error injection
+ */
+static void test_inject_soc_uncorr_error(int fd,
+ uint8_t block_id,
+ uint8_t sub_block_id,
+ uint8_t err_type)
+{
+ int fw_handle;
+ uint32_t params = 0;
+ uint32_t error_id = ERROR_ID_SOC_INTERNAL;
+ uint32_t node_id = NODE_ID_UNCORRECTABLE_ERROR;
+ uint32_t error_count_before_inj, error_count_after_inj;
+
+ fw_handle = acquire_forcewake(fd);
+
+ error_count_before_inj = get_counter(node_id, error_id);
+
+ inject_ras_error(fd, block_id, sub_block_id, err_type, params);
+
+ sleep(3);
+ error_count_after_inj = get_counter(node_id, error_id);
+
+ release_forcewake(fw_handle);
+
+ igt_assert_f(error_count_before_inj != UINT32_MAX &&
+ error_count_after_inj != UINT32_MAX,
+ "Failed to fetch valid error counters: before=%u after=%u\n",
+ error_count_before_inj, error_count_after_inj);
+
+ igt_info("SOC error counter: before injection=%u after injection=%u\n",
+ error_count_before_inj, error_count_after_inj);
+ igt_assert_f(error_count_after_inj > error_count_before_inj,
+ "Uncorrectable SOC error injection test failed: "
+ "error count before injection=%u after injection=%u\n",
+ error_count_before_inj, error_count_after_inj);
+}
+
/**
* SUBTEST: inject_core_compute_uncorr_error
* Description: Inject a Core Compute Uncorrectable error and verify
@@ -849,6 +896,14 @@ int igt_main_args("f:", long_options, help_str, opt_handler, NULL)
MEM_WR_2BIT_ECC_ERR_INJ,
MEM_MSU_MASK);
}
+ igt_describe("Verify punit double bit error injection");
+ igt_subtest("punit-double-bit-err-injection") {
+ igt_require(dgdiag_fw_present);
+ test_inject_soc_uncorr_error(fd,
+ RAS_PUNIT_BLOCK,
+ PUNIT_SUB_BLOCK,
+ PUNIT_DOUBLE_BIT_ERR_INJ);
+ }
igt_fixture() {
xe_mmio_access_fini(&mmio);
--
2.43.0
^ permalink raw reply related [flat|nested] 8+ messages in thread
* [PATCH i-g-t 6/6] tests/intel/xe_err_injection: Add CSC error injection tests
2026-11-26 7:46 [PATCH i-g-t 0/6] Add DG Diag error injection tests Harish Chegondi
` (4 preceding siblings ...)
2026-11-26 7:46 ` [PATCH i-g-t 5/6] tests/intel/xe_err_injection: Add PUnit error injection test Harish Chegondi
@ 2026-11-26 7:46 ` Harish Chegondi
5 siblings, 0 replies; 8+ messages in thread
From: Harish Chegondi @ 2026-11-26 7:46 UTC (permalink / raw)
To: igt-dev
Cc: kamil.konieczny, ravi.kishore.koppuravuri, zbigniew.kempczynski,
maarten.lankhorst, alexander.usyskin, anshuman.gupta,
soham.purkait, riana.tauro, nishit.sharma, Harish Chegondi
Inject CSC errors through debugfs interface sc/ras_error_inject
This requires DG Diag FW application be loaded. CSC errors will
be counted as SOC errors. Count SOC errors before and after CSC
error injection.
Signed-off-by: Harish Chegondi <harish.chegondi@intel.com>
---
tests/intel/xe_err_injection.c | 46 ++++++++++++++++++++++++++++++++++
1 file changed, 46 insertions(+)
diff --git a/tests/intel/xe_err_injection.c b/tests/intel/xe_err_injection.c
index b90091f20..e3eb1d09f 100644
--- a/tests/intel/xe_err_injection.c
+++ b/tests/intel/xe_err_injection.c
@@ -36,6 +36,7 @@
/* Error injection IP block IDs */
#define RAS_MEM_BLOCK 2
+#define RAS_CSC_BLOCK 3
#define RAS_PUNIT_BLOCK 4
/* Memory error injection sub-block IDs */
@@ -55,6 +56,14 @@
/* PUnit error injection type */
#define PUNIT_DOUBLE_BIT_ERR_INJ 1
+/* CSC error injection sub-block ID */
+#define RAS_CSC_SUB_BLOCK 1
+
+/* CSC error injection type */
+#define RAS_CSC_FATAL_ERR_INJ 0
+#define RAS_CSC_DISABLED_ERR_INJ 1
+#define RAS_CSC_DATA_CORRUPTION 2
+
/* Memory error injection mask */
#define MEM_MSU_MASK 1
@@ -467,6 +476,19 @@ static void test_inject_memory_uncorr_errors(int fd,
* SUBTEST: punit-double-bit-err-injection
* Description: Inject a PUnit double bit uncorrectable error and verify
* Functionality: error injection
+ *
+ * SUBTEST: csc-fatal-err-injection
+ * Description: Inject a CSC fatal error and verify
+ * Functionality: error injection
+ *
+ * SUBTEST: csc-disabled-err-injection
+ * Description: Inject a CSC disable error and verify
+ * Functionality: error injection
+ *
+ * SUBTEST: csc-data-corruption-err-injection
+ * Description: Inject a CSC data corruption error and verify
+ * Functionality: error injection
+ *
*/
static void test_inject_soc_uncorr_error(int fd,
uint8_t block_id,
@@ -904,6 +926,30 @@ int igt_main_args("f:", long_options, help_str, opt_handler, NULL)
PUNIT_SUB_BLOCK,
PUNIT_DOUBLE_BIT_ERR_INJ);
}
+ igt_describe("Verify CSC fatal error injection");
+ igt_subtest("csc-fatal-err-injection") {
+ igt_require(dgdiag_fw_present);
+ test_inject_soc_uncorr_error(fd,
+ RAS_CSC_BLOCK,
+ RAS_CSC_SUB_BLOCK,
+ RAS_CSC_FATAL_ERR_INJ);
+ }
+ igt_describe("Verify CSC disabled error injection");
+ igt_subtest("csc-disabled-err-injection") {
+ igt_require(dgdiag_fw_present);
+ test_inject_soc_uncorr_error(fd,
+ RAS_CSC_BLOCK,
+ RAS_CSC_SUB_BLOCK,
+ RAS_CSC_DISABLED_ERR_INJ);
+ }
+ igt_describe("Verify CSC data corruption error injection");
+ igt_subtest("csc-data-corruption-err-injection") {
+ igt_require(dgdiag_fw_present);
+ test_inject_soc_uncorr_error(fd,
+ RAS_CSC_BLOCK,
+ RAS_CSC_SUB_BLOCK,
+ RAS_CSC_DATA_CORRUPTION);
+ }
igt_fixture() {
xe_mmio_access_fini(&mmio);
--
2.43.0
^ permalink raw reply related [flat|nested] 8+ messages in thread
* Re: [PATCH i-g-t 3/6] drm-uapi/xe: Sync with DRM RAS uapi updates
2026-11-26 7:46 ` [PATCH i-g-t 3/6] drm-uapi/xe: Sync with DRM RAS uapi updates Harish Chegondi
@ 2026-11-26 16:35 ` Kamil Konieczny
0 siblings, 0 replies; 8+ messages in thread
From: Kamil Konieczny @ 2026-11-26 16:35 UTC (permalink / raw)
To: Harish Chegondi
Cc: igt-dev, ravi.kishore.koppuravuri, zbigniew.kempczynski,
maarten.lankhorst, alexander.usyskin, anshuman.gupta,
soham.purkait, riana.tauro, nishit.sharma
Hi Harish,
On 2026-11-25 at 23:46:43 -0800, Harish Chegondi wrote:
> Align with kernel commit cdeb5e248de11537
> ("drm/xe/uapi: Add additional error components to xe drm_ras").
>
Can you sync with latest drm-next? I checked today with
git log --oneline -- include/uapi/drm/xe_drm.h
69183b706206 drm/xe/uapi: Expose ban reason in EXEC_QUEUE_GET_PROPERTY_BAN
88064894bcce drm/xe/vm: Add srcid to xe_vm_get_property_ioctl fault report
3a8bfa1f2af7 drm/xe: Documentation: fix chars used for subsection
cdeb5e248de1 drm/xe/uapi: Add additional error components to xe drm_ras
5150b57dacf9 drm/xe/uapi: Fix doc formatting and completeness in xe_drm.h
96cc9d79df5f drm/xe/uapi: Fix code examples in xe_drm.h documentation
4bd87e7c4d46 drm/xe/uapi: Fix kernel-doc cross-reference syntax in xe_drm.h
ea842c235828 drm/xe/uapi: Fix wrong names and references in xe_drm.h
65d53c13d43b drm/xe/uapi: Fix grammar errors in xe_drm.h documentation
3233db7682e7 drm/xe/uapi: Fix typos and spelling errors in xe_drm.h documentation
For a way to write description please look into igt
commit a31c48a76e8849084afd70331484a019d55d82f8
("drm-uapi/xe: sync with kernel f99a05cc0b85")
Regards,
Kamil
> Signed-off-by: Harish Chegondi <harish.chegondi@intel.com>
> ---
> include/drm-uapi/xe_drm.h | 11 ++++++++++-
> 1 file changed, 10 insertions(+), 1 deletion(-)
>
> diff --git a/include/drm-uapi/xe_drm.h b/include/drm-uapi/xe_drm.h
> index 5a96a7910..b07f1ef4a 100644
> --- a/include/drm-uapi/xe_drm.h
> +++ b/include/drm-uapi/xe_drm.h
> @@ -2589,6 +2589,12 @@ enum drm_xe_ras_error_component {
> DRM_XE_RAS_ERR_COMP_CORE_COMPUTE = 1,
> /** @DRM_XE_RAS_ERR_COMP_SOC_INTERNAL: SoC Internal Error */
> DRM_XE_RAS_ERR_COMP_SOC_INTERNAL,
> + /** @DRM_XE_RAS_ERR_COMP_DEVICE_MEMORY: Device Memory Error */
> + DRM_XE_RAS_ERR_COMP_DEVICE_MEMORY,
> + /** @DRM_XE_RAS_ERR_COMP_PCIE: PCIe Subsystem Error */
> + DRM_XE_RAS_ERR_COMP_PCIE,
> + /** @DRM_XE_RAS_ERR_COMP_FABRIC: Fabric Subsystem Error */
> + DRM_XE_RAS_ERR_COMP_FABRIC,
> /** @DRM_XE_RAS_ERR_COMP_MAX: Max Error */
> DRM_XE_RAS_ERR_COMP_MAX /* non-ABI */
> };
> @@ -2606,7 +2612,10 @@ enum drm_xe_ras_error_component {
> */
> #define DRM_XE_RAS_ERROR_COMPONENT_NAMES { \
> [DRM_XE_RAS_ERR_COMP_CORE_COMPUTE] = "core-compute", \
> - [DRM_XE_RAS_ERR_COMP_SOC_INTERNAL] = "soc-internal" \
> + [DRM_XE_RAS_ERR_COMP_SOC_INTERNAL] = "soc-internal", \
> + [DRM_XE_RAS_ERR_COMP_DEVICE_MEMORY] = "device-memory", \
> + [DRM_XE_RAS_ERR_COMP_PCIE] = "pcie", \
> + [DRM_XE_RAS_ERR_COMP_FABRIC] = "fabric", \
> }
>
> #if defined(__cplusplus)
> --
> 2.43.0
>
^ permalink raw reply [flat|nested] 8+ messages in thread
end of thread, other threads:[~2026-11-26 16:36 UTC | newest]
Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-11-26 7:46 [PATCH i-g-t 0/6] Add DG Diag error injection tests Harish Chegondi
2026-11-26 7:46 ` [PATCH i-g-t 1/6] meson: Add IGSC as an IGT subproject Harish Chegondi
2026-11-26 7:46 ` [PATCH i-g-t 2/6] lib/xe: Add API for late binding from an input file Harish Chegondi
2026-11-26 7:46 ` [PATCH i-g-t 3/6] drm-uapi/xe: Sync with DRM RAS uapi updates Harish Chegondi
2026-11-26 16:35 ` Kamil Konieczny
2026-11-26 7:46 ` [PATCH i-g-t 4/6] tests/intel/xe_err_injection: Add memory error injection tests Harish Chegondi
2026-11-26 7:46 ` [PATCH i-g-t 5/6] tests/intel/xe_err_injection: Add PUnit error injection test Harish Chegondi
2026-11-26 7:46 ` [PATCH i-g-t 6/6] tests/intel/xe_err_injection: Add CSC error injection tests Harish Chegondi
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.