From: Mika Kuoppala <mika.kuoppala@linux.intel.com>
To: igt-dev@lists.freedesktop.org
Cc: christoph.manszewski@intel.com,
dominik.karol.piatkowski@intel.com, maciej.patelczyk@intel.com,
jan.maslak@intel.com, zbigniew.kempczynski@intel.com,
Mika Kuoppala <mika.kuoppala@linux.intel.com>
Subject: [PATCH i-g-t 11/21] tests/xe_eudebug: Adapt basic-vm-bind and remove basic-vm-bind-extended
Date: Mon, 12 Jan 2026 14:59:57 +0200 [thread overview]
Message-ID: <20260112130008.1649357-12-mika.kuoppala@linux.intel.com> (raw)
In-Reply-To: <20260112130008.1649357-1-mika.kuoppala@linux.intel.com>
From: Christoph Manszewski <christoph.manszewski@intel.com>
EU debug no longer relays events for VM_BIND_OP_[MAP|UNMAP] operations.
Instead it reports newly added 'VM_BIND_OP_DEBUG_DATA_[ADD|REMOVE]'
operations through the event interface. Convert the basic-vm-bind
subtest to use these newly introduced ops. Because debug data can't be
rebound and partially unbound, remove the basic-vm-bind-extended
subtest.
Signed-off-by: Christoph Manszewski <christoph.manszewski@intel.com>
Signed-off-by: Mika Kuoppala <mika.kuoppala@linux.intel.com>
---
tests/intel/xe_eudebug.c | 154 ++++++++++-----------------------------
1 file changed, 39 insertions(+), 115 deletions(-)
diff --git a/tests/intel/xe_eudebug.c b/tests/intel/xe_eudebug.c
index 353828f673..e9efb47da8 100644
--- a/tests/intel/xe_eudebug.c
+++ b/tests/intel/xe_eudebug.c
@@ -60,11 +60,10 @@ static void test_sysfs_toggle(int fd)
#define CREATE_EXEC_QUEUES (1 << 2)
#define VM_BIND (1 << 3)
#define VM_BIND_VM_DESTROY (1 << 4)
-#define VM_BIND_EXTENDED (1 << 5)
-#define VM_BIND_OP_MAP_USERPTR (1 << 6)
-#define VM_BIND_DELAY_UFENCE_ACK (1 << 7)
-#define VM_BIND_UFENCE_DISCONNECT (1 << 8)
-#define VM_BIND_UFENCE_SIGINT_CLIENT (1 << 9)
+#define VM_BIND_OP_MAP_USERPTR (1 << 5)
+#define VM_BIND_DELAY_UFENCE_ACK (1 << 6)
+#define VM_BIND_UFENCE_DISCONNECT (1 << 7)
+#define VM_BIND_UFENCE_SIGINT_CLIENT (1 << 8)
#define TEST_FAULTABLE (1 << 30)
#define TEST_DISCOVERY (1 << 31)
@@ -74,41 +73,58 @@ static void test_sysfs_toggle(int fd)
static void basic_vm_bind_client(struct xe_eudebug_client *c)
{
- struct drm_xe_vm_bind_op_ext_attach_debug *ext = NULL;
uint32_t vm = xe_eudebug_client_vm_create(c, DRM_XE_VM_CREATE_FLAG_LR_MODE, 0);
- size_t bo_size = xe_get_default_alignment(c->fd);
bool test_discovery = c->flags & TEST_DISCOVERY;
- uint32_t bo = xe_bo_create(c->fd, 0, bo_size,
- system_memory(c->fd), 0);
uint64_t addr = 0x1a0000;
+ size_t range = 0x1000;
- xe_eudebug_client_vm_bind_flags(c, vm, bo, 0, addr,
- bo_size, 0, NULL, 0, to_user_pointer(ext));
+ xe_eudebug_client_vm_bind_debug_data_add(c, vm, 0, addr, range,
+ DRM_XE_VM_BIND_DEBUG_DATA_PSEUDO_MODULE_AREA,
+ NULL, NULL, 0);
if (test_discovery) {
xe_eudebug_client_signal_stage(c, STAGE_PRE_DEBUG_RESOURCES_DONE);
xe_eudebug_client_wait_stage(c, STAGE_DISCOVERY_DONE);
}
- xe_eudebug_client_vm_unbind(c, vm, 0, addr, bo_size);
+ xe_eudebug_client_vm_bind_debug_data_remove(c, vm, addr, range);
- gem_close(c->fd, bo);
xe_eudebug_client_vm_destroy(c, vm);
}
+static void vm_bind_add_debug_data(struct xe_eudebug_client *c, uint32_t vm,
+ uint64_t addr, uint64_t range)
+{
+ struct drm_xe_vm_bind_op_ext_debug_data op_ext = { 0, };
+
+ op_ext.base.name = XE_VM_BIND_OP_EXTENSIONS_DEBUG_DATA;
+ op_ext.base.next_extension = 0;
+ op_ext.base.pad = 0;
+
+ op_ext.pseudopath = DRM_XE_VM_BIND_DEBUG_DATA_PSEUDO_MODULE_AREA;
+ op_ext.flags = DRM_XE_VM_BIND_DEBUG_DATA_FLAG_PSEUDO;
+
+ op_ext.addr = addr;
+ op_ext.range = range;
+ op_ext.offset = 0;
+ op_ext.reserved = 0;
+
+ ___xe_vm_bind(c->fd, vm, 0, 0, 0, 0, 0,
+ DRM_XE_VM_BIND_OP_ADD_DEBUG_DATA, 0, NULL, 0, 0,
+ 0, 0, to_user_pointer(&op_ext));
+}
+
static void basic_vm_bind_vm_destroy_client(struct xe_eudebug_client *c)
{
uint32_t vm = xe_eudebug_client_vm_create(c, DRM_XE_VM_CREATE_FLAG_LR_MODE, 0);
- size_t bo_size = xe_get_default_alignment(c->fd);
bool test_discovery = c->flags & TEST_DISCOVERY;
- uint32_t bo = xe_bo_create(c->fd, 0, bo_size,
- system_memory(c->fd), 0);
uint64_t addr = 0x1a0000;
+ uint64_t range = 0x1000;
if (test_discovery) {
vm = xe_vm_create(c->fd, DRM_XE_VM_CREATE_FLAG_LR_MODE, 0);
- xe_vm_bind_async(c->fd, vm, 0, bo, 0, addr, bo_size, NULL, 0);
+ vm_bind_add_debug_data(c, vm, addr, range);
xe_vm_destroy(c->fd, vm);
@@ -116,11 +132,11 @@ static void basic_vm_bind_vm_destroy_client(struct xe_eudebug_client *c)
xe_eudebug_client_wait_stage(c, STAGE_DISCOVERY_DONE);
} else {
vm = xe_eudebug_client_vm_create(c, DRM_XE_VM_CREATE_FLAG_LR_MODE, 0);
- xe_eudebug_client_vm_bind(c, vm, bo, 0, addr, bo_size);
+ xe_eudebug_client_vm_bind_debug_data_add(c, vm, 0, addr, range,
+ DRM_XE_VM_BIND_DEBUG_DATA_PSEUDO_MODULE_AREA,
+ NULL, NULL, 0);
xe_eudebug_client_vm_destroy(c, vm);
}
-
- gem_close(c->fd, bo);
}
#define BO_ITEMS 4096
@@ -307,75 +323,6 @@ static void free_bind_list(struct xe_eudebug_client *c, struct bind_list *bl)
free(bl);
}
-static void vm_bind_client(struct xe_eudebug_client *c)
-{
- uint64_t op_ref_seqno, ref_seqno;
- struct bind_list *bl;
- bool test_discovery = c->flags & TEST_DISCOVERY;
- size_t bo_size = 3 * xe_get_default_alignment(c->fd);
- uint32_t bo[2] = {
- xe_bo_create(c->fd, 0, bo_size, system_memory(c->fd), 0),
- xe_bo_create(c->fd, 0, bo_size, system_memory(c->fd), 0),
- };
- uint32_t vm = xe_eudebug_client_vm_create(c, DRM_XE_VM_CREATE_FLAG_LR_MODE, 0);
- uint64_t addr[] = {0x2a0000, 0x3a0000};
- uint64_t rebind_bo_offset = 2 * bo_size / 3;
- uint64_t size = bo_size / 3;
- int i = 0;
-
- if (test_discovery) {
- xe_vm_bind_async(c->fd, vm, 0, bo[0], 0, addr[0], bo_size, NULL, 0);
-
- xe_vm_unbind_async(c->fd, vm, 0, 0, addr[0] + size, size, NULL, 0);
-
- xe_vm_bind_async(c->fd, vm, 0, bo[1], 0, addr[1], bo_size, NULL, 0);
-
- xe_vm_bind_async(c->fd, vm, 0, bo[1], rebind_bo_offset, addr[1], size, NULL, 0);
-
- bl = create_bind_list(c->fd, system_memory(c->fd), vm, 4, 0);
- xe_vm_bind_array(c->fd, bl->vm, 0, bl->bind_ops, bl->n, NULL, 0);
-
- xe_vm_unbind_all_async(c->fd, vm, 0, bo[0], NULL, 0);
-
- xe_eudebug_client_vm_bind_event(c, DRM_XE_EUDEBUG_EVENT_STATE_CHANGE,
- bl->vm, 0, bl->n + 2, &ref_seqno);
-
- xe_eudebug_client_vm_bind_op_event(c, DRM_XE_EUDEBUG_EVENT_CREATE, ref_seqno,
- &op_ref_seqno, addr[1], size, 0);
- xe_eudebug_client_vm_bind_op_event(c, DRM_XE_EUDEBUG_EVENT_CREATE, ref_seqno,
- &op_ref_seqno, addr[1] + size, size * 2, 0);
-
- for (i = 0; i < bl->n; i++)
- xe_eudebug_client_vm_bind_op_event(c, DRM_XE_EUDEBUG_EVENT_CREATE,
- ref_seqno, &op_ref_seqno,
- bl->bind_ops[i].addr,
- bl->bind_ops[i].range, 0);
-
- xe_eudebug_client_signal_stage(c, STAGE_PRE_DEBUG_RESOURCES_DONE);
- xe_eudebug_client_wait_stage(c, STAGE_DISCOVERY_DONE);
- } else {
- xe_eudebug_client_vm_bind(c, vm, bo[0], 0, addr[0], bo_size);
- xe_eudebug_client_vm_unbind(c, vm, 0, addr[0] + size, size);
-
- xe_eudebug_client_vm_bind(c, vm, bo[1], 0, addr[1], bo_size);
- xe_eudebug_client_vm_bind(c, vm, bo[1], rebind_bo_offset, addr[1], size);
-
- bl = create_bind_list(c->fd, system_memory(c->fd), vm, 4, 0);
- do_bind_list(c, bl, false);
- }
-
- xe_vm_unbind_all_async(c->fd, vm, 0, bo[1], NULL, 0);
-
- xe_eudebug_client_vm_bind_event(c, DRM_XE_EUDEBUG_EVENT_STATE_CHANGE, vm, 0,
- 1, &ref_seqno);
- xe_eudebug_client_vm_bind_op_event(c, DRM_XE_EUDEBUG_EVENT_DESTROY, ref_seqno,
- &op_ref_seqno, 0, 0, 0);
-
- gem_close(c->fd, bo[0]);
- gem_close(c->fd, bo[1]);
- xe_eudebug_client_vm_destroy(c, vm);
-}
-
static void run_basic_client(struct xe_eudebug_client *c)
{
int i;
@@ -432,9 +379,6 @@ static void run_basic_client(struct xe_eudebug_client *c)
if (c->flags & VM_BIND)
basic_vm_bind_client(c);
- if (c->flags & VM_BIND_EXTENDED)
- vm_bind_client(c);
-
if (c->flags & VM_BIND_VM_DESTROY)
basic_vm_bind_vm_destroy_client(c);
}
@@ -891,20 +835,13 @@ static void test_read_event(int fd)
* SUBTEST: basic-vm-bind
* Functionality: VM bind event
* Description:
- * Attach the debugger to a process that performs synchronous vm bind
- * and vm unbind.
+ * Attach the debugger to a process that adds and removes vm debug data.
*
* SUBTEST: basic-vm-bind-vm-destroy
* Functionality: VM bind event
* Description:
- * Attach the debugger to a process that performs vm bind, and destroys
- * the vm without unbinding. Make sure that we don't get unbind events.
- *
- * SUBTEST: basic-vm-bind-extended
- * Functionality: VM bind event
- * Description:
- * Attach the debugger to a process that performs bind, bind array, rebind,
- * partial unbind, unbind and unbind all operations.
+ * Attach the debugger to a process that adds vm debug data, and destroys the vm without
+ * removing debug data. Make sure that we don't get debug data remove events.
*
* SUBTEST: multigpu-basic-client
* Mega feature: MultiGPU
@@ -955,13 +892,6 @@ static void test_basic_sessions(int fd, unsigned int flags, int count, bool matc
* Attach the debugger to a process that performs vm bind, and destroys
* the vm without unbinding before attaching. Make sure that we don't get
* any bind/unbind and vm create/destroy events.
- *
- * SUBTEST: basic-vm-bind-extended-discovery
- * Functionality: VM bind event
- * Description:
- * Attach the debugger to a process that performs bind, bind array, rebind,
- * partial unbind, and unbind all operations before attaching. Ensure that
- * we get a only a singe 'VM_BIND' event from the discovery worker.
*/
static void test_basic_discovery(int fd, unsigned int flags, bool match_opposite)
{
@@ -2661,12 +2591,6 @@ int igt_main()
igt_subtest("basic-vm-bind-vm-destroy-discovery")
test_basic_discovery(fd, VM_BIND_VM_DESTROY, false);
- igt_subtest("basic-vm-bind-extended")
- test_basic_sessions(fd, VM_BIND_EXTENDED, 1, true);
-
- igt_subtest("basic-vm-bind-extended-discovery")
- test_basic_discovery(fd, VM_BIND_EXTENDED, true);
-
igt_subtest("discovery-race")
test_race_discovery(fd, 0, 4);
--
2.43.0
next prev parent reply other threads:[~2026-01-12 13:00 UTC|newest]
Thread overview: 23+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-01-12 12:59 [PATCH i-g-t 00/21] eudebug: uapi changes on connect and metadata Mika Kuoppala
2026-01-12 12:59 ` [PATCH i-g-t 01/21] lib/xe/xe_eudebug: Dont compare if everything filtered Mika Kuoppala
2026-01-12 12:59 ` [PATCH i-g-t 02/21] lib/xe/xe_eudebug: Make sure debugger drains events Mika Kuoppala
2026-01-12 12:59 ` [PATCH i-g-t 03/21] lib/xe/xe_eudebug: Avoid matching if event is filtered Mika Kuoppala
2026-01-12 12:59 ` [PATCH i-g-t 04/21] tests/intel/xe_eudebug_sriov: Align expected return code Mika Kuoppala
2026-01-12 13:12 ` Piatkowski, Dominik Karol
2026-01-12 12:59 ` [PATCH i-g-t 05/21] eudebug: Remove metadata tests Mika Kuoppala
2026-01-12 12:59 ` [PATCH i-g-t 06/21] eudebug: Remove EVENT_OPEN and adjust tests Mika Kuoppala
2026-01-12 12:59 ` [PATCH i-g-t 07/21] tests/xe_eudebug: Adapt basic-read-event Mika Kuoppala
2026-01-12 12:59 ` [PATCH i-g-t 08/21] tests/intel/xe_eudebug: Fix connect-user test Mika Kuoppala
2026-01-12 12:59 ` [PATCH i-g-t 09/21] tests/intel/xe_eudebug: Mold ufence reconnect test to disconnect Mika Kuoppala
2026-01-12 12:59 ` [PATCH i-g-t 10/21] lib/xe_eudebug: Adapt to vm_bind debug data Mika Kuoppala
2026-01-12 12:59 ` Mika Kuoppala [this message]
2026-01-12 12:59 ` [PATCH i-g-t 12/21] tests/xe_eudebug: Adapt some ufence reliant tests to new vm_bind event interface Mika Kuoppala
2026-01-12 12:59 ` [PATCH i-g-t 13/21] tests/xe_eudebug: Adapt vm-bind-clear* subtests to debug data Mika Kuoppala
2026-01-12 13:00 ` [PATCH i-g-t 14/21] lib/xe_eudebug: Remove unused xe_eudebug_client_vm_bind wrappers Mika Kuoppala
2026-01-12 13:00 ` [PATCH i-g-t 15/21] tests/xe_eudebug: Add vm-bind-debug-data-ufence subtest Mika Kuoppala
2026-01-12 13:00 ` [PATCH i-g-t 16/21] lib/intel_batchbuffer: Add dummy OP_DEBUG_DATA operation to __xe_alloc_bind_ops Mika Kuoppala
2026-01-12 13:00 ` [PATCH i-g-t 17/21] tests/xe_eudebug_online: Adapt set-breakpoint test to work with new vm bind event interface Mika Kuoppala
2026-01-12 13:00 ` [PATCH i-g-t 18/21] tests/xe_eudebug_online: Adapt several subtests " Mika Kuoppala
2026-01-12 13:00 ` [PATCH i-g-t 19/21] lib/xe/xe_eudebug: Add callback for session work Mika Kuoppala
2026-01-12 13:00 ` [PATCH i-g-t 20/21] tests/intel/xe_eudebug: Add render node testing Mika Kuoppala
2026-01-12 13:00 ` [PATCH i-g-t 21/21] eudebug: Update xe_drm_eudebug.h uapi Mika Kuoppala
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=20260112130008.1649357-12-mika.kuoppala@linux.intel.com \
--to=mika.kuoppala@linux.intel.com \
--cc=christoph.manszewski@intel.com \
--cc=dominik.karol.piatkowski@intel.com \
--cc=igt-dev@lists.freedesktop.org \
--cc=jan.maslak@intel.com \
--cc=maciej.patelczyk@intel.com \
--cc=zbigniew.kempczynski@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox