Skip to contentSkip to conversation

tests/intel/xe_configfs: Test invalid engine with valid class

PATCH Superseded Lucas De Marchi 3 participants 5 messages Oct 29, 2025 – Nov 4, 2025

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore
#0 lore raw

PATCH 1/2 tests/intel/xe_configfs: Test invalid engine with valid class

ctx_restore_* expects only the engine class. Pass in an invalid engine with a valid engine class to make sure it's correctly handled in the kernel.

---
 tests/intel/xe_configfs.c | 3 +++
 1 file changed, 3 insertions(+)
tests/intel/xe_configfs.c +3 -0
index 7a7a7edf4..ecba69dbd 100644
@@ -177,6 +177,9 @@ static void test_ctx_restore_invalid(int configfs_device_fd, const char *type)
 		{ .test = "invalid-reg-addr-only",
 		  .in = "rcs reg 4F100",
 		},
+		{ .test = "invalid-engine-instance",
+		  .in = "rcs0 reg 4F100 DEADBEEF",
+		},
 	};
 	char buf[4096] = { };
 	char file[64] = { };
Signature · 1 line
2.51.0
#1 lore raw

PATCH 2/2 tests/intel/xe_configfs: Check for invalid char in the beginning

The test was supposed to check the beginning and the end of the number, but was actually doing the same check (the end) twice. Fix it.

---
 tests/intel/xe_configfs.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
tests/intel/xe_configfs.c +3 -3
index ecba69dbd..08b0b0ae8 100644
@@ -168,11 +168,11 @@ static void test_ctx_restore_invalid(int configfs_device_fd, const char *type)
 		{ .test = "invalid-type",
 		  .in = "rcs 11000001 4F100 DEADBEEF",
 		},
-		{ .test = "invalid-number",
+		{ .test = "invalid-number-end",
 		  .in = "rcs cmd 1100000g 4F100 DEADBEEF",
 		},
-		{ .test = "invalid-number",
-		  .in = "rcs cmd 1100000g 4F100 DEADBEEF",
+		{ .test = "invalid-number-start",
+		  .in = "rcs cmd g1100000 4F100 DEADBEEF",
 		},
 		{ .test = "invalid-reg-addr-only",
 		  .in = "rcs reg 4F100",
Signature · 1 line
2.51.0
Reviewed-by on v1 2/2
#2 lore raw

Re: [PATCH i-g-t 2/2] tests/intel/xe_configfs: Check for invalid char in the beginning

Hi Lucas,

Quoted 14 lines · Lucas De Marchi

The test was supposed to check the beginning and the end of the number, but was actually doing the same check (the end) twice. Fix it.

---
 tests/intel/xe_configfs.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
tests/intel/xe_configfs.c +0 -0
index ecba69dbd..08b0b0ae8 100644
@@ -168,11 +168,11 @@ static void test_ctx_restore_invalid(int configfs_device_fd, const char *type)
 		{ .test = "invalid-type",

tests/intel/xe_configfs.c static void test_ctx_restore_invalid(int configfs_device_fd, const char *type) · line 175

Quoted 10 lines
tests/intel/xe_configfs.c +3 -3
 		  .in = "rcs 11000001 4F100 DEADBEEF",
 		},
-		{ .test = "invalid-number",
+		{ .test = "invalid-number-end",
 		  .in = "rcs cmd 1100000g 4F100 DEADBEEF",
 		},
-		{ .test = "invalid-number",
-		  .in = "rcs cmd 1100000g 4F100 DEADBEEF",
+		{ .test = "invalid-number-start",
+		  .in = "rcs cmd g1100000 4F100 DEADBEEF",

Looks good, what about invalid char in middle?

Quoted 6 lines
tests/intel/xe_configfs.c +0 -0
 		},
 		{ .test = "invalid-reg-addr-only",
 		  .in = "rcs reg 4F100",
Signature · 1 line
2.51.0
#3 lore raw

Re: [PATCH i-g-t 2/2] tests/intel/xe_configfs: Check for invalid char in the beginning

Quoted 20 lines · Kamil Konieczny

Hi Lucas,

Quoted 18 lines · Lucas De Marchi

The test was supposed to check the beginning and the end of the number, but was actually doing the same check (the end) twice. Fix it.

---
 tests/intel/xe_configfs.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
tests/intel/xe_configfs.c +1 -1
index ecba69dbd..08b0b0ae8 100644
@@ -168,11 +168,11 @@ static void test_ctx_restore_invalid(int configfs_device_fd, const char *type)
 		{ .test = "invalid-type",
 		  .in = "rcs 11000001 4F100 DEADBEEF",
 		},
-		{ .test = "invalid-number",
+		{ .test = "invalid-number-end",
Quoted 8 lines

tests/intel/xe_configfs.c static void test_ctx_restore_invalid(int configfs_device_fd, const char *type) · line 175

Quoted 6 lines
tests/intel/xe_configfs.c +2 -2
 		  .in = "rcs cmd 1100000g 4F100 DEADBEEF",
 		},
-		{ .test = "invalid-number",
-		  .in = "rcs cmd 1100000g 4F100 DEADBEEF",
+		{ .test = "invalid-number-start",
+		  .in = "rcs cmd g1100000 4F100 DEADBEEF",

Looks good, what about invalid char in middle?

yeah, makes sense... I added one additional test and sent a v2

Quoted 2 lines

thanks
Lucas De Marchi

Reviewed-by on v1 1/2
#4 lore raw
In reply to Lucas De Marchi

-----Original Message-----
From: De Marchi, Lucas <[email protected]>
Sent: Wednesday, October 29, 2025 3:00 PM
To: [email protected]
Cc: Tauro, Riana <[email protected]>; De Marchi, Lucas <[email protected]>; Cavitt, Jonathan <[email protected]>
Subject: [PATCH i-g-t 1/2] tests/intel/xe_configfs: Test invalid engine with valid class

Quoted 7 lines

ctx_restore_* expects only the engine class. Pass in an invalid engine with a valid engine class to make sure it's correctly handled in the kernel.

-Jonathan Cavitt

Quoted 22 lines
---
 tests/intel/xe_configfs.c | 3 +++
 1 file changed, 3 insertions(+)
tests/intel/xe_configfs.c +3 -0
index 7a7a7edf4..ecba69dbd 100644
@@ -177,6 +177,9 @@ static void test_ctx_restore_invalid(int configfs_device_fd, const char *type)
 		{ .test = "invalid-reg-addr-only",
 		  .in = "rcs reg 4F100",
 		},
+		{ .test = "invalid-engine-instance",
+		  .in = "rcs0 reg 4F100 DEADBEEF",
+		},
 	};
 	char buf[4096] = { };
 	char file[64] = { };
Signature · 1 line
2.51.0