From: Christoph Manszewski <christoph.manszewski@intel.com>
To: igt-dev@lists.freedesktop.org
Cc: "Zbigniew Kempczyński" <zbigniew.kempczynski@intel.com>,
"Kamil Konieczny" <kamil.konieczny@linux.intel.com>,
"Dominik Grzegorzek" <dominik.grzegorzek@intel.com>,
"Maciej Patelczyk" <maciej.patelczyk@intel.com>,
"Dominik Karol Piątkowski" <dominik.karol.piatkowski@intel.com>,
"Pawel Sikora" <pawel.sikora@intel.com>,
"Andrzej Hajda" <andrzej.hajda@intel.com>,
"Kolanupaka Naveena" <kolanupaka.naveena@intel.com>,
"Mika Kuoppala" <mika.kuoppala@intel.com>,
"Gwan-gyeong Mun" <gwan-gyeong.mun@intel.com>
Subject: [PATCH i-g-t v2 19/66] tests/xe_eudebug: Add basic vm-bind coverage
Date: Tue, 30 Jul 2024 13:44:36 +0200 [thread overview]
Message-ID: <20240730114523.334156-20-christoph.manszewski@intel.com> (raw)
In-Reply-To: <20240730114523.334156-1-christoph.manszewski@intel.com>
Add basic coverage for vm-bind event delivery mechanism that enables the
user to track client vm-bind ioctl calls.
Signed-off-by: Christoph Manszewski <christoph.manszewski@intel.com>
Cc: Dominik Grzegorzek <dominik.grzegorzek@intel.com>
---
tests/intel/xe_eudebug.c | 117 ++++++++++++++++++++++++++++++++++++---
1 file changed, 109 insertions(+), 8 deletions(-)
diff --git a/tests/intel/xe_eudebug.c b/tests/intel/xe_eudebug.c
index 5080fdf5b..ce6c37c6d 100644
--- a/tests/intel/xe_eudebug.c
+++ b/tests/intel/xe_eudebug.c
@@ -22,6 +22,41 @@
#include "xe/xe_ioctl.h"
#include "xe/xe_query.h"
+#define CREATE_VMS (1 << 0)
+#define CREATE_EXEC_QUEUES (1 << 1)
+#define VM_BIND (1 << 2)
+#define VM_BIND_VM_DESTROY (1 << 3)
+#define VM_BIND_EXTENDED (1 << 4)
+
+static void basic_vm_bind_client(int fd, struct xe_eudebug_client *c)
+{
+ uint32_t vm = xe_eudebug_client_vm_create(c, fd, 0, 0);
+ size_t bo_size = xe_get_default_alignment(fd);
+ uint32_t bo = xe_bo_create(fd, 0, bo_size,
+ system_memory(fd), 0);
+ uint64_t addr = 0x1a0000;
+
+ xe_eudebug_client_vm_bind(c, fd, vm, bo, 0, addr, bo_size);
+ xe_eudebug_client_vm_unbind(c, fd, vm, 0, addr, bo_size);
+
+ gem_close(fd, bo);
+ xe_eudebug_client_vm_destroy(c, fd, vm);
+}
+
+static void basic_vm_bind_vm_destroy_client(int fd, struct xe_eudebug_client *c)
+{
+ uint32_t vm = xe_eudebug_client_vm_create(c, fd, 0, 0);
+ size_t bo_size = xe_get_default_alignment(fd);
+ uint32_t bo = xe_bo_create(fd, 0, bo_size,
+ system_memory(fd), 0);
+ uint64_t addr = 0x1a0000;
+
+ xe_eudebug_client_vm_bind(c, fd, vm, bo, 0, addr, bo_size);
+ xe_eudebug_client_vm_destroy(c, fd, vm);
+
+ gem_close(fd, bo);
+}
+
#define BO_ADDR 0x1a0000
#define BO_ITEMS 4096
#define MIN_BO_SIZE (BO_ITEMS * sizeof(uint64_t))
@@ -149,8 +184,41 @@ static void check_bind_list(struct bind_list *bl)
}
}
-#define CREATE_VMS (1 << 0)
-#define CREATE_EXEC_QUEUES (1 << 1)
+static void vm_bind_client(int fd, struct xe_eudebug_client *c)
+{
+ uint64_t op_ref_seqno, ref_seqno;
+ struct bind_list *bl;
+ size_t bo_size = 3 * xe_get_default_alignment(fd);
+ uint32_t bo[2] = {
+ xe_bo_create(fd, 0, bo_size, system_memory(fd), 0),
+ xe_bo_create(fd, 0, bo_size, system_memory(fd), 0),
+ };
+ uint32_t vm = xe_eudebug_client_vm_create(c, fd, 0, 0);
+ uint64_t addr[] = {0x2a0000, 0x3a0000};
+ uint64_t rebind_bo_offset = 2 * bo_size / 3;
+ uint64_t size = bo_size / 3;
+
+ xe_eudebug_client_vm_bind(c, fd, vm, bo[0], 0, addr[0], bo_size);
+ xe_eudebug_client_vm_unbind(c, fd, vm, 0, addr[0] + size, size);
+
+ xe_eudebug_client_vm_bind(c, fd, vm, bo[1], 0, addr[1], bo_size);
+ xe_eudebug_client_vm_bind(c, fd, vm, bo[1], rebind_bo_offset, addr[1], size);
+
+ bl = create_bind_list(fd, system_memory(fd), vm, 4);
+ do_bind_list(c, bl, NULL);
+
+ xe_vm_unbind_all_async(fd, vm, 0, bo[1], NULL, 0);
+
+ xe_eudebug_client_vm_bind_event(c, DRM_XE_EUDEBUG_EVENT_STATE_CHANGE, fd, 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(fd, bo[0]);
+ gem_close(fd, bo[1]);
+ xe_eudebug_client_vm_destroy(c, fd, vm);
+}
+
static void run_basic_client(struct xe_eudebug_client *c)
{
int fd, i;
@@ -216,6 +284,15 @@ static void run_basic_client(struct xe_eudebug_client *c)
xe_eudebug_client_vm_destroy(c, fd, vm);
}
+ if (c->flags & VM_BIND)
+ basic_vm_bind_client(fd, c);
+
+ if (c->flags & VM_BIND_EXTENDED)
+ vm_bind_client(fd, c);
+
+ if (c->flags & VM_BIND_VM_DESTROY)
+ basic_vm_bind_vm_destroy_client(fd, c);
+
xe_device_put(fd);
xe_eudebug_client_close_driver(c, fd);
}
@@ -437,13 +514,28 @@ static void test_read_event(int fd)
* Description:
* Attach the debugger to process which creates and destroys a few %arg[1].
*
+ * SUBTEST: basic-vm-bind
+ * Description:
+ * Attach the debugger to a process that performs synchronous vm bind
+ * and vm unbind.
+ *
+ * SUBTEST: basic-vm-bind-vm-destroy
+ * 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
+ * Description:
+ * Attach the debugger to a process that performs bind, bind array, rebind,
+ * partial unbind, unbind and unbind all operations.
+ *
* arg[1]:
*
* @vms: vms
* @exec-queues: exec queues
*/
-static void test_basic_sessions(int fd, unsigned int flags, int count)
+static void test_basic_sessions(int fd, unsigned int flags, int count, bool match_opposite)
{
struct xe_eudebug_session **s;
int i;
@@ -459,7 +551,7 @@ static void test_basic_sessions(int fd, unsigned int flags, int count)
xe_eudebug_session_run(s[i]);
for (i = 0; i < count; i++)
- xe_eudebug_session_check(s[i], true, 0);
+ xe_eudebug_session_check(s[i], match_opposite, 0);
for (i = 0; i < count; i++)
xe_eudebug_session_destroy(s[i]);
@@ -904,19 +996,28 @@ igt_main
test_read_event(fd);
igt_subtest("basic-client")
- test_basic_sessions(fd, 0, 1);
+ test_basic_sessions(fd, 0, 1, true);
igt_subtest("basic-vm-access")
test_vm_access(fd, 0, 1);
igt_subtest("multiple-sessions")
- test_basic_sessions(fd, CREATE_VMS | CREATE_EXEC_QUEUES, 4);
+ test_basic_sessions(fd, CREATE_VMS | CREATE_EXEC_QUEUES, 4, true);
igt_subtest("basic-vms")
- test_basic_sessions(fd, CREATE_VMS, 1);
+ test_basic_sessions(fd, CREATE_VMS, 1, true);
igt_subtest("basic-exec-queues")
- test_basic_sessions(fd, CREATE_EXEC_QUEUES, 1);
+ test_basic_sessions(fd, CREATE_EXEC_QUEUES, 1, true);
+
+ igt_subtest("basic-vm-bind")
+ test_basic_sessions(fd, VM_BIND, 1, true);
+
+ igt_subtest("basic-vm-bind-vm-destroy")
+ test_basic_sessions(fd, VM_BIND_VM_DESTROY, 1, false);
+
+ igt_subtest("basic-vm-bind-extended")
+ test_basic_sessions(fd, VM_BIND_EXTENDED, 1, true);
igt_subtest("discovery-race")
test_race_discovery(fd, 0, 4);
--
2.34.1
next prev parent reply other threads:[~2024-07-30 11:47 UTC|newest]
Thread overview: 113+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-07-30 11:44 [PATCH i-g-t v2 00/66] Test coverage for GPU debug support Christoph Manszewski
2024-07-30 11:44 ` [PATCH i-g-t v2 01/66] drm-uapi/xe: Sync with eudebug uapi Christoph Manszewski
2024-08-08 13:18 ` Kamil Konieczny
2024-08-08 15:05 ` Manszewski, Christoph
2024-07-30 11:44 ` [PATCH i-g-t v2 02/66] tests/xe_eudebug: Test eudebug connection Christoph Manszewski
2024-08-01 9:16 ` Grzegorzek, Dominik
2024-08-02 10:14 ` Manszewski, Christoph
2024-08-01 9:30 ` Piatkowski, Dominik Karol
2024-07-30 11:44 ` [PATCH i-g-t v2 03/66] lib/xe_eudebug: Introduce eu debug testing framework Christoph Manszewski
2024-08-01 11:18 ` Piatkowski, Dominik Karol
2024-07-30 11:44 ` [PATCH i-g-t v2 04/66] lib/xe_eudebug: Allow client to wait for debugger Christoph Manszewski
2024-07-30 11:44 ` [PATCH i-g-t v2 05/66] lib/xe_eudebug: Add exec_queue support Christoph Manszewski
2024-07-30 11:44 ` [PATCH i-g-t v2 06/66] lib/xe_eudebug: Add attention events support Christoph Manszewski
2024-08-01 11:20 ` Piatkowski, Dominik Karol
2024-07-30 11:44 ` [PATCH i-g-t v2 07/66] lib/xe_ioctl: Add wrapper with vm_bind_op extension parameter Christoph Manszewski
2024-08-01 11:23 ` Piatkowski, Dominik Karol
2024-07-30 11:44 ` [PATCH i-g-t v2 08/66] lib/xe_eudebug: Add support for vm_bind events Christoph Manszewski
2024-08-01 11:28 ` Piatkowski, Dominik Karol
2024-07-30 11:44 ` [PATCH i-g-t v2 09/66] lib/xe_eudebug: Add metadata support Christoph Manszewski
2024-07-30 11:44 ` [PATCH i-g-t v2 10/66] lib/xe_eudebug: Add support for user fence acking Christoph Manszewski
2024-08-01 11:34 ` Piatkowski, Dominik Karol
2024-07-30 11:44 ` [PATCH i-g-t v2 11/66] lib/xe_eudebug: Add support for dynamic debugger sysfs toggle Christoph Manszewski
2024-08-01 11:51 ` Piatkowski, Dominik Karol
2024-07-30 11:44 ` [PATCH i-g-t v2 12/66] tests/xe_eudebug: Test open close events Christoph Manszewski
2024-08-01 11:53 ` Piatkowski, Dominik Karol
2024-07-30 11:44 ` [PATCH i-g-t v2 13/66] tests/xe_eudebug: Exercise read_event ioctl Christoph Manszewski
2024-08-01 12:01 ` Piatkowski, Dominik Karol
2024-07-30 11:44 ` [PATCH i-g-t v2 14/66] tests/xe_eudebug: Add vm events sanity check Christoph Manszewski
2024-08-01 12:04 ` Piatkowski, Dominik Karol
2024-07-30 11:44 ` [PATCH i-g-t v2 15/66] tests/xe_eudebug: Race discovery against eudebug attach Christoph Manszewski
2024-08-01 12:08 ` Piatkowski, Dominik Karol
2024-07-30 11:44 ` [PATCH i-g-t v2 16/66] tests/xe_eudebug: Introduce basic exec_queue testing Christoph Manszewski
2024-08-01 12:15 ` Piatkowski, Dominik Karol
2024-07-30 11:44 ` [PATCH i-g-t v2 17/66] tests/xe_eudebug: Include exec queues in discovery testing Christoph Manszewski
2024-07-30 11:44 ` [PATCH i-g-t v2 18/66] tests/xe_eudebug: Add vm open/pread/pwrite basic tests Christoph Manszewski
2024-08-01 12:20 ` Piatkowski, Dominik Karol
2024-07-30 11:44 ` Christoph Manszewski [this message]
2024-07-30 11:44 ` [PATCH i-g-t v2 20/66] tests/xe_eudebug: Exercise debug metadata events sent to debugger Christoph Manszewski
2024-07-30 11:44 ` [PATCH i-g-t v2 21/66] tests/xe_eudebug: Add support for dynamic debugger sysfs toggle Christoph Manszewski
2024-08-01 12:25 ` Piatkowski, Dominik Karol
2024-07-30 11:44 ` [PATCH i-g-t v2 22/66] tests/xe_eudebug: Add coverage for sysfs debugger toggle Christoph Manszewski
2024-08-01 12:28 ` Piatkowski, Dominik Karol
2024-07-30 11:44 ` [PATCH i-g-t v2 23/66] lib/xe_eudebug: Allow debugger to wait for client Christoph Manszewski
2024-08-01 12:31 ` Piatkowski, Dominik Karol
2024-07-30 11:44 ` [PATCH i-g-t v2 24/66] tests/xe_eudebug: Add vm-bind discovery tests Christoph Manszewski
2024-07-30 11:44 ` [PATCH i-g-t v2 25/66] tests/xe_eudebug: Add basic-vm-bind-metadata-discovery Christoph Manszewski
2024-07-30 11:44 ` [PATCH i-g-t v2 26/66] tests/xe_eudebug: Add basic-vm-access-parameters test Christoph Manszewski
2024-08-01 12:42 ` Piatkowski, Dominik Karol
2024-07-30 11:44 ` [PATCH i-g-t v2 27/66] lib/xe_eudebug: Add mutex for log events write Christoph Manszewski
2024-08-01 12:43 ` Piatkowski, Dominik Karol
2024-07-30 11:44 ` [PATCH i-g-t v2 28/66] tests/xe_eudebug: Add basic-client-th test Christoph Manszewski
2024-08-01 12:49 ` Piatkowski, Dominik Karol
2024-07-30 11:44 ` [PATCH i-g-t v2 29/66] tests/xe_eudebug: Added connect-user test Christoph Manszewski
2024-07-30 11:44 ` [PATCH i-g-t v2 30/66] tests/xe_eudebug: Add discovery-race-vmbind subtest Christoph Manszewski
2024-08-01 6:25 ` Piatkowski, Dominik Karol
2024-07-30 11:44 ` [PATCH i-g-t v2 31/66] tests/xe_eudebug: Add userptr variant of basic-vm-access test Christoph Manszewski
2024-07-30 11:44 ` [PATCH i-g-t v2 32/66] tests/xe_eudebug: Add basic-vm-bind-ufence Christoph Manszewski
2024-07-30 11:44 ` [PATCH i-g-t v2 33/66] tests/xe_eudebug: Add multigpu scenarios Christoph Manszewski
2024-07-30 11:44 ` [PATCH i-g-t v2 34/66] tests/xe_eudebug: Add vm-bind-clear test Christoph Manszewski
2024-07-30 11:44 ` [PATCH i-g-t v2 35/66] tests/xe_eudebug: Exercise lseek Christoph Manszewski
2024-07-30 11:44 ` [PATCH i-g-t v2 36/66] tests/xe_eudebug: Test multiple bo sizes Christoph Manszewski
2024-07-30 11:44 ` [PATCH i-g-t v2 37/66] lib/gpgpu_shader: Extend shader building library Christoph Manszewski
2024-07-30 11:44 ` [PATCH i-g-t v2 38/66] tests/xe_exec_sip: Port tests for shaders and sip Christoph Manszewski
2024-07-30 11:44 ` [PATCH i-g-t v2 39/66] tests/xe_exec_sip: Check if we reset due to unhandled attention Christoph Manszewski
2024-08-01 12:57 ` Piatkowski, Dominik Karol
2024-08-01 19:04 ` Grzegorzek, Dominik
2024-07-30 11:44 ` [PATCH i-g-t v2 40/66] tests/xe_exec_sip: Check usercoredump for attentions Christoph Manszewski
2024-07-30 11:44 ` [PATCH i-g-t v2 41/66] tests/xe_exec_sip: Add support for dynamic debugger sysfs toggle Christoph Manszewski
2024-08-01 12:58 ` Piatkowski, Dominik Karol
2024-07-30 11:44 ` [PATCH i-g-t v2 42/66] tests/xe_exec_sip: Add breakpoint-writesip-twice test Christoph Manszewski
2024-07-30 11:45 ` [PATCH i-g-t v2 43/66] tests/xe_exec_sip: Add sanity-after-timeout test Christoph Manszewski
2024-08-01 7:08 ` Piatkowski, Dominik Karol
2024-07-30 11:45 ` [PATCH i-g-t v2 44/66] tests/xe_exec_sip: Add breakpoint-waitsip-heavy test Christoph Manszewski
2024-07-30 11:45 ` [PATCH i-g-t v2 45/66] tests/xe_exec_sip: Add nodebug test cases Christoph Manszewski
2024-08-01 7:23 ` Piatkowski, Dominik Karol
2024-07-30 11:45 ` [PATCH i-g-t v2 46/66] lib/gpgpu_shader: Add write_on_exception template Christoph Manszewski
2024-07-30 11:45 ` [PATCH i-g-t v2 47/66] lib/gpgpu_shader: Add set/clear exception register (cr0.1) helpers Christoph Manszewski
2024-07-30 11:45 ` [PATCH i-g-t v2 48/66] lib/intel_batchbuffer: Add helper to get pointer at specified offset Christoph Manszewski
2024-07-30 11:45 ` [PATCH i-g-t v2 49/66] lib/gpgpu_shader: Allow enabling illegal opcode exceptions in shader Christoph Manszewski
2024-07-30 11:45 ` [PATCH i-g-t v2 50/66] tests/xe_exec_sip: Rework invalid instruction tests Christoph Manszewski
2024-08-01 19:22 ` Grzegorzek, Dominik
2024-07-30 11:45 ` [PATCH i-g-t v2 51/66] lib/intel_batchbuffer: Add support for long-running mode execution Christoph Manszewski
2024-07-30 11:45 ` [PATCH i-g-t v2 52/66] tests/xe_eudebug_online: Debug client which runs workloads on EU Christoph Manszewski
2024-07-30 11:45 ` [PATCH i-g-t v2 53/66] tests/xe_eudebug_online: Set dynamic breakpoint on interrupt-all Christoph Manszewski
2024-08-05 6:27 ` Piatkowski, Dominik Karol
2024-07-30 11:45 ` [PATCH i-g-t v2 54/66] tests/xe_eudebug_online: Add support for dynamic debugger sysfs toggle Christoph Manszewski
2024-08-05 6:30 ` Piatkowski, Dominik Karol
2024-07-30 11:45 ` [PATCH i-g-t v2 55/66] tests/xe_eudebug_online: Add tdctl-parameters test Christoph Manszewski
2024-07-30 11:45 ` [PATCH i-g-t v2 56/66] tests/xe_eudebug_online: Add reset-with-attention test Christoph Manszewski
2024-08-05 6:46 ` Piatkowski, Dominik Karol
2024-07-30 11:45 ` [PATCH i-g-t v2 57/66] lib/xe_eudebug: Expose xe_eudebug_connect Christoph Manszewski
2024-08-05 6:48 ` Piatkowski, Dominik Karol
2024-07-30 11:45 ` [PATCH i-g-t v2 58/66] tests/xe_eudebug_online: Add interrupt-reconnect test Christoph Manszewski
2024-08-05 7:53 ` Piatkowski, Dominik Karol
2024-07-30 11:45 ` [PATCH i-g-t v2 59/66] tests/xe_eudebug_online: Add single-step and single-step-one tests Christoph Manszewski
2024-07-30 11:45 ` [PATCH i-g-t v2 60/66] tests/xe_eudebug_online: What if user does not set debug mode? Christoph Manszewski
2024-08-05 7:55 ` Piatkowski, Dominik Karol
2024-07-30 11:45 ` [PATCH i-g-t v2 61/66] tests/xe_eudebug_online: Adds debugger-reopen test Christoph Manszewski
2024-08-01 8:22 ` Piatkowski, Dominik Karol
2024-07-30 11:45 ` [PATCH i-g-t v2 62/66] tests/xe_eudebug_online: Add caching tests Christoph Manszewski
2024-08-01 12:52 ` Piatkowski, Dominik Karol
2024-07-30 11:45 ` [PATCH i-g-t v2 63/66] tests/xe_eudebug_online: Add subtests w/o long running mode Christoph Manszewski
2024-08-01 9:09 ` Piatkowski, Dominik Karol
2024-08-01 19:27 ` Grzegorzek, Dominik
2024-07-30 11:45 ` [PATCH i-g-t v2 64/66] tests/xe_eudebug_online: Add multisession test cases Christoph Manszewski
2024-07-30 11:45 ` [PATCH i-g-t v2 65/66] tests/xe_eudebug_online: Check if eu debugger disables preemption timeout Christoph Manszewski
2024-07-30 11:45 ` [PATCH i-g-t v2 66/66] tests/xe_live_ktest: Add xe_eudebug live test Christoph Manszewski
2024-07-30 16:15 ` ✗ GitLab.Pipeline: warning for Test coverage for GPU debug support (rev2) Patchwork
2024-07-30 16:23 ` ✓ CI.xeBAT: success " Patchwork
2024-07-30 16:36 ` ✗ Fi.CI.BAT: failure " Patchwork
2024-07-30 17:16 ` ✗ CI.xeFULL: " Patchwork
2024-08-08 11:13 ` [PATCH i-g-t v2 00/66] Test coverage for GPU debug support Zbigniew Kempczyński
2024-08-08 11:42 ` Manszewski, Christoph
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=20240730114523.334156-20-christoph.manszewski@intel.com \
--to=christoph.manszewski@intel.com \
--cc=andrzej.hajda@intel.com \
--cc=dominik.grzegorzek@intel.com \
--cc=dominik.karol.piatkowski@intel.com \
--cc=gwan-gyeong.mun@intel.com \
--cc=igt-dev@lists.freedesktop.org \
--cc=kamil.konieczny@linux.intel.com \
--cc=kolanupaka.naveena@intel.com \
--cc=maciej.patelczyk@intel.com \
--cc=mika.kuoppala@intel.com \
--cc=pawel.sikora@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