drm/i915/tgl: Advanced preparser support for GPU relocs
Subsystems (2)
RFC 1/1 drm/i915/tgl: Advanced preparser support for GPU relocs
TGL has an improved CS pre-parser that can now pre-fetch commands across batch boundaries. This improves performances when lots of small batches are used, but has an impact on self-modifying code. If we want to modify the content of a batch from another ring/batch, we need to either guarantee that the memory location is updated before the pre-parser gets to it or we need to turn the pre-parser off around the modification. In i915, we use self-modifying code only for GPU relocations.
The pre-parser fetches across memory synchronization commands as well, so the only way to guarantee that the writes land before the parser gets to it is to have more instructions between the sync and the destination than the parser FIFO depth, which is not an optimal solution.
The parser can be disabled either globally (from GFX_MODE) or at the context level, using a new flag in the ARB_CHECK command. When re-enabled, the parser turns on at the next arbitration point (ARB_CHECK is not an arbitration point when the parser flag is set). The command is not privileged, so the status can be changed by user batches as well.
To cope with this new HW feature, this patch turns off the parser when GPU relocs are emitted and it conditionally turns back on after the emission, before the user batch is started. The original status of the parser, which is stored in RING_INSTPM, is used to decide whether to re-enable the parser or not. This ensure that we don't turn the parser back on if the userspace had decided to disable it.
Note that with this patch, the parser defaults to on for all contexts, which might regress legacy userspace application that use self-modifying code. However, if we turn it off by default, e.g. with an ARB_CHECK as first cmd on the ring, we will regress performance, because even legacy parsing capabilities are disabled in this scenario.
--- .../gpu/drm/i915/gem/i915_gem_execbuffer.c | 45 ++++++++++++-- drivers/gpu/drm/i915/gt/intel_engine.h | 9 +++ drivers/gpu/drm/i915/gt/intel_engine_types.h | 4 ++ drivers/gpu/drm/i915/gt/intel_gpu_commands.h | 17 +++++- drivers/gpu/drm/i915/gt/intel_lrc.c | 60 +++++++++++++++++++ drivers/gpu/drm/i915/gt/intel_timeline.c | 13 +++- drivers/gpu/drm/i915/i915_reg.h | 1 + 7 files changed, 141 insertions(+), 8 deletions(-)
drivers/gpu/drm/i915/gem/i915_gem_execbuffer.c +41 -4
@@ -254,6 +254,7 @@ struct i915_execbuffer {struct i915_request *rq;u32 *rq_cmd; +unsigned int size;unsigned int rq_size; } reloc_cache;
@@ -904,6 +905,7 @@ static void reloc_cache_init(struct reloc_cache *cache, cache->needs_unfenced =INTEL_INFO (i915)->unfenced_needs_alignment; cache->node.allocated = false; cache->rq =NULL ; + cache->size =PAGE_SIZE ; cache->rq_size =0 ; }
@@ -928,7 +930,8 @@ static inline struct i915_ggtt *cache_to_ggtt(struct reloc_cache *cache)static void reloc_gpu_flush (struct reloc_cache *cache) { -GEM_BUG_ON (cache->rq_size >= cache->rq->batch->obj->base.size /sizeof (u32)); +GEM_BUG_ON (cache->rq_size >= cache->size /sizeof (u32)); + cache->rq_cmd[cache->rq_size] =MI_BATCH_BUFFER_END ;__i915_gem_object_flush_map (cache->rq->batch->obj,0 , cache->rq_size);
@@ -1142,10 +1145,11 @@ static int __reloc_gpu_alloc(struct i915_execbuffer *eb,struct intel_engine_pool_node *pool;struct i915_request *rq;struct i915_vma *batch; +u32 reserved_size = eb->engine->emit_preparser_enable_size_dw *sizeof (u32);u32 *cmd;int err; - pool =intel_engine_pool_get (&eb->engine->pool,PAGE_SIZE ); + pool =intel_engine_pool_get (&eb->engine->pool, cache->size);if (IS_ERR (pool))return PTR_ERR (pool);
@@ -1158,6 +1162,9 @@ static int __reloc_gpu_alloc(struct i915_execbuffer *eb, goto out_pool; } +/* we reserve a portion of the batch for the pre-parser re-enabling */ + cache->size -= reserved_size; + batch =i915_vma_instance (pool->obj, vma->vm,NULL );if (IS_ERR (batch)) { err =PTR_ERR (batch);
@@ -1182,9 +1189,39 @@ static int __reloc_gpu_alloc(struct i915_execbuffer *eb,if (err) goto err_request; +if (eb->engine->emit_preparser_disable) { + err = eb->engine->emit_preparser_disable (rq, + cmd + cache->size /sizeof (u32)); +if (err) + goto skip_request; + } + err = eb->engine->emit_bb_start (rq, - batch->node.start,PAGE_SIZE , + batch->node.start, cache->size, cache->gen >5 ?0 :I915_DISPATCH_SECURE ); + +/* +* Nothing we can do to fix this if we fail to re-enable, so print an +* error and keep going. The context will still be functional, but +* performance might be reduced. +* We attemt this even if emit_bb_start failed to try and at least +* restore the parser status. +*/ +if (eb->engine->emit_preparser_disable) { +int ret; + eb->engine->emit_flush (rq,EMIT_FLUSH ); + + ret = eb->engine->emit_bb_start (rq, + batch->node.start + cache->size, reserved_size, + cache->gen >5 ?0 :I915_DISPATCH_SECURE ); +if (ret) +DRM_ERROR ("Failed to re-enable pre-parser for " +"ctx=%u on engine%u:%u\n" , + rq->gem_context->hw_id, + eb->engine->uabi_class, + eb->engine->uabi_instance); + } +if (err) goto skip_request;
@@ -1226,7 +1263,7 @@ static u32 *reloc_gpu(struct i915_execbuffer *eb,struct reloc_cache *cache = &eb->reloc_cache;u32 *cmd; -if (cache->rq_size >PAGE_SIZE /sizeof (u32) - (len +1 )) +if (cache->rq_size > cache->size/sizeof (u32) - (len +1 ))reloc_gpu_flush (cache);if (unlikely (!cache->rq)) {
drivers/gpu/drm/i915/gt/intel_engine.h +9 -0
@@ -185,9 +185,18 @@ intel_write_status_page(struct intel_engine_cs *engine, int reg, u32 value)#define I915_GEM_HWS_PREEMPT_ADDR (I915_GEM_HWS_PREEMPT * sizeof(u32))#define I915_GEM_HWS_SEQNO 0x40#define I915_GEM_HWS_SEQNO_ADDR (I915_GEM_HWS_SEQNO * sizeof(u32)) +/* +* note: we treat the cacheline starting from I915_GEM_HWS_SEQNO the same as a +* pre-ctx HSWP. see layout below. +*/ #define I915_GEM_HWS_SCRATCH 0x80#define I915_GEM_HWS_SCRATCH_ADDR (I915_GEM_HWS_SCRATCH * sizeof(u32)) +/* offset in per-context hwsp, 1 cacheline in size */ +#define I915_GEM_CTX_HWS_SEQNO 0x0 +#define I915_GEM_CTX_HWS_PREFETCH_MASK 0x14 +#define I915_GEM_CTX_HWS_PREFETCH_VAL 0x15 +#define I915_HWS_CSB_BUF0_INDEX 0x10#define I915_HWS_CSB_WRITE_INDEX 0x1f#define CNL_HWS_CSB_WRITE_INDEX 0x2f
drivers/gpu/drm/i915/gt/intel_engine_types.h +4 -0
@@ -435,6 +435,10 @@ struct intel_engine_cs { u32 *cs);unsigned int emit_fini_breadcrumb_dw; +int (*emit_preparser_disable)(struct i915_request *rq, +u32 *batch); +unsigned int emit_preparser_enable_size_dw; +/* Pass the request to the hardware queue (e.g. directly into * the legacy ringbuffer or to the end of an execlist). *
drivers/gpu/drm/i915/gt/intel_gpu_commands.h +15 -2
@@ -53,6 +53,17 @@#define MI_ARB_ENABLE (1<<0)#define MI_ARB_DISABLE (0<<0)#define MI_BATCH_BUFFER_END MI_INSTR(0x0a, 0) +#define MI_CONDITIONAL_BATCH_BUFFER_END MI_INSTR(0x36, 0) +#define MI_CBBEND_GLOBAL_GTT (1<<22) +#define MI_CBBEND_COMPARE_SEMAPHORE (1<<21)/* Gen12+*/ +#define MI_CBBEND_COMPARE_MASK (1<<19)/* Gen9+*/ +#define MI_CBBEND_END_CURRENT_LEVEL (1<<18)/* Gen12+*/ +#define MI_CBBEND_MAD_GT_IDD (0 << 12)/* Gen12+*/ +#define MI_CBBEND_MAD_GTE_IDD (1 << 12)/* Gen12+*/ +#define MI_CBBEND_MAD_LT_IDD (2 << 12)/* Gen12+*/ +#define MI_CBBEND_MAD_LTE_IDD (3 << 12)/* Gen12+*/ +#define MI_CBBEND_MAD_EQ_IDD (4 << 12)/* Gen12+*/ +#define MI_CBBEND_MAD_NE_IDD (5 << 12)/* Gen12+*/ #define MI_SUSPEND_FLUSH MI_INSTR(0x0b, 0)#define MI_SUSPEND_FLUSH_EN (1<<0)#define MI_SET_APPID MI_INSTR(0x0e, 0)
@@ -136,6 +147,7 @@#define MI_STORE_REGISTER_MEM MI_INSTR(0x24, 1)#define MI_STORE_REGISTER_MEM_GEN8 MI_INSTR(0x24, 2)#define MI_SRM_LRM_GLOBAL_GTT (1<<22) +#define MI_SRM_ADD_CS_MMIO_START (1<<19)/* gen11+ */ #define MI_FLUSH_DW MI_INSTR(0x26, 1)/* for GEN6 */ #define MI_FLUSH_DW_STORE_INDEX (1<<21)#define MI_INVALIDATE_TLB (1<<18)
@@ -158,6 +170,9 @@#define MI_BATCH_BUFFER_START_GEN8 MI_INSTR(0x31, 1)#define MI_BATCH_RESOURCE_STREAMER (1<<10) +#define MI_ARB_CHECK MI_INSTR(0x05, 0) +#define MI_ARB_CHECK_PREPARSER_DISABLE BIT(0) +#define MI_ARB_CHECK_PREPARSER_DISABLE_MASK BIT(8)/* * 3D instructions used by the kernel */
@@ -239,7 +254,6 @@* Commands used only by the command parser */ #define MI_SET_PREDICATE MI_INSTR(0x01, 0) -#define MI_ARB_CHECK MI_INSTR(0x05, 0)#define MI_RS_CONTROL MI_INSTR(0x06, 0)#define MI_URB_ATOMIC_ALLOC MI_INSTR(0x09, 0)#define MI_PREDICATE MI_INSTR(0x0C, 0)
@@ -255,7 +269,6 @@#define MI_RS_STORE_DATA_IMM MI_INSTR(0x2B, 0)#define MI_LOAD_URB_MEM MI_INSTR(0x2C, 0)#define MI_STORE_URB_MEM MI_INSTR(0x2D, 0) -#define MI_CONDITIONAL_BATCH_BUFFER_END MI_INSTR(0x36, 0)#define PIPELINE_SELECT ((0x3<<29)|(0x1<<27)|(0x1<<24)|(0x4<<16))#define GFX_OP_3DSTATE_VF_STATISTICS ((0x3<<29)|(0x1<<27)|(0x0<<24)|(0xB<<16))
drivers/gpu/drm/i915/gt/intel_lrc.c +60 -0
72 lines not on this page · raw message
drivers/gpu/drm/i915/gt/intel_timeline.c +11 -2
@@ -209,6 +209,7 @@ int intel_timeline_init(struct intel_timeline *timeline, struct i915_vma *hwsp) {void *vaddr; +u32 *hwsp_map;kref_init (&timeline->kref);atomic_set (&timeline->pin_count,0 );
@@ -244,8 +245,16 @@ int intel_timeline_init(struct intel_timeline *timeline,return PTR_ERR (vaddr); } - timeline->hwsp_seqno = -memset (vaddr + timeline->hwsp_offset,0 ,CACHELINE_BYTES ); + hwsp_map =memset (vaddr + timeline->hwsp_offset,0 ,CACHELINE_BYTES ); + timeline->hwsp_seqno = hwsp_map; + +/* +* For checking the status of the pre-fetcher, we need save the value +* of the INSTPM register and then evaluate it against the mask during +* a BBEND. This requires the mask and the register value to be in 2 +* consecutive dwords in memory. We use 2 dword in the HWSP for this +*/ + hwsp_map[I915_GEM_CTX_HWS_PREFETCH_MASK ] =PREFETCH_DISABLE_STATUS ; timeline->hwsp_ggtt =i915_vma_get (hwsp);GEM_BUG_ON (timeline->hwsp_offset >= hwsp->size);
drivers/gpu/drm/i915/i915_reg.h +1 -0
@@ -2549,6 +2549,7 @@ static inline bool i915_mmio_reg_valid(i915_reg_t reg)#define RING_DMA_FADD (base) _MMIO((base) + 0x78)#define RING_DMA_FADD_UDW (base) _MMIO((base) + 0x60)/* gen8+ */ #define RING_INSTPM (base) _MMIO((base) + 0xc0) +#define PREFETCH_DISABLE_STATUS REG_BIT(12)/* gen12+ */ #define RING_MI_MODE (base) _MMIO((base) + 0x9c)#define INSTPS _MMIO(0x2070)/* 965+ only */ #define GEN4_INSTDONE1 _MMIO(0x207c)/* 965+ only, aka INSTDONE_2 on SNB */
Signature · 6 lines
2.23.0 _______________________________________________ Intel-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Patchwork
CI✗ Fi.CI.CHECKPATCH: warning for drm/i915/tgl: Advanced preparser support for GPU relocs
== Series Details ==
== Series Details ==
Series: drm/i915/tgl: Advanced preparser support for GPU relocs
URL : https://patchwork.freedesktop.org/series/65658/
State : warning
== Summary ==
$ dim checkpatch origin/drm-tip 68a96483d2c1 drm/i915/tgl: Advanced preparser support for GPU relocs -:121: WARNING:LINE_SPACING: Missing a blank line after declarations #121: FILE: drivers/gpu/drm/i915/gem/i915_gem_execbuffer.c:1212: + int ret; + eb->engine->emit_flush(rq, EMIT_FLUSH);
-:142: CHECK:SPACING: spaces preferred around that '/' (ctx:VxV) #142: FILE: drivers/gpu/drm/i915/gem/i915_gem_execbuffer.c:1266:
+ if (cache->rq_size > cache->size/sizeof(u32) - (len + 1))
^
-:193: CHECK:SPACING: spaces preferred around that '<<' (ctx:VxV) #193: FILE: drivers/gpu/drm/i915/gt/intel_gpu_commands.h:57:
+#define MI_CBBEND_GLOBAL_GTT (1<<22)
^
-:194: CHECK:SPACING: spaces preferred around that '<<' (ctx:VxV) #194: FILE: drivers/gpu/drm/i915/gt/intel_gpu_commands.h:58:
+#define MI_CBBEND_COMPARE_SEMAPHORE (1<<21) /* Gen12+*/
^
-:195: CHECK:SPACING: spaces preferred around that '<<' (ctx:VxV) #195: FILE: drivers/gpu/drm/i915/gt/intel_gpu_commands.h:59:
+#define MI_CBBEND_COMPARE_MASK (1<<19) /* Gen9+*/
^
-:196: CHECK:SPACING: spaces preferred around that '<<' (ctx:VxV) #196: FILE: drivers/gpu/drm/i915/gt/intel_gpu_commands.h:60:
+#define MI_CBBEND_END_CURRENT_LEVEL (1<<18) /* Gen12+*/
^
-:210: CHECK:SPACING: spaces preferred around that '<<' (ctx:VxV) #210: FILE: drivers/gpu/drm/i915/gt/intel_gpu_commands.h:150:
+#define MI_SRM_ADD_CS_MMIO_START (1<<19) /* gen11+ */
^
-:311: WARNING:LINE_SPACING: Missing a blank line after declarations #311: FILE: drivers/gpu/drm/i915/gt/intel_lrc.c:3076:
+ u32 tmp[16];
+ engine->emit_preparser_disable = gen12_emit_preparser_disable;
total: 0 errors, 2 warnings, 6 checks, 271 lines checked
_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Patchwork
CI✗ Fi.CI.BAT: failure for drm/i915/tgl: Advanced preparser support for GPU relocs
In reply to Daniele Ceraolo Spurio== Series Details ==
== Series Details ==
Series: drm/i915/tgl: Advanced preparser support for GPU relocs
URL : https://patchwork.freedesktop.org/series/65658/
State : failure
== Summary ==
CI Bug Log - changes from CI_DRM_6770 -> Patchwork_14152
====================================================
Summary
-------
**FAILURE**
Serious unknown changes coming with Patchwork_14152 absolutely need to be verified manually.
If you think the reported changes have nothing to do with the changes introduced in Patchwork_14152, please notify your bug team to allow them to document this new failure mode, which will reduce false positives in CI.
External URL: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_14152/
Possible new issues
-------------------
Here are the unknown changes that may have been introduced in Patchwork_14152:
### IGT changes ###
#### Possible regressions ####
* igt@gem_close_race@basic-threads:
- fi-bsw-kefka: [PASS][1] -> [DMESG-WARN][2]
[1]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6770/fi-bsw-kefka/igt@[email protected]
[2]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_14152/fi-bsw-kefka/igt@[email protected]
- fi-skl-6770hq: [PASS][3] -> [DMESG-WARN][4]
[3]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6770/fi-skl-6770hq/igt@[email protected]
[4]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_14152/fi-skl-6770hq/igt@[email protected]
* igt@gem_ctx_create@basic-files:
- fi-bxt-dsi: [PASS][5] -> [DMESG-WARN][6]
[5]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6770/fi-bxt-dsi/igt@[email protected]
[6]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_14152/fi-bxt-dsi/igt@[email protected]
- fi-icl-u2: [PASS][7] -> [DMESG-WARN][8]
[7]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6770/fi-icl-u2/igt@[email protected]
[8]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_14152/fi-icl-u2/igt@[email protected]
- fi-kbl-7500u: [PASS][9] -> [DMESG-WARN][10]
[9]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6770/fi-kbl-7500u/igt@[email protected]
[10]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_14152/fi-kbl-7500u/igt@[email protected]
- fi-bdw-5557u: [PASS][11] -> [DMESG-WARN][12]
[11]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6770/fi-bdw-5557u/igt@[email protected]
[12]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_14152/fi-bdw-5557u/igt@[email protected]
- fi-cfl-guc: [PASS][13] -> [DMESG-WARN][14]
[13]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6770/fi-cfl-guc/igt@[email protected]
[14]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_14152/fi-cfl-guc/igt@[email protected]
- fi-skl-guc: [PASS][15] -> [DMESG-WARN][16]
[15]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6770/fi-skl-guc/igt@[email protected]
[16]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_14152/fi-skl-guc/igt@[email protected]
- fi-skl-6700k2: [PASS][17] -> [DMESG-WARN][18]
[17]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6770/fi-skl-6700k2/igt@[email protected]
[18]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_14152/fi-skl-6700k2/igt@[email protected]
- fi-apl-guc: [PASS][19] -> [DMESG-WARN][20]
[19]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6770/fi-apl-guc/igt@[email protected]
[20]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_14152/fi-apl-guc/igt@[email protected]
- fi-kbl-guc: [PASS][21] -> [DMESG-WARN][22]
[21]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6770/fi-kbl-guc/igt@[email protected]
[22]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_14152/fi-kbl-guc/igt@[email protected]
- fi-cfl-8109u: [PASS][23] -> [DMESG-WARN][24]
[23]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6770/fi-cfl-8109u/igt@[email protected]
[24]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_14152/fi-cfl-8109u/igt@[email protected]
* igt@gem_exec_gttfill@basic:
- fi-skl-lmem: [PASS][25] -> [INCOMPLETE][26]
[25]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6770/fi-skl-lmem/igt@[email protected]
[26]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_14152/fi-skl-lmem/igt@[email protected]
* igt@i915_selftest@live_execlists:
- fi-pnv-d510: [PASS][27] -> [FAIL][28] +18 similar issues
[27]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6770/fi-pnv-d510/igt@i915_selftest@live_execlists.html
[28]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_14152/fi-pnv-d510/igt@i915_selftest@live_execlists.html
* igt@i915_selftest@live_gt_contexts:
- fi-kbl-r: [PASS][29] -> [DMESG-WARN][30]
[29]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6770/fi-kbl-r/igt@i915_selftest@live_gt_contexts.html
[30]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_14152/fi-kbl-r/igt@i915_selftest@live_gt_contexts.html
* igt@i915_selftest@live_requests:
- fi-kbl-x1275: [PASS][31] -> [DMESG-WARN][32]
[31]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6770/fi-kbl-x1275/igt@i915_selftest@live_requests.html
[32]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_14152/fi-kbl-x1275/igt@i915_selftest@live_requests.html
- fi-snb-2520m: [PASS][33] -> [DMESG-WARN][34]
[33]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6770/fi-snb-2520m/igt@i915_selftest@live_requests.html
[34]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_14152/fi-snb-2520m/igt@i915_selftest@live_requests.html
* igt@runner@aborted:
- fi-bdw-gvtdvm: NOTRUN -> [FAIL][35]
[35]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_14152/fi-bdw-gvtdvm/igt@[email protected]
- fi-cfl-8109u: NOTRUN -> [FAIL][36]
[36]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_14152/fi-cfl-8109u/igt@[email protected]
- fi-kbl-7500u: NOTRUN -> [FAIL][37]
[37]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_14152/fi-kbl-7500u/igt@[email protected]
- fi-cml-u2: NOTRUN -> [FAIL][38]
[38]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_14152/fi-cml-u2/igt@[email protected]
- fi-bxt-dsi: NOTRUN -> [FAIL][39]
[39]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_14152/fi-bxt-dsi/igt@[email protected]
- fi-cfl-guc: NOTRUN -> [FAIL][40]
[40]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_14152/fi-cfl-guc/igt@[email protected]
- fi-kbl-7567u: NOTRUN -> [FAIL][41]
[41]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_14152/fi-kbl-7567u/igt@[email protected]
- fi-bsw-n3050: NOTRUN -> [FAIL][42]
[42]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_14152/fi-bsw-n3050/igt@[email protected]
- fi-kbl-x1275: NOTRUN -> [FAIL][43]
[43]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_14152/fi-kbl-x1275/igt@[email protected]
- fi-bsw-kefka: NOTRUN -> [FAIL][44]
[44]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_14152/fi-bsw-kefka/igt@[email protected]
- fi-cfl-8700k: NOTRUN -> [FAIL][45]
[45]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_14152/fi-cfl-8700k/igt@[email protected]
- fi-kbl-8809g: NOTRUN -> [FAIL][46]
[46]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_14152/fi-kbl-8809g/igt@[email protected]
- fi-apl-guc: NOTRUN -> [FAIL][47]
[47]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_14152/fi-apl-guc/igt@[email protected]
- fi-kbl-r: NOTRUN -> [FAIL][48]
[48]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_14152/fi-kbl-r/igt@[email protected]
- fi-bdw-5557u: NOTRUN -> [FAIL][49]
[49]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_14152/fi-bdw-5557u/igt@[email protected]
- fi-kbl-guc: NOTRUN -> [FAIL][50]
[50]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_14152/fi-kbl-guc/igt@[email protected]
#### Suppressed ####
The following results come from untrusted machines, tests, or statuses. They do not affect the overall result.
* {igt@dmabuf@sanitycheck}:
- fi-pnv-d510: [PASS][51] -> [FAIL][52] +1 similar issue
[51]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6770/fi-pnv-d510/igt@[email protected]
[52]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_14152/fi-pnv-d510/igt@[email protected]
* igt@i915_selftest@live_gt_contexts:
- {fi-icl-dsi}: [PASS][53] -> [FAIL][54] +19 similar issues
[53]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6770/fi-icl-dsi/igt@i915_selftest@live_gt_contexts.html
[54]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_14152/fi-icl-dsi/igt@i915_selftest@live_gt_contexts.html
* {igt@i915_selftest@live_gt_timelines}:
- fi-bdw-gvtdvm: [PASS][55] -> [DMESG-FAIL][56]
[55]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6770/fi-bdw-gvtdvm/igt@i915_selftest@live_gt_timelines.html
[56]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_14152/fi-bdw-gvtdvm/igt@i915_selftest@live_gt_timelines.html
- fi-kbl-8809g: [PASS][57] -> [DMESG-WARN][58]
[57]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6770/fi-kbl-8809g/igt@i915_selftest@live_gt_timelines.html
[58]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_14152/fi-kbl-8809g/igt@i915_selftest@live_gt_timelines.html
- fi-skl-6260u: [PASS][59] -> [DMESG-WARN][60]
[59]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6770/fi-skl-6260u/igt@i915_selftest@live_gt_timelines.html
[60]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_14152/fi-skl-6260u/igt@i915_selftest@live_gt_timelines.html
- fi-whl-u: [PASS][61] -> [INCOMPLETE][62]
[61]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6770/fi-whl-u/igt@i915_selftest@live_gt_timelines.html
[62]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_14152/fi-whl-u/igt@i915_selftest@live_gt_timelines.html
- fi-hsw-4770: [PASS][63] -> [INCOMPLETE][64]
[63]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6770/fi-hsw-4770/igt@i915_selftest@live_gt_timelines.html
[64]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_14152/fi-hsw-4770/igt@i915_selftest@live_gt_timelines.html
- fi-cfl-8700k: [PASS][65] -> [DMESG-WARN][66]
[65]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6770/fi-cfl-8700k/igt@i915_selftest@live_gt_timelines.html
[66]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_14152/fi-cfl-8700k/igt@i915_selftest@live_gt_timelines.html
Known issues
------------
Here are the changes found in Patchwork_14152 that come from known issues:
### IGT changes ###
#### Issues hit ####
* igt@gem_exec_suspend@basic-s3:
- fi-blb-e6850: [PASS][67] -> [INCOMPLETE][68] ([fdo#107718])
[67]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6770/fi-blb-e6850/igt@[email protected]
[68]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_14152/fi-blb-e6850/igt@[email protected]
* igt@kms_chamelium@dp-crc-fast:
- fi-cml-u2: [PASS][69] -> [FAIL][70] ([fdo#110627])
[69]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6770/fi-cml-u2/igt@[email protected]
[70]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_14152/fi-cml-u2/igt@[email protected]
#### Possible fixes ####
* igt@gem_cpu_reloc@basic:
- fi-icl-u3: [DMESG-WARN][71] ([fdo#107724]) -> [PASS][72]
[71]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6770/fi-icl-u3/igt@[email protected]
[72]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_14152/fi-icl-u3/igt@[email protected]
{name}: This element is suppressed. This means it is ignored when computing
the status of the difference (SUCCESS, WARNING, or FAILURE).
[fdo#103989]: https://bugs.freedesktop.org/show_bug.cgi?id=103989
[fdo#107713]: https://bugs.freedesktop.org/show_bug.cgi?id=107713
[fdo#107718]: https://bugs.freedesktop.org/show_bug.cgi?id=107718
[fdo#107724]: https://bugs.freedesktop.org/show_bug.cgi?id=107724
[fdo#109100]: https://bugs.freedesktop.org/show_bug.cgi?id=109100
[fdo#109644]: https://bugs.freedesktop.org/show_bug.cgi?id=109644
[fdo#110464]: https://bugs.freedesktop.org/show_bug.cgi?id=110464
[fdo#110627]: https://bugs.freedesktop.org/show_bug.cgi?id=110627
Participating hosts (55 -> 46)
------------------------------
Additional (1): fi-hsw-peppy
Missing (10): fi-kbl-soraka fi-ilk-m540 fi-hsw-4200u fi-byt-squawks fi-bsw-cyan fi-skl-iommu fi-icl-y fi-byt-n2820 fi-byt-clapper fi-bdw-samus
Build changes
-------------
* CI: CI-20190529 -> None
* Linux: CI_DRM_6770 -> Patchwork_14152
CI-20190529: 20190529
CI_DRM_6770: f0a0801ce8f6aaee095947354b33da4d851a0bbd @ git://anongit.freedesktop.org/gfx-ci/linux
IGT_5148: 50390dd7adaccae21cafa85b866c17606cec94c3 @ git://anongit.freedesktop.org/xorg/app/intel-gpu-tools
Patchwork_14152: 68a96483d2c17dc3cd4f69ae1004a69d01790baf @ git://anongit.freedesktop.org/gfx-ci/linux
== Linux commits ==
68a96483d2c1 drm/i915/tgl: Advanced preparser support for GPU relocs
== Logs ==
For more details see: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_14152/
_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Quoting Daniele Ceraolo Spurio (2019-08-23 03:09:09)
Quoted 8 lines
TGL has an improved CS pre-parser that can now pre-fetch commands across batch boundaries. This improves performances when lots of small batches are used, but has an impact on self-modifying code. If we want to modify the content of a batch from another ring/batch, we need to either guarantee that the memory location is updated before the pre-parser gets to it or we need to turn the pre-parser off around the modification. In i915, we use self-modifying code only for GPU relocations.
Quoted 4 lines
The pre-parser fetches across memory synchronization commands as well, so the only way to guarantee that the writes land before the parser gets to it is to have more instructions between the sync and the destination than the parser FIFO depth, which is not an optimal solution.
Well, our ABI is that memory is coherent before the breadcrumb of *each* batch. That is a fundamental requirement for our signaling to userspace. Please tell me that there is a context flag to turn this off, or we else we need to emit 32x flushes or whatever it takes.
-Chris
_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Quoting Chris Wilson (2019-08-23 08:27:25)
Quoted 14 lines
Quoting Daniele Ceraolo Spurio (2019-08-23 03:09:09)
Quoted 8 lines
TGL has an improved CS pre-parser that can now pre-fetch commands across batch boundaries. This improves performances when lots of small batches are used, but has an impact on self-modifying code. If we want to modify the content of a batch from another ring/batch, we need to either guarantee that the memory location is updated before the pre-parser gets to it or we need to turn the pre-parser off around the modification. In i915, we use self-modifying code only for GPU relocations.
Quoted 4 lines
The pre-parser fetches across memory synchronization commands as well, so the only way to guarantee that the writes land before the parser gets to it is to have more instructions between the sync and the destination than the parser FIFO depth, which is not an optimal solution.
Quoted 4 lines
Well, our ABI is that memory is coherent before the breadcrumb of *each* batch. That is a fundamental requirement for our signaling to userspace. Please tell me that there is a context flag to turn this off, or we else we need to emit 32x flushes or whatever it takes.
So looking at what you are doing, it seems entirely possible that we can switch off the preparser for the breadcrumb -- is that enough to make that final signal coherent and provide the barrier required for the invalidation at the start of the next? (You might even only enable the preparser around userspace batches.) Or I hope they have an extra flush bit for correct serialisation.
-Chris
_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Quoted 20 lines · Chris Wilson
Quoting Chris Wilson (2019-08-23 08:27:25)
Quoted 18 lines
Quoting Daniele Ceraolo Spurio (2019-08-23 03:09:09)
Quoted 8 lines
TGL has an improved CS pre-parser that can now pre-fetch commands across batch boundaries. This improves performances when lots of small batches are used, but has an impact on self-modifying code. If we want to modify the content of a batch from another ring/batch, we need to either guarantee that the memory location is updated before the pre-parser gets to it or we need to turn the pre-parser off around the modification. In i915, we use self-modifying code only for GPU relocations.
Quoted 4 lines
The pre-parser fetches across memory synchronization commands as well, so the only way to guarantee that the writes land before the parser gets to it is to have more instructions between the sync and the destination than the parser FIFO depth, which is not an optimal solution.
Well, our ABI is that memory is coherent before the breadcrumb of *each* batch. That is a fundamental requirement for our signaling to userspace. Please tell me that there is a context flag to turn this off, or we else we need to emit 32x flushes or whatever it takes.
Are you referring to the specific case where we have a request modifying an object that is then used as a batch in the next request? Because coherency of objects that are not executed as batches is not impacted.
Quoted 6 lines
So looking at what you are doing, it seems entirely possible that we can switch off the preparser for the breadcrumb -- is that enough to make that final signal coherent and provide the barrier required for the invalidation at the start of the next? (You might even only enable the preparser around userspace batches.) Or I hope they have an extra flush bit for correct serialisation.
The instructions I got from the HW team on how to handle the self-modifying code say that the pre-parser must be disabled before the write is emitted and re-enabled afterward, so I'm not sure if having it off just around the breadcrumb is enough, we might need and extra BBSTART in the breadcrumb to flush the parser status. Should we just keep the parser off by default and have the userspace app opt-in (via and ARB_CHECK in the batch) if they know they can handle it?
Daniele
Quoted 2 lines
-Chris
_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Quoting Daniele Ceraolo Spurio (2019-08-23 16:05:45)
Quoted 18 lines · Chris Wilson
Quoted 15 lines
Quoting Chris Wilson (2019-08-23 08:27:25)
Quoted 14 lines
Quoting Daniele Ceraolo Spurio (2019-08-23 03:09:09)
Quoted 12 lines
TGL has an improved CS pre-parser that can now pre-fetch commands across batch boundaries. This improves performances when lots of small batches are used, but has an impact on self-modifying code. If we want to modify the content of a batch from another ring/batch, we need to either guarantee that the memory location is updated before the pre-parser gets to it or we need to turn the pre-parser off around the modification. In i915, we use self-modifying code only for GPU relocations.
The pre-parser fetches across memory synchronization commands as well, so the only way to guarantee that the writes land before the parser gets to it is to have more instructions between the sync and the destination than the parser FIFO depth, which is not an optimal solution.
Quoted 8 lines
Quoted 5 lines
Quoted 4 lines
Well, our ABI is that memory is coherent before the breadcrumb of *each* batch. That is a fundamental requirement for our signaling to userspace. Please tell me that there is a context flag to turn this off, or we else we need to emit 32x flushes or whatever it takes.
Are you referring to the specific case where we have a request modifying an object that is then used as a batch in the next request? Because coherency of objects that are not executed as batches is not impacted.
"Fetches across memory sync" sounds like a major ABI break. The batches are a hard serialisation barrier, with memory coherency guaranteed prior to the signaling at the end of one batch and clear caches guaranteed at the start of the next.
There is mutterings for a weaker mode, the above is our existing contract. There is nothing special about the relocation code, it is assuming our contract holds.
-Chris
_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Quoting Chris Wilson (2019-08-23 16:10:48)
Quoted 24 lines
Quoting Daniele Ceraolo Spurio (2019-08-23 16:05:45)
Quoted 23 lines · Chris Wilson
Quoted 20 lines
Quoting Chris Wilson (2019-08-23 08:27:25)
Quoted 18 lines
Quoting Daniele Ceraolo Spurio (2019-08-23 03:09:09)
Quoted 8 lines
TGL has an improved CS pre-parser that can now pre-fetch commands across batch boundaries. This improves performances when lots of small batches are used, but has an impact on self-modifying code. If we want to modify the content of a batch from another ring/batch, we need to either guarantee that the memory location is updated before the pre-parser gets to it or we need to turn the pre-parser off around the modification. In i915, we use self-modifying code only for GPU relocations.
Quoted 4 lines
The pre-parser fetches across memory synchronization commands as well, so the only way to guarantee that the writes land before the parser gets to it is to have more instructions between the sync and the destination than the parser FIFO depth, which is not an optimal solution.
Well, our ABI is that memory is coherent before the breadcrumb of *each* batch. That is a fundamental requirement for our signaling to userspace. Please tell me that there is a context flag to turn this off, or we else we need to emit 32x flushes or whatever it takes.
Quoted 8 lines
Quoted 3 lines
Are you referring to the specific case where we have a request modifying an object that is then used as a batch in the next request? Because coherency of objects that are not executed as batches is not impacted.
"Fetches across memory sync" sounds like a major ABI break. The batches are a hard serialisation barrier, with memory coherency guaranteed prior to the signaling at the end of one batch and clear caches guaranteed at the start of the next.
We have relocs, oa and sseu all using self-modifying code. I expect we will have PTE modifications and much more done via the GPU in the near future. All rely on the CS_STALL doing exactly what it says on the tin. -Chris
_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Quoted 34 lines · Chris Wilson
Quoting Chris Wilson (2019-08-23 16:10:48)
Quoted 24 lines
Quoting Daniele Ceraolo Spurio (2019-08-23 16:05:45)
Quoted 23 lines · Chris Wilson
Quoted 20 lines
Quoting Chris Wilson (2019-08-23 08:27:25)
Quoted 18 lines
Quoting Daniele Ceraolo Spurio (2019-08-23 03:09:09)
Quoted 8 lines
TGL has an improved CS pre-parser that can now pre-fetch commands across batch boundaries. This improves performances when lots of small batches are used, but has an impact on self-modifying code. If we want to modify the content of a batch from another ring/batch, we need to either guarantee that the memory location is updated before the pre-parser gets to it or we need to turn the pre-parser off around the modification. In i915, we use self-modifying code only for GPU relocations.
Quoted 4 lines
The pre-parser fetches across memory synchronization commands as well, so the only way to guarantee that the writes land before the parser gets to it is to have more instructions between the sync and the destination than the parser FIFO depth, which is not an optimal solution.
Well, our ABI is that memory is coherent before the breadcrumb of *each* batch. That is a fundamental requirement for our signaling to userspace. Please tell me that there is a context flag to turn this off, or we else we need to emit 32x flushes or whatever it takes.
Quoted 8 lines
Quoted 3 lines
Are you referring to the specific case where we have a request modifying an object that is then used as a batch in the next request? Because coherency of objects that are not executed as batches is not impacted.
"Fetches across memory sync" sounds like a major ABI break. The batches are a hard serialisation barrier, with memory coherency guaranteed prior to the signaling at the end of one batch and clear caches guaranteed at the start of the next.
Quoted 5 lines
We have relocs, oa and sseu all using self-modifying code. I expect we will have PTE modifications and much more done via the GPU in the near future. All rely on the
CS_STALLdoing exactly what it says on the tin. -Chris
I guess the easiest solution is then to keep the parser off outside of user batches. We can default to off and then restore what the user has programmed before the BBSTART. It's not a breach of contract if we say that if you opt-in to the parser then you need to make sure your batches are not self-modifying, right?
BTW the CS_STALL does not guarantee on pre-gen12 gens that self-modifying code works within the same batch/ring because the pre-parser is already pre-fetching across memory sync points, it just stops at the next arb point.
Daniele
_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Quoting Daniele Ceraolo Spurio (2019-08-23 16:39:14)
Quoted 43 lines · Chris Wilson
Quoted 34 lines
Quoting Chris Wilson (2019-08-23 16:10:48)
Quoted 24 lines
Quoting Daniele Ceraolo Spurio (2019-08-23 16:05:45)
Quoted 23 lines · Chris Wilson
Quoted 20 lines
Quoting Chris Wilson (2019-08-23 08:27:25)
Quoted 18 lines
Quoting Daniele Ceraolo Spurio (2019-08-23 03:09:09)
Quoted 8 lines
TGL has an improved CS pre-parser that can now pre-fetch commands across batch boundaries. This improves performances when lots of small batches are used, but has an impact on self-modifying code. If we want to modify the content of a batch from another ring/batch, we need to either guarantee that the memory location is updated before the pre-parser gets to it or we need to turn the pre-parser off around the modification. In i915, we use self-modifying code only for GPU relocations.
Quoted 4 lines
The pre-parser fetches across memory synchronization commands as well, so the only way to guarantee that the writes land before the parser gets to it is to have more instructions between the sync and the destination than the parser FIFO depth, which is not an optimal solution.
Well, our ABI is that memory is coherent before the breadcrumb of *each* batch. That is a fundamental requirement for our signaling to userspace. Please tell me that there is a context flag to turn this off, or we else we need to emit 32x flushes or whatever it takes.
Quoted 8 lines
Quoted 3 lines
Are you referring to the specific case where we have a request modifying an object that is then used as a batch in the next request? Because coherency of objects that are not executed as batches is not impacted.
"Fetches across memory sync" sounds like a major ABI break. The batches are a hard serialisation barrier, with memory coherency guaranteed prior to the signaling at the end of one batch and clear caches guaranteed at the start of the next.
Quoted 5 lines
We have relocs, oa and sseu all using self-modifying code. I expect we will have PTE modifications and much more done via the GPU in the near future. All rely on the
CS_STALLdoing exactly what it says on the tin. -Chris
Quoted 5 lines
I guess the easiest solution is then to keep the parser off outside of user batches. We can default to off and then restore what the user has programmed before the BBSTART. It's not a breach of contract if we say that if you opt-in to the parser then you need to make sure your batches are not self-modifying, right?
Is it just the MI_ARB_ONOFF bits, and is that still a privileged command? i.e. can userspace change mode by itself, or it is a context-param?
Quoted 4 lines
BTW the
CS_STALLdoes not guarantee on pre-gen12 gens that self-modifying code works within the same batch/ring because the pre-parser is already pre-fetching across memory sync points, it just stops at the next arb point.
Ok, we still uphold our contract if they can't execute any code in the window where they would see someone else's data.
-Chris
_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Quoted 50 lines · Chris Wilson
Quoting Daniele Ceraolo Spurio (2019-08-23 16:39:14)
Quoted 43 lines · Chris Wilson
Quoted 34 lines
Quoting Chris Wilson (2019-08-23 16:10:48)
Quoted 24 lines
Quoting Daniele Ceraolo Spurio (2019-08-23 16:05:45)
Quoted 23 lines · Chris Wilson
Quoted 20 lines
Quoting Chris Wilson (2019-08-23 08:27:25)
Quoted 18 lines
Quoting Daniele Ceraolo Spurio (2019-08-23 03:09:09)
Quoted 8 lines
TGL has an improved CS pre-parser that can now pre-fetch commands across batch boundaries. This improves performances when lots of small batches are used, but has an impact on self-modifying code. If we want to modify the content of a batch from another ring/batch, we need to either guarantee that the memory location is updated before the pre-parser gets to it or we need to turn the pre-parser off around the modification. In i915, we use self-modifying code only for GPU relocations.
Quoted 4 lines
The pre-parser fetches across memory synchronization commands as well, so the only way to guarantee that the writes land before the parser gets to it is to have more instructions between the sync and the destination than the parser FIFO depth, which is not an optimal solution.
Well, our ABI is that memory is coherent before the breadcrumb of *each* batch. That is a fundamental requirement for our signaling to userspace. Please tell me that there is a context flag to turn this off, or we else we need to emit 32x flushes or whatever it takes.
Quoted 8 lines
Quoted 3 lines
Are you referring to the specific case where we have a request modifying an object that is then used as a batch in the next request? Because coherency of objects that are not executed as batches is not impacted.
"Fetches across memory sync" sounds like a major ABI break. The batches are a hard serialisation barrier, with memory coherency guaranteed prior to the signaling at the end of one batch and clear caches guaranteed at the start of the next.
Quoted 5 lines
We have relocs, oa and sseu all using self-modifying code. I expect we will have PTE modifications and much more done via the GPU in the near future. All rely on the
CS_STALLdoing exactly what it says on the tin. -ChrisQuoted 5 lines
I guess the easiest solution is then to keep the parser off outside of user batches. We can default to off and then restore what the user has programmed before the BBSTART. It's not a breach of contract if we say that if you opt-in to the parser then you need to make sure your batches are not self-modifying, right?
Quoted 3 lines
Is it just the
MI_ARB_ONOFFbits, and is that still a privileged command? i.e. can userspace change mode by itself, or it is a context-param?
It's the ARB_CHECK, not the ARB_ONOFF, so yes, it is not privileged and userspace can modify it itself. It would've been easier if it was a context param :)
Daniele
Quoted 10 lines
Quoted 5 lines
BTW the
CS_STALLdoes not guarantee on pre-gen12 gens that self-modifying code works within the same batch/ring because the pre-parser is already pre-fetching across memory sync points, it just stops at the next arb point.Ok, we still uphold our contract if they can't execute any code in the window where they would see someone else's data.
-Chris
_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Quoting Daniele Ceraolo Spurio (2019-08-23 16:56:54)
Quoted 53 lines · Chris Wilson
Quoted 50 lines
Quoting Daniele Ceraolo Spurio (2019-08-23 16:39:14)
Quoted 48 lines · Chris Wilson
Quoted 34 lines
Quoting Chris Wilson (2019-08-23 16:10:48)
Quoted 24 lines
Quoting Daniele Ceraolo Spurio (2019-08-23 16:05:45)
Quoted 23 lines · Chris Wilson
Quoted 20 lines
Quoting Chris Wilson (2019-08-23 08:27:25)
Quoted 18 lines
Quoting Daniele Ceraolo Spurio (2019-08-23 03:09:09)
Quoted 8 lines
TGL has an improved CS pre-parser that can now pre-fetch commands across batch boundaries. This improves performances when lots of small batches are used, but has an impact on self-modifying code. If we want to modify the content of a batch from another ring/batch, we need to either guarantee that the memory location is updated before the pre-parser gets to it or we need to turn the pre-parser off around the modification. In i915, we use self-modifying code only for GPU relocations.
Quoted 4 lines
The pre-parser fetches across memory synchronization commands as well, so the only way to guarantee that the writes land before the parser gets to it is to have more instructions between the sync and the destination than the parser FIFO depth, which is not an optimal solution.
Well, our ABI is that memory is coherent before the breadcrumb of *each* batch. That is a fundamental requirement for our signaling to userspace. Please tell me that there is a context flag to turn this off, or we else we need to emit 32x flushes or whatever it takes.
Quoted 8 lines
Quoted 3 lines
Are you referring to the specific case where we have a request modifying an object that is then used as a batch in the next request? Because coherency of objects that are not executed as batches is not impacted.
"Fetches across memory sync" sounds like a major ABI break. The batches are a hard serialisation barrier, with memory coherency guaranteed prior to the signaling at the end of one batch and clear caches guaranteed at the start of the next.
Quoted 5 lines
We have relocs, oa and sseu all using self-modifying code. I expect we will have PTE modifications and much more done via the GPU in the near future. All rely on the
CS_STALLdoing exactly what it says on the tin. -ChrisI guess the easiest solution is then to keep the parser off outside of user batches. We can default to off and then restore what the user has programmed before the BBSTART. It's not a breach of contract if we say that if you opt-in to the parser then you need to make sure your batches are not self-modifying, right?
Quoted 7 lines
Quoted 3 lines
Is it just the
MI_ARB_ONOFFbits, and is that still a privileged command? i.e. can userspace change mode by itself, or it is a context-param?It's the
ARB_CHECK, not theARB_ONOFF, so yes, it is not privileged and userspace can modify it itself. It would've been easier if it was a context param :)
Does it go across a context switch? That might be an easy solution for our internal requests (already true for oa/sseu where we use one context to modify another). I do worry though if there might be leakage across our flush-invalidate barriers between userspace batches. -Chris
_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Quoted 58 lines · Chris Wilson
Quoting Daniele Ceraolo Spurio (2019-08-23 16:56:54)
Quoted 57 lines · Chris Wilson
Quoted 53 lines
Quoting Daniele Ceraolo Spurio (2019-08-23 16:39:14)
Quoted 43 lines · Chris Wilson
Quoted 34 lines
Quoting Chris Wilson (2019-08-23 16:10:48)
Quoted 24 lines
Quoting Daniele Ceraolo Spurio (2019-08-23 16:05:45)
Quoted 23 lines · Chris Wilson
Quoted 20 lines
Quoting Chris Wilson (2019-08-23 08:27:25)
Quoted 18 lines
Quoting Daniele Ceraolo Spurio (2019-08-23 03:09:09)
Quoted 8 lines
TGL has an improved CS pre-parser that can now pre-fetch commands across batch boundaries. This improves performances when lots of small batches are used, but has an impact on self-modifying code. If we want to modify the content of a batch from another ring/batch, we need to either guarantee that the memory location is updated before the pre-parser gets to it or we need to turn the pre-parser off around the modification. In i915, we use self-modifying code only for GPU relocations.
Quoted 4 lines
The pre-parser fetches across memory synchronization commands as well, so the only way to guarantee that the writes land before the parser gets to it is to have more instructions between the sync and the destination than the parser FIFO depth, which is not an optimal solution.
Well, our ABI is that memory is coherent before the breadcrumb of *each* batch. That is a fundamental requirement for our signaling to userspace. Please tell me that there is a context flag to turn this off, or we else we need to emit 32x flushes or whatever it takes.
Quoted 8 lines
Quoted 3 lines
Are you referring to the specific case where we have a request modifying an object that is then used as a batch in the next request? Because coherency of objects that are not executed as batches is not impacted.
"Fetches across memory sync" sounds like a major ABI break. The batches are a hard serialisation barrier, with memory coherency guaranteed prior to the signaling at the end of one batch and clear caches guaranteed at the start of the next.
Quoted 5 lines
We have relocs, oa and sseu all using self-modifying code. I expect we will have PTE modifications and much more done via the GPU in the near future. All rely on the
CS_STALLdoing exactly what it says on the tin. -ChrisQuoted 5 lines
I guess the easiest solution is then to keep the parser off outside of user batches. We can default to off and then restore what the user has programmed before the BBSTART. It's not a breach of contract if we say that if you opt-in to the parser then you need to make sure your batches are not self-modifying, right?
Is it just the
MI_ARB_ONOFFbits, and is that still a privileged command? i.e. can userspace change mode by itself, or it is a context-param?
Quoted 8 lines
Quoted 3 lines
It's the
ARB_CHECK, not theARB_ONOFF, so yes, it is not privileged and userspace can modify it itself. It would've been easier if it was a context param :)Does it go across a context switch? That might be an easy solution for our internal requests (already true for oa/sseu where we use one context to modify another). I do worry though if there might be leakage across our flush-invalidate barriers between userspace batches.
The pre-fetching? no, AFAIK that's confined to the context, so moving the relocs to another context would work; the status of the parser is also ctx save/restored. What leakage case are you worried about? The memory synchronization between contexts is unchanged, a context can only mess up its own instructions. AFAIU the only thing that's possible is that if a batch modifies the next batch in the same context then the CS won't see the update.
Daniele
Quoted 2 lines
-Chris
_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Quoting Daniele Ceraolo Spurio (2019-08-23 18:01:03)
Quoted 70 lines · Chris Wilson
Quoted 58 lines
Quoting Daniele Ceraolo Spurio (2019-08-23 16:56:54)
Quoted 57 lines · Chris Wilson
Quoted 53 lines
Quoting Daniele Ceraolo Spurio (2019-08-23 16:39:14)
Quoted 43 lines · Chris Wilson
Quoted 34 lines
Quoting Chris Wilson (2019-08-23 16:10:48)
Quoted 24 lines
Quoting Daniele Ceraolo Spurio (2019-08-23 16:05:45)
Quoted 23 lines · Chris Wilson
Quoted 20 lines
Quoting Chris Wilson (2019-08-23 08:27:25)
Quoted 18 lines
Quoting Daniele Ceraolo Spurio (2019-08-23 03:09:09)
Quoted 8 lines
TGL has an improved CS pre-parser that can now pre-fetch commands across batch boundaries. This improves performances when lots of small batches are used, but has an impact on self-modifying code. If we want to modify the content of a batch from another ring/batch, we need to either guarantee that the memory location is updated before the pre-parser gets to it or we need to turn the pre-parser off around the modification. In i915, we use self-modifying code only for GPU relocations.
Quoted 4 lines
The pre-parser fetches across memory synchronization commands as well, so the only way to guarantee that the writes land before the parser gets to it is to have more instructions between the sync and the destination than the parser FIFO depth, which is not an optimal solution.
Well, our ABI is that memory is coherent before the breadcrumb of *each* batch. That is a fundamental requirement for our signaling to userspace. Please tell me that there is a context flag to turn this off, or we else we need to emit 32x flushes or whatever it takes.
Quoted 8 lines
Quoted 3 lines
Are you referring to the specific case where we have a request modifying an object that is then used as a batch in the next request? Because coherency of objects that are not executed as batches is not impacted.
"Fetches across memory sync" sounds like a major ABI break. The batches are a hard serialisation barrier, with memory coherency guaranteed prior to the signaling at the end of one batch and clear caches guaranteed at the start of the next.
Quoted 5 lines
We have relocs, oa and sseu all using self-modifying code. I expect we will have PTE modifications and much more done via the GPU in the near future. All rely on the
CS_STALLdoing exactly what it says on the tin. -ChrisQuoted 5 lines
I guess the easiest solution is then to keep the parser off outside of user batches. We can default to off and then restore what the user has programmed before the BBSTART. It's not a breach of contract if we say that if you opt-in to the parser then you need to make sure your batches are not self-modifying, right?
Is it just the
MI_ARB_ONOFFbits, and is that still a privileged command? i.e. can userspace change mode by itself, or it is a context-param?Quoted 8 lines
Quoted 3 lines
It's the
ARB_CHECK, not theARB_ONOFF, so yes, it is not privileged and userspace can modify it itself. It would've been easier if it was a context param :)Does it go across a context switch? That might be an easy solution for our internal requests (already true for oa/sseu where we use one context to modify another). I do worry though if there might be leakage across our flush-invalidate barriers between userspace batches.
Quoted 7 lines
The pre-fetching? no, AFAIK that's confined to the context, so moving the relocs to another context would work; the status of the parser is also ctx save/restored. What leakage case are you worried about? The memory synchronization between contexts is unchanged, a context can only mess up its own instructions. AFAIU the only thing that's possible is that if a batch modifies the next batch in the same context then the CS won't see the update.
Our mission is to ensure that one user cannot mess with another. So if the context boundary is solid, and the user cannot interfere with the TLBs (or at least not able to manipulate an invalid lookup into fetching other data), then the flush-invalidate should be solid between batches. (One always expects the worst though, and we already know the horrors of speculative fetches from the CPU filling the cache with stale data and now it seems like the GPU may be learning similar evil tricks...)
I'm still unnerved though about the prospect of a soft bottom-of-pipe sync. But that's just standard fare for pipecontrols.
Ok, it should be easy enough to create a context on demand for the "rare" GPU relocs and I never have to worry about this again. :) -Chris
_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx