All of lore.kernel.org
 help / color / mirror / Atom feed
* [igt-dev] [PATCH i-g-t v2] tests/i915/pxp: test_pxp_stale_buf_optout_execution requires arb session
@ 2023-02-14 18:11 Alan Previn
  2023-02-14 18:59 ` [igt-dev] ✓ Fi.CI.BAT: success for tests/i915/pxp: test_pxp_stale_buf_optout_execution requires arb session (rev2) Patchwork
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Alan Previn @ 2023-02-14 18:11 UTC (permalink / raw)
  To: igt-dev; +Cc: Alan Previn

Subtest 'test_pxp_stale_buf_optout_execution' when run on its own,
could be executing without the PXP Arb session being alive. This
would result in the termination trigger to fail (when writing to
the pxp termination debugfs).

Create a background protected context to start the Arb session so
the simulated termination will succeed.

   v2: - use create_ctx_with_params instead of prepare_exec_assets
         for the background pxp context (Daniele)

Signed-off-by: Alan Previn <alan.previn.teres.alexis@intel.com>
---
 tests/i915/gem_pxp.c | 22 ++++++++++++++++++++++
 1 file changed, 22 insertions(+)

diff --git a/tests/i915/gem_pxp.c b/tests/i915/gem_pxp.c
index 8c141ddd..0c422448 100644
--- a/tests/i915/gem_pxp.c
+++ b/tests/i915/gem_pxp.c
@@ -933,6 +933,27 @@ static void test_pxp_stale_buf_optout_execution(int i915)
 {
 	int ret;
 	struct simple_exec_assets data = {0};
+	uint32_t tmpctx;
+
+	/*
+	 * NOTE: this subtest creates a non-protected context
+	 * for submissions that uses a protected buffer. The UAPI
+	 * requirement dictates that gem_exec_buf will not fail
+	 * if a teardown occurs since the context was not protected,
+	 * despite the buffer being protected. However, the teardown
+	 * is simulated using the pxp termination debugfs which will
+	 * fail if PXP arb session is not active. Coincidentially
+	 * this will likely not happen when running all the subtests
+	 * together but if we execute this specific subtest on its own
+	 * and we didn't previously create an ARB session or if runtime
+	 * power management forced the arb session into invalid state,
+	 * we will not have active ARB session and thus the termination debugfs
+	 * will fail and cause an assertion. That said, we need to
+	 * create a background protected context (uninvolved with
+	 * the intent of the subtest) to ensure ARB session is alive.
+	 */
+	ret = create_ctx_with_params(i915, true, true, true, false, &tmpctx);
+	igt_assert(ret == 0);
 
 	/*
 	 * Use a normal context for testing opt-out behavior
@@ -948,6 +969,7 @@ static void test_pxp_stale_buf_optout_execution(int i915)
 	igt_assert_f((ret == 0), "Opt-out-execution with stale pxp buffer didn't succeed\n");
 
 	free_exec_assets(i915, &data);
+	gem_context_destroy(i915, tmpctx);
 }
 
 static void test_pxp_pwrcycle_staleasset_execution(int i915, struct powermgt_data *pm)
-- 
2.39.0

^ permalink raw reply related	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2023-03-02 16:48 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-02-14 18:11 [igt-dev] [PATCH i-g-t v2] tests/i915/pxp: test_pxp_stale_buf_optout_execution requires arb session Alan Previn
2023-02-14 18:59 ` [igt-dev] ✓ Fi.CI.BAT: success for tests/i915/pxp: test_pxp_stale_buf_optout_execution requires arb session (rev2) Patchwork
2023-02-15  4:08 ` [igt-dev] ✓ Fi.CI.IGT: " Patchwork
2023-03-02 16:48 ` [igt-dev] [PATCH i-g-t v2] tests/i915/pxp: test_pxp_stale_buf_optout_execution requires arb session Ceraolo Spurio, Daniele

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.