drm/i915: Force pte cacheline to main memory
Subsystems (2)
PATCH 1/1 drm/i915: Force pte cacheline to main memory
We have problems of tgl not seeing a valid pte entry when iommu is enabled. Add heavy handed flushing of entry modification by flushing the cpu, cacheline and then wcb. This forces the pte out to main memory past this point regarless of promises of coherency.
This is an evolution of an experimental patch from Chris Wilson of adding wmb for coherent partners, by adding a clflush to force the cache->memory step.
Testcase: igt/gem_exec_fence/parallel
--- drivers/gpu/drm/i915/gt/gen8_ppgtt.c | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-)
drivers/gpu/drm/i915/gt/gen8_ppgtt.c +12 -2
@@ -389,6 +389,15 @@ static int gen8_ppgtt_alloc(struct i915_address_space *vm,return err; } +static __always_inline inline void +write_pte (gen8_pte_t *const pte,const gen8_pte_t val) +{ + *pte = val; +wmb ();/* cpu to cache */ +clflush ((void *)pte);/* cache to memory */ +wmb ();/* visible to all */ +} + static __always_inline u64 gen8_ppgtt_insert_pte(struct i915_ppgtt *ppgtt, struct i915_page_directory *pdp,
@@ -405,7 +414,8 @@ gen8_ppgtt_insert_pte(struct i915_ppgtt *ppgtt, vaddr =kmap_atomic_px (i915_pt_entry (pd,gen8_pd_index (idx,1 ))); do { GEM_BUG_ON(iter->sg->length < I915_GTT_PAGE_SIZE); - vaddr[gen8_pd_index(idx, 0)] = pte_encode | iter->dma; + write_pte(&vaddr[gen8_pd_index(idx, 0)], + pte_encode | iter->dma); iter->dma += I915_GTT_PAGE_SIZE; if (iter->dma >= iter->max) {
@@ -487,7 +497,7 @@ static void gen8_ppgtt_insert_huge(struct i915_vma *vma, do { GEM_BUG_ON(iter->sg->length < page_size); - vaddr[index++] = encode | iter->dma; + write_pte(&vaddr[index++], encode | iter->dma); start += page_size; iter->dma += page_size;
Signature · 6 lines
2.17.1 _______________________________________________ Intel-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Quoting Mika Kuoppala (2020-05-11 17:08:03)
Quoted 6 lines
We have problems of tgl not seeing a valid pte entry when iommu is enabled. Add heavy handed flushing of entry modification by flushing the cpu, cacheline and then wcb. This forces the pte out to main memory past this point regarless of promises of coherency.
Quoted 7 lines
This is an evolution of an experimental patch from Chris Wilson of adding wmb for coherent partners, by adding a clflush to force the
cache->memorystep.Testcase: igt/gem_exec_fence/parallel
Cc Chris Wilson <[email protected]>Signed-off-by Mika Kuoppala <[email protected]>
Not only does it help tgl, but it is also helping with a coherency problem on Braswell. We see similar problems on gen9 and icl, and I have a trybot run to see if it helps with those.
As it is helping with multiple platforms and diverse symptoms, even if we can't explain why it helps, it is. That makes it prudent to apply to improve the baseline and work from there.
-Chris
_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Quoting Chris Wilson (2020-05-11 17:13:52)
Quoted 11 lines
Quoting Mika Kuoppala (2020-05-11 17:08:03)
Quoted 10 lines
We have problems of tgl not seeing a valid pte entry when iommu is enabled. Add heavy handed flushing of entry modification by flushing the cpu, cacheline and then wcb. This forces the pte out to main memory past this point regarless of promises of coherency.
This is an evolution of an experimental patch from Chris Wilson of adding wmb for coherent partners, by adding a clflush to force the
cache->memorystep.
Quoted 7 lines
Quoted 3 lines
Testcase: igt/gem_exec_fence/parallel
Cc Chris Wilson <[email protected]>Signed-off-by Mika Kuoppala <[email protected]>Not only does it help tgl, but it is also helping with a coherency problem on Braswell. We see similar problems on gen9 and icl, and I have a trybot run to see if it helps with those.
It should be noted that Braswell is using WC kmaps of the PTE, so this should not even be necessary... But if we drop the WC and keep the clflush, it fails. Just to add to the confusion.
-Chris
_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Patchwork
CI[Intel-gfx] ✓ Fi.CI.BAT: success for drm/i915: Force pte cacheline to main memory
In reply to Mika Kuoppala== Series Details ==
== Series Details ==
Series: drm/i915: Force pte cacheline to main memory
URL : https://patchwork.freedesktop.org/series/77162/
State : success
== Summary ==
CI Bug Log - changes from CI_DRM_8466 -> Patchwork_17630
====================================================
Summary
-------
**SUCCESS**
No regressions found.
External URL: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_17630/index.html
Known issues
------------
Here are the changes found in Patchwork_17630 that come from known issues:
### IGT changes ###
#### Issues hit ####
* igt@i915_selftest@live@execlists:
- fi-kbl-7500u: [PASS][1] -> [INCOMPLETE][2] ([CI#80])
[1]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8466/fi-kbl-7500u/igt@i915_selftest@[email protected]
[2]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_17630/fi-kbl-7500u/igt@i915_selftest@[email protected]
[CI#80]: https://gitlab.freedesktop.org/gfx-ci/i915-infra/issues/80
Participating hosts (49 -> 41)
------------------------------
Missing (8): fi-ilk-m540 fi-tgl-dsi fi-hsw-4200u fi-byt-squawks fi-bsw-cyan fi-kbl-7560u fi-byt-clapper fi-bdw-samus
Build changes
-------------
* CI: CI-20190529 -> None
* Linux: CI_DRM_8466 -> Patchwork_17630
CI-20190529: 20190529
CI_DRM_8466: eea130b942bec4cb8c19514b3a63aed25e4dec27 @ git://anongit.freedesktop.org/gfx-ci/linux
IGT_5646: 5a5a3162a7638b3ae38b6dc2545622c204d1b97c @ git://anongit.freedesktop.org/xorg/app/intel-gpu-tools
Patchwork_17630: 0c3db8296c0c2c1216bc9764a6d1b39de2def02c @ git://anongit.freedesktop.org/gfx-ci/linux
== Linux commits ==
0c3db8296c0c drm/i915: Force pte cacheline to main memory
== Logs ==
For more details see: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_17630/index.html
_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Patchwork
CI[Intel-gfx] ✓ Fi.CI.IGT: success for drm/i915: Force pte cacheline to main memory
In reply to Mika Kuoppala== Series Details ==
== Series Details ==
Series: drm/i915: Force pte cacheline to main memory
URL : https://patchwork.freedesktop.org/series/77162/
State : success
== Summary ==
CI Bug Log - changes from CI_DRM_8466_full -> Patchwork_17630_full
====================================================
Summary
-------
**SUCCESS**
No regressions found.
Known issues
------------
Here are the changes found in Patchwork_17630_full that come from known issues:
### IGT changes ###
#### Issues hit ####
* igt@gen9_exec_parse@allowed-all:
- shard-apl: [PASS][1] -> [DMESG-WARN][2] ([i915#1436] / [i915#716])
[1]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8466/shard-apl4/igt@[email protected]
[2]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_17630/shard-apl6/igt@[email protected]
* igt@i915_pm_dc@dc6-psr:
- shard-iclb: [PASS][3] -> [FAIL][4] ([i915#454])
[3]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8466/shard-iclb2/igt@[email protected]
[4]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_17630/shard-iclb6/igt@[email protected]
* igt@kms_cursor_crc@pipe-c-cursor-suspend:
- shard-apl: [PASS][5] -> [DMESG-WARN][6] ([i915#180]) +4 similar issues
[5]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8466/shard-apl8/igt@[email protected]
[6]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_17630/shard-apl6/igt@[email protected]
* igt@kms_hdr@bpc-switch-suspend:
- shard-skl: [PASS][7] -> [FAIL][8] ([i915#1188]) +1 similar issue
[7]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8466/shard-skl9/igt@[email protected]
[8]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_17630/shard-skl8/igt@[email protected]
* igt@kms_plane@plane-panning-bottom-right-suspend-pipe-a-planes:
- shard-kbl: [PASS][9] -> [DMESG-WARN][10] ([i915#180]) +2 similar issues
[9]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8466/shard-kbl4/igt@[email protected]
[10]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_17630/shard-kbl7/igt@[email protected]
* igt@kms_plane_alpha_blend@pipe-b-coverage-7efc:
- shard-skl: [PASS][11] -> [FAIL][12] ([fdo#108145] / [i915#265])
[11]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8466/shard-skl1/igt@[email protected]
[12]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_17630/shard-skl2/igt@[email protected]
* igt@kms_psr@no_drrs:
- shard-iclb: [PASS][13] -> [FAIL][14] ([i915#173])
[13]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8466/shard-iclb6/igt@kms_psr@no_drrs.html
[14]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_17630/shard-iclb1/igt@kms_psr@no_drrs.html
* igt@kms_psr@psr2_no_drrs:
- shard-iclb: [PASS][15] -> [SKIP][16] ([fdo#109441]) +2 similar issues
[15]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8466/shard-iclb2/igt@kms_psr@psr2_no_drrs.html
[16]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_17630/shard-iclb6/igt@kms_psr@psr2_no_drrs.html
#### Possible fixes ####
* igt@kms_cursor_crc@pipe-a-cursor-suspend:
- shard-skl: [INCOMPLETE][17] ([i915#300]) -> [PASS][18]
[17]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8466/shard-skl3/igt@[email protected]
[18]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_17630/shard-skl1/igt@[email protected]
* igt@kms_cursor_legacy@pipe-d-single-move:
- shard-tglb: [SKIP][19] -> [PASS][20]
[19]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8466/shard-tglb3/igt@[email protected]
[20]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_17630/shard-tglb2/igt@[email protected]
* {igt@kms_flip@flip-vs-suspend-interruptible@a-dp1}:
- shard-kbl: [DMESG-WARN][21] ([i915#180]) -> [PASS][22] +9 similar issues
[21]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8466/shard-kbl7/igt@kms_flip@[email protected]
[22]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_17630/shard-kbl4/igt@kms_flip@[email protected]
* {igt@kms_flip@flip-vs-suspend-interruptible@c-dp1}:
- shard-apl: [DMESG-WARN][23] ([i915#180]) -> [PASS][24] +5 similar issues
[23]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8466/shard-apl6/igt@kms_flip@[email protected]
[24]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_17630/shard-apl2/igt@kms_flip@[email protected]
* igt@kms_psr@psr2_primary_mmap_cpu:
- shard-iclb: [SKIP][25] ([fdo#109441]) -> [PASS][26] +2 similar issues
[25]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8466/shard-iclb8/igt@kms_psr@psr2_primary_mmap_cpu.html
[26]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_17630/shard-iclb2/igt@kms_psr@psr2_primary_mmap_cpu.html
* igt@kms_setmode@basic:
- shard-apl: [FAIL][27] ([i915#31]) -> [PASS][28]
[27]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8466/shard-apl8/igt@[email protected]
[28]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_17630/shard-apl6/igt@[email protected]
* {igt@perf@blocking-parameterized}:
- shard-iclb: [FAIL][29] ([i915#1542]) -> [PASS][30]
[29]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8466/shard-iclb7/igt@[email protected]
[30]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_17630/shard-iclb5/igt@[email protected]
#### Warnings ####
* igt@kms_content_protection@atomic:
- shard-apl: [TIMEOUT][31] ([i915#1319]) -> [FAIL][32] ([fdo#110321] / [fdo#110336])
[31]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8466/shard-apl4/igt@[email protected]
[32]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_17630/shard-apl8/igt@[email protected]
* igt@kms_plane_alpha_blend@pipe-a-alpha-basic:
- shard-apl: [FAIL][33] ([fdo#108145] / [i915#265] / [i915#95]) -> [FAIL][34] ([fdo#108145] / [i915#265])
[33]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8466/shard-apl2/igt@[email protected]
[34]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_17630/shard-apl1/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#108145]: https://bugs.freedesktop.org/show_bug.cgi?id=108145
[fdo#109441]: https://bugs.freedesktop.org/show_bug.cgi?id=109441
[fdo#110321]: https://bugs.freedesktop.org/show_bug.cgi?id=110321
[fdo#110336]: https://bugs.freedesktop.org/show_bug.cgi?id=110336
[i915#1188]: https://gitlab.freedesktop.org/drm/intel/issues/1188
[i915#1319]: https://gitlab.freedesktop.org/drm/intel/issues/1319
[i915#1436]: https://gitlab.freedesktop.org/drm/intel/issues/1436
[i915#1542]: https://gitlab.freedesktop.org/drm/intel/issues/1542
[i915#173]: https://gitlab.freedesktop.org/drm/intel/issues/173
[i915#180]: https://gitlab.freedesktop.org/drm/intel/issues/180
[i915#265]: https://gitlab.freedesktop.org/drm/intel/issues/265
[i915#300]: https://gitlab.freedesktop.org/drm/intel/issues/300
[i915#31]: https://gitlab.freedesktop.org/drm/intel/issues/31
[i915#454]: https://gitlab.freedesktop.org/drm/intel/issues/454
[i915#716]: https://gitlab.freedesktop.org/drm/intel/issues/716
[i915#95]: https://gitlab.freedesktop.org/drm/intel/issues/95
Participating hosts (11 -> 11)
------------------------------
No changes in participating hosts
Build changes
-------------
* CI: CI-20190529 -> None
* Linux: CI_DRM_8466 -> Patchwork_17630
CI-20190529: 20190529
CI_DRM_8466: eea130b942bec4cb8c19514b3a63aed25e4dec27 @ git://anongit.freedesktop.org/gfx-ci/linux
IGT_5646: 5a5a3162a7638b3ae38b6dc2545622c204d1b97c @ git://anongit.freedesktop.org/xorg/app/intel-gpu-tools
Patchwork_17630: 0c3db8296c0c2c1216bc9764a6d1b39de2def02c @ git://anongit.freedesktop.org/gfx-ci/linux
piglit_4509: fdc5a4ca11124ab8413c7988896eec4c97336694 @ git://anongit.freedesktop.org/piglit
== Logs ==
For more details see: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_17630/index.html
_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx