drm/i915: add guard page to ggtt->error_capture
Subsystems (2)
PATCH v3 1/1 drm/i915: add guard page to ggtt->error_capture
Write-combining memory allows speculative reads by CPU. ggtt->error_capture is WC mapped to CPU, so CPU/MMU can try to prefetch memory beyond the error_capture, ie it tries to read memory pointed by next PTE in GGTT.
If this PTE points to invalid address DMAR errors will occur. This behaviour was observed on ADL, RPL, DG2 platforms. To avoid it, guard scratch page should be added after error_capture.
---
This patch tries to diminish plague of DMAR read errors present in CI for ADL*, RPL*, DG2 platforms, see for example [1] (grep DMAR). CI is usually tolerant for these errors, so the scale of the problem is not really visible.
To show it I have counted lines containing DMAR read errors in dmesgs produced by CI for all three versions of the patch, but in contrast to v2 I have grepped only for lines containing "PTE Read access". Below stats for kernel w/o patch vs patched one.
v1: 210 vs 0
v2: 201 vs 0
v3: 214 vs 0
Apparently the patch fixes all common PTE read errors.
In previous version there were different numbers due to less exact grepping, "grep DMAR" catched write errors and "DMAR: DRHD: handling fault status reg" lines, anyway the actual number of errors is much bigger - DMAR errors are rate-limited.
[1]: http://gfx-ci.igk.intel.com/tree/drm-tip/CI_DRM_12678/bat-adln-1/dmesg0.txt
Changelog:
v2:
- modified commit message (I hope the diagnosis is correct),
- added bug checks to ensure scratch is initialized on gen3 platforms. CI produces strange stacktrace for it suggesting scratch[0] is NULL, to be removed after resolving the issue with gen3 platforms.
v3:
- removed bug checks, replaced with gen check.
Regards
Andrzej
--- drivers/gpu/drm/i915/gt/intel_ggtt.c | 30 +++++++++++++++++++++++++--- 1 file changed, 27 insertions(+), 3 deletions(-)
drivers/gpu/drm/i915/gt/intel_ggtt.c +27 -3
@@ -503,6 +503,13 @@ static void cleanup_init_ggtt(struct i915_ggtt *ggtt)mutex_destroy (&ggtt->error_mutex); } +static void ggtt_insert_scratch_page (struct i915_ggtt *ggtt,u64 offset) +{ +struct i915_address_space *vm = &ggtt->vm; + + vm->insert_page (vm,px_dma (vm->scratch[0 ]), offset,I915_CACHE_NONE ,0 ); +} +static int init_ggtt (struct i915_ggtt *ggtt) {/*
@@ -553,6 +560,13 @@ static int init_ggtt(struct i915_ggtt *ggtt)* bug, which we expect to cause other failures... */ ggtt->error_capture.size =I915_GTT_PAGE_SIZE ; +/* +* Since CPU can perform speculative reads on error capture +* (write-combining allows it) and since gen12 it really happens +* add scratch page after error capture to avoid DMAR errors. +*/ +if (GRAPHICS_VER (ggtt->vm.i915) >=12 ) + ggtt->error_capture.size +=I915_GTT_PAGE_SIZE ; ggtt->error_capture.color =I915_COLOR_UNEVICTABLE ;if (drm_mm_reserve_node (&ggtt->vm.mm, &ggtt->error_capture)) drm_mm_insert_node_in_range(&ggtt->vm.mm,
@@ -562,11 +576,21 @@ static int init_ggtt(struct i915_ggtt *ggtt)0 , ggtt->mappable_end, DRM_MM_INSERT_LOW); } -if (drm_mm_node_allocated (&ggtt->error_capture)) +if (drm_mm_node_allocated (&ggtt->error_capture)) { +u64 start = ggtt->error_capture.start; +u64 end = ggtt->error_capture.start + ggtt->error_capture.size; +u64 i; + +/* +* During error capture, memcpying from the GGTT is triggering a +* prefetch of the following PTE, so fill it with a guard page. +*/ +for (i = start +I915_GTT_PAGE_SIZE ; i < end; i +=I915_GTT_PAGE_SIZE ) +ggtt_insert_scratch_page (ggtt, i);drm_dbg (&ggtt->vm.i915->drm,"Reserved GGTT:[%llx, %llx] for use by error capture\n" , - ggtt->error_capture.start, - ggtt->error_capture.start + ggtt->error_capture.size); + start, end); + }/* * The upper portion of the GuC address space has a sizeable hole
Signature · 1 line
2.34.1
Patchwork
CI[Intel-gfx] ✓ Fi.CI.BAT: success for drm/i915: add guard page to ggtt->error_capture (rev4)
== Series Details ==
== Series Details ==
Series: drm/i915: add guard page to ggtt->error_capture (rev4)
URL : https://patchwork.freedesktop.org/series/113560/
State : success
== Summary ==
CI Bug Log - changes from CI_DRM_12699 -> Patchwork_113560v4
====================================================
Summary
-------
**SUCCESS**
No regressions found.
External URL: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_113560v4/index.html
Participating hosts (28 -> 27)
------------------------------
Missing (1): fi-snb-2520m
Possible new issues
-------------------
Here are the unknown changes that may have been introduced in Patchwork_113560v4:
### IGT changes ###
#### Suppressed ####
The following results come from untrusted machines, tests, or statuses. They do not affect the overall result.
* igt@i915_selftest@live@reset:
- {bat-rpls-2}: [ABORT][1] ([i915#4983]) -> [INCOMPLETE][2]
[1]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_12699/bat-rpls-2/igt@i915_selftest@[email protected]
[2]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_113560v4/bat-rpls-2/igt@i915_selftest@[email protected]
Known issues
------------
Here are the changes found in Patchwork_113560v4 that come from known issues:
### IGT changes ###
#### Issues hit ####
* igt@i915_selftest@live@execlists:
- fi-kbl-soraka: NOTRUN -> [INCOMPLETE][3] ([i915#7156])
[3]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_113560v4/fi-kbl-soraka/igt@i915_selftest@[email protected]
#### Possible fixes ####
* igt@i915_pm_rpm@basic-rte:
- {bat-adlp-6}: [ABORT][4] ([i915#7977]) -> [PASS][5]
[4]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_12699/bat-adlp-6/igt@[email protected]
[5]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_113560v4/bat-adlp-6/igt@[email protected]
* igt@i915_selftest@live@gt_heartbeat:
- fi-apl-guc: [DMESG-FAIL][6] ([i915#5334]) -> [PASS][7]
[6]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_12699/fi-apl-guc/igt@i915_selftest@live@gt_heartbeat.html
[7]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_113560v4/fi-apl-guc/igt@i915_selftest@live@gt_heartbeat.html
* igt@i915_selftest@live@hangcheck:
- fi-kbl-soraka: [INCOMPLETE][8] ([i915#7913]) -> [PASS][9]
[8]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_12699/fi-kbl-soraka/igt@i915_selftest@[email protected]
[9]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_113560v4/fi-kbl-soraka/igt@i915_selftest@[email protected]
* igt@i915_selftest@live@mman:
- {bat-rpls-1}: [TIMEOUT][10] ([i915#6794]) -> [PASS][11]
[10]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_12699/bat-rpls-1/igt@i915_selftest@[email protected]
[11]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_113560v4/bat-rpls-1/igt@i915_selftest@[email protected]
* igt@i915_suspend@basic-s2idle-without-i915:
- fi-apl-guc: [DMESG-WARN][12] ([i915#1982]) -> [PASS][13]
[12]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_12699/fi-apl-guc/igt@[email protected]
[13]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_113560v4/fi-apl-guc/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#109295]: https://bugs.freedesktop.org/show_bug.cgi?id=109295
[i915#1982]: https://gitlab.freedesktop.org/drm/intel/issues/1982
[i915#3291]: https://gitlab.freedesktop.org/drm/intel/issues/3291
[i915#3301]: https://gitlab.freedesktop.org/drm/intel/issues/3301
[i915#3708]: https://gitlab.freedesktop.org/drm/intel/issues/3708
[i915#4613]: https://gitlab.freedesktop.org/drm/intel/issues/4613
[i915#4983]: https://gitlab.freedesktop.org/drm/intel/issues/4983
[i915#5334]: https://gitlab.freedesktop.org/drm/intel/issues/5334
[i915#6311]: https://gitlab.freedesktop.org/drm/intel/issues/6311
[i915#6621]: https://gitlab.freedesktop.org/drm/intel/issues/6621
[i915#6794]: https://gitlab.freedesktop.org/drm/intel/issues/6794
[i915#7156]: https://gitlab.freedesktop.org/drm/intel/issues/7156
[i915#7359]: https://gitlab.freedesktop.org/drm/intel/issues/7359
[i915#7828]: https://gitlab.freedesktop.org/drm/intel/issues/7828
[i915#7913]: https://gitlab.freedesktop.org/drm/intel/issues/7913
[i915#7977]: https://gitlab.freedesktop.org/drm/intel/issues/7977
Build changes
-------------
* Linux: CI_DRM_12699 -> Patchwork_113560v4
CI-20190529: 20190529
CI_DRM_12699: 412c3ca0460a03d10ef8cd18a09417050edc85d9 @ git://anongit.freedesktop.org/gfx-ci/linux
IGT_7149: 1c7ea154b625e1fb826f1519b816b4256dd10b62 @ https://gitlab.freedesktop.org/drm/igt-gpu-tools.git
Patchwork_113560v4: 412c3ca0460a03d10ef8cd18a09417050edc85d9 @ git://anongit.freedesktop.org/gfx-ci/linux
### Linux commits
dcf943248993 drm/i915: add guard page to ggtt->error_capture
== Logs ==
For more details see: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_113560v4/index.html
Patchwork
CI[Intel-gfx] ✓ Fi.CI.IGT: success for drm/i915: add guard page to ggtt->error_capture (rev4)
In reply to Andrzej Hajda== Series Details ==
== Series Details ==
Series: drm/i915: add guard page to ggtt->error_capture (rev4)
URL : https://patchwork.freedesktop.org/series/113560/
State : success
== Summary ==
CI Bug Log - changes from CI_DRM_12699_full -> Patchwork_113560v4_full
====================================================
Summary
-------
**SUCCESS**
No regressions found.
External URL: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_113560v4/index.html
Participating hosts (11 -> 10)
------------------------------
Missing (1): shard-rkl0
Possible new issues
-------------------
Here are the unknown changes that may have been introduced in Patchwork_113560v4_full:
### IGT changes ###
#### Suppressed ####
The following results come from untrusted machines, tests, or statuses. They do not affect the overall result.
* igt@gem_exec_schedule@wide@rcs0:
- {shard-tglu}: NOTRUN -> [INCOMPLETE][1]
[1]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_113560v4/shard-tglu-2/igt@gem_exec_schedule@[email protected]
Known issues
------------
Here are the changes found in Patchwork_113560v4_full that come from known issues:
### IGT changes ###
#### Issues hit ####
* igt@gem_exec_fair@basic-deadline:
- shard-glk: [PASS][2] -> [FAIL][3] ([i915#2846])
[2]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_12699/shard-glk8/igt@[email protected]
[3]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_113560v4/shard-glk7/igt@[email protected]
* igt@gem_exec_fair@basic-pace-share@rcs0:
- shard-glk: [PASS][4] -> [FAIL][5] ([i915#2842]) +1 similar issue
[4]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_12699/shard-glk9/igt@gem_exec_fair@[email protected]
[5]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_113560v4/shard-glk2/igt@gem_exec_fair@[email protected]
* igt@gen9_exec_parse@allowed-single:
- shard-glk: [PASS][6] -> [ABORT][7] ([i915#5566])
[6]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_12699/shard-glk3/igt@[email protected]
[7]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_113560v4/shard-glk1/igt@[email protected]
#### Possible fixes ####
* igt@drm_fdinfo@most-busy-idle-check-all@rcs0:
- {shard-rkl}: [FAIL][8] ([i915#7742]) -> [PASS][9]
[8]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_12699/shard-rkl-3/igt@drm_fdinfo@[email protected]
[9]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_113560v4/shard-rkl-3/igt@drm_fdinfo@[email protected]
* igt@fbdev@read:
- {shard-tglu}: [SKIP][10] ([i915#2582]) -> [PASS][11]
[10]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_12699/shard-tglu-6/igt@[email protected]
[11]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_113560v4/shard-tglu-4/igt@[email protected]
* igt@gem_ctx_persistence@engines-hang@bcs0:
- {shard-rkl}: [SKIP][12] ([i915#6252]) -> [PASS][13]
[12]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_12699/shard-rkl-5/igt@gem_ctx_persistence@[email protected]
[13]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_113560v4/shard-rkl-2/igt@gem_ctx_persistence@[email protected]
* igt@gem_eio@reset-stress:
- {shard-dg1}: [FAIL][14] ([i915#5784]) -> [PASS][15]
[14]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_12699/shard-dg1-13/igt@[email protected]
[15]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_113560v4/shard-dg1-14/igt@[email protected]
* igt@gem_eio@suspend:
- {shard-rkl}: [FAIL][16] ([i915#5115] / [i915#7052]) -> [PASS][17]
[16]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_12699/shard-rkl-3/igt@[email protected]
[17]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_113560v4/shard-rkl-1/igt@[email protected]
* igt@gem_exec_balancer@fairslice:
- {shard-rkl}: [SKIP][18] ([i915#6259]) -> [PASS][19]
[18]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_12699/shard-rkl-5/igt@[email protected]
[19]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_113560v4/shard-rkl-4/igt@[email protected]
* igt@gem_exec_fair@basic-none-rrul@rcs0:
- {shard-rkl}: [FAIL][20] ([i915#2842]) -> [PASS][21] +1 similar issue
[20]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_12699/shard-rkl-1/igt@gem_exec_fair@[email protected]
[21]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_113560v4/shard-rkl-5/igt@gem_exec_fair@[email protected]
* igt@gem_exec_reloc@basic-cpu-gtt-noreloc:
- {shard-rkl}: [SKIP][22] ([i915#3281]) -> [PASS][23] +4 similar issues
[22]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_12699/shard-rkl-1/igt@[email protected]
[23]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_113560v4/shard-rkl-5/igt@[email protected]
* igt@gem_mmap_gtt@coherency:
- {shard-rkl}: [SKIP][24] ([fdo#111656]) -> [PASS][25]
[24]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_12699/shard-rkl-1/igt@[email protected]
[25]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_113560v4/shard-rkl-5/igt@[email protected]
* igt@gem_pread@uncached:
- {shard-rkl}: [SKIP][26] ([i915#3282]) -> [PASS][27]
[26]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_12699/shard-rkl-1/igt@[email protected]
[27]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_113560v4/shard-rkl-5/igt@[email protected]
* igt@gen9_exec_parse@secure-batches:
- {shard-rkl}: [SKIP][28] ([i915#2527]) -> [PASS][29] +1 similar issue
[28]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_12699/shard-rkl-1/igt@[email protected]
[29]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_113560v4/shard-rkl-5/igt@[email protected]
* igt@i915_pm_lpsp@kms-lpsp@kms-lpsp-hdmi-a:
- {shard-tglu}: [FAIL][30] ([i915#3825]) -> [PASS][31]
[30]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_12699/shard-tglu-4/igt@i915_pm_lpsp@[email protected]
[31]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_113560v4/shard-tglu-1/igt@i915_pm_lpsp@[email protected]
* igt@i915_pm_rpm@dpms-mode-unset-lpsp:
- {shard-dg1}: [SKIP][32] ([i915#1397]) -> [PASS][33]
[32]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_12699/shard-dg1-13/igt@[email protected]
[33]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_113560v4/shard-dg1-14/igt@[email protected]
* igt@kms_ccs@pipe-c-bad-pixel-format-y_tiled_gen12_rc_ccs:
- {shard-tglu}: [SKIP][34] ([i915#1845] / [i915#7651]) -> [PASS][35] +3 similar issues
[34]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_12699/shard-tglu-6/igt@kms_ccs@pipe-c-bad-pixel-format-y_tiled_gen12_rc_ccs.html
[35]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_113560v4/shard-tglu-4/igt@kms_ccs@pipe-c-bad-pixel-format-y_tiled_gen12_rc_ccs.html
* igt@kms_ccs@pipe-c-random-ccs-data-y_tiled_gen12_rc_ccs_cc:
- {shard-tglu}: [SKIP][36] ([i915#7651]) -> [PASS][37] +6 similar issues
[36]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_12699/shard-tglu-6/igt@kms_ccs@pipe-c-random-ccs-data-y_tiled_gen12_rc_ccs_cc.html
[37]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_113560v4/shard-tglu-4/igt@kms_ccs@pipe-c-random-ccs-data-y_tiled_gen12_rc_ccs_cc.html
* igt@kms_cursor_edge_walk@top-edge@pipe-a-hdmi-a-1-256x256:
- shard-glk: [DMESG-FAIL][38] ([i915#118]) -> [PASS][39]
[38]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_12699/shard-glk4/igt@kms_cursor_edge_walk@[email protected]
[39]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_113560v4/shard-glk3/igt@kms_cursor_edge_walk@[email protected]
* igt@kms_flip@2x-flip-vs-expired-vblank-interruptible@bc-hdmi-a1-hdmi-a2:
- shard-glk: [FAIL][40] ([i915#79]) -> [PASS][41]
[40]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_12699/shard-glk8/igt@kms_flip@[email protected]
[41]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_113560v4/shard-glk4/igt@kms_flip@[email protected]
* igt@kms_frontbuffer_tracking@fbc-1p-primscrn-pri-shrfb-draw-mmap-gtt:
- {shard-tglu}: [SKIP][42] ([i915#1849]) -> [PASS][43] +2 similar issues
[42]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_12699/shard-tglu-6/igt@kms_frontbuffer_tracking@fbc-1p-primscrn-pri-shrfb-draw-mmap-gtt.html
[43]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_113560v4/shard-tglu-4/igt@kms_frontbuffer_tracking@fbc-1p-primscrn-pri-shrfb-draw-mmap-gtt.html
* igt@kms_rotation_crc@sprite-rotation-90:
- {shard-tglu}: [SKIP][44] ([i915#1845]) -> [PASS][45]
[44]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_12699/shard-tglu-6/igt@[email protected]
[45]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_113560v4/shard-tglu-4/igt@[email protected]
* igt@kms_universal_plane@universal-plane-pageflip-windowed-pipe-a:
- {shard-tglu}: [SKIP][46] ([fdo#109274]) -> [PASS][47]
[46]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_12699/shard-tglu-6/igt@kms_universal_plane@universal-plane-pageflip-windowed-pipe-a.html
[47]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_113560v4/shard-tglu-4/igt@kms_universal_plane@universal-plane-pageflip-windowed-pipe-a.html
* igt@perf@gen8-unprivileged-single-ctx-counters:
- {shard-rkl}: [SKIP][48] ([i915#2436]) -> [PASS][49]
[48]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_12699/shard-rkl-1/igt@[email protected]
[49]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_113560v4/shard-rkl-5/igt@[email protected]
{name}: This element is suppressed. This means it is ignored when computing
the status of the difference (SUCCESS, WARNING, or FAILURE).
[IGT#2]: https://gitlab.freedesktop.org/drm/igt-gpu-tools/issues/2
[fdo#109274]: https://bugs.freedesktop.org/show_bug.cgi?id=109274
[fdo#109279]: https://bugs.freedesktop.org/show_bug.cgi?id=109279
[fdo#109280]: https://bugs.freedesktop.org/show_bug.cgi?id=109280
[fdo#109283]: https://bugs.freedesktop.org/show_bug.cgi?id=109283
[fdo#109285]: https://bugs.freedesktop.org/show_bug.cgi?id=109285
[fdo#109289]: https://bugs.freedesktop.org/show_bug.cgi?id=109289
[fdo#109295]: https://bugs.freedesktop.org/show_bug.cgi?id=109295
[fdo#109303]: https://bugs.freedesktop.org/show_bug.cgi?id=109303
[fdo#109307]: https://bugs.freedesktop.org/show_bug.cgi?id=109307
[fdo#109308]: https://bugs.freedesktop.org/show_bug.cgi?id=109308
[fdo#109312]: https://bugs.freedesktop.org/show_bug.cgi?id=109312
[fdo#109314]: https://bugs.freedesktop.org/show_bug.cgi?id=109314
[fdo#109315]: https://bugs.freedesktop.org/show_bug.cgi?id=109315
[fdo#109506]: https://bugs.freedesktop.org/show_bug.cgi?id=109506
[fdo#109642]: https://bugs.freedesktop.org/show_bug.cgi?id=109642
[fdo#110189]: https://bugs.freedesktop.org/show_bug.cgi?id=110189
[fdo#110723]: https://bugs.freedesktop.org/show_bug.cgi?id=110723
[fdo#111068]: https://bugs.freedesktop.org/show_bug.cgi?id=111068
[fdo#111614]: https://bugs.freedesktop.org/show_bug.cgi?id=111614
[fdo#111615]: https://bugs.freedesktop.org/show_bug.cgi?id=111615
[fdo#111644]: https://bugs.freedesktop.org/show_bug.cgi?id=111644
[fdo#111656]: https://bugs.freedesktop.org/show_bug.cgi?id=111656
[fdo#111825]: https://bugs.freedesktop.org/show_bug.cgi?id=111825
[fdo#111827]: https://bugs.freedesktop.org/show_bug.cgi?id=111827
[i915#1072]: https://gitlab.freedesktop.org/drm/intel/issues/1072
[i915#118]: https://gitlab.freedesktop.org/drm/intel/issues/118
[i915#1257]: https://gitlab.freedesktop.org/drm/intel/issues/1257
[i915#132]: https://gitlab.freedesktop.org/drm/intel/issues/132
[i915#1397]: https://gitlab.freedesktop.org/drm/intel/issues/1397
[i915#1722]: https://gitlab.freedesktop.org/drm/intel/issues/1722
[i915#1755]: https://gitlab.freedesktop.org/drm/intel/issues/1755
[i915#1825]: https://gitlab.freedesktop.org/drm/intel/issues/1825
[i915#1839]: https://gitlab.freedesktop.org/drm/intel/issues/1839
[i915#1845]: https://gitlab.freedesktop.org/drm/intel/issues/1845
[i915#1849]: https://gitlab.freedesktop.org/drm/intel/issues/1849
[i915#2232]: https://gitlab.freedesktop.org/drm/intel/issues/2232
[i915#2434]: https://gitlab.freedesktop.org/drm/intel/issues/2434
[i915#2436]: https://gitlab.freedesktop.org/drm/intel/issues/2436
[i915#2527]: https://gitlab.freedesktop.org/drm/intel/issues/2527
[i915#2575]: https://gitlab.freedesktop.org/drm/intel/issues/2575
[i915#2582]: https://gitlab.freedesktop.org/drm/intel/issues/2582
[i915#2587]: https://gitlab.freedesktop.org/drm/intel/issues/2587
[i915#2672]: https://gitlab.freedesktop.org/drm/intel/issues/2672
[i915#2705]: https://gitlab.freedesktop.org/drm/intel/issues/2705
[i915#280]: https://gitlab.freedesktop.org/drm/intel/issues/280
[i915#284]: https://gitlab.freedesktop.org/drm/intel/issues/284
[i915#2842]: https://gitlab.freedesktop.org/drm/intel/issues/2842
[i915#2846]: https://gitlab.freedesktop.org/drm/intel/issues/2846
[i915#2856]: https://gitlab.freedesktop.org/drm/intel/issues/2856
[i915#2920]: https://gitlab.freedesktop.org/drm/intel/issues/2920
[i915#3116]: https://gitlab.freedesktop.org/drm/intel/issues/3116
[i915#3281]: https://gitlab.freedesktop.org/drm/intel/issues/3281
[i915#3282]: https://gitlab.freedesktop.org/drm/intel/issues/3282
[i915#3297]: https://gitlab.freedesktop.org/drm/intel/issues/3297
[i915#3299]: https://gitlab.freedesktop.org/drm/intel/issues/3299
[i915#3301]: https://gitlab.freedesktop.org/drm/intel/issues/3301
[i915#3323]: https://gitlab.freedesktop.org/drm/intel/issues/3323
[i915#3359]: https://gitlab.freedesktop.org/drm/intel/issues/3359
[i915#3458]: https://gitlab.freedesktop.org/drm/intel/issues/3458
[i915#3528]: https://gitlab.freedesktop.org/drm/intel/issues/3528
[i915#3536]: https://gitlab.freedesktop.org/drm/intel/issues/3536
[i915#3539]: https://gitlab.freedesktop.org/drm/intel/issues/3539
[i915#3546]: https://gitlab.freedesktop.org/drm/intel/issues/3546
[i915#3555]: https://gitlab.freedesktop.org/drm/intel/issues/3555
[i915#3558]: https://gitlab.freedesktop.org/drm/intel/issues/3558
[i915#3637]: https://gitlab.freedesktop.org/drm/intel/issues/3637
[i915#3638]: https://gitlab.freedesktop.org/drm/intel/issues/3638
[i915#3639]: https://gitlab.freedesktop.org/drm/intel/issues/3639
[i915#3689]: https://gitlab.freedesktop.org/drm/intel/issues/3689
[i915#3708]: https://gitlab.freedesktop.org/drm/intel/issues/3708
[i915#3734]: https://gitlab.freedesktop.org/drm/intel/issues/3734
[i915#3742]: https://gitlab.freedesktop.org/drm/intel/issues/3742
[i915#3804]: https://gitlab.freedesktop.org/drm/intel/issues/3804
[i915#3825]: https://gitlab.freedesktop.org/drm/intel/issues/3825
[i915#3840]: https://gitlab.freedesktop.org/drm/intel/issues/3840
[i915#3886]: https://gitlab.freedesktop.org/drm/intel/issues/3886
[i915#3952]: https://gitlab.freedesktop.org/drm/intel/issues/3952
[i915#3955]: https://gitlab.freedesktop.org/drm/intel/issues/3955
[i915#4070]: https://gitlab.freedesktop.org/drm/intel/issues/4070
[i915#4077]: https://gitlab.freedesktop.org/drm/intel/issues/4077
[i915#4078]: https://gitlab.freedesktop.org/drm/intel/issues/4078
[i915#4083]: https://gitlab.freedesktop.org/drm/intel/issues/4083
[i915#4098]: https://gitlab.freedesktop.org/drm/intel/issues/4098
[i915#4103]: https://gitlab.freedesktop.org/drm/intel/issues/4103
[i915#4215]: https://gitlab.freedesktop.org/drm/intel/issues/4215
[i915#426]: https://gitlab.freedesktop.org/drm/intel/issues/426
[i915#4270]: https://gitlab.freedesktop.org/drm/intel/issues/4270
[i915#4281]: https://gitlab.freedesktop.org/drm/intel/issues/4281
[i915#4349]: https://gitlab.freedesktop.org/drm/intel/issues/4349
[i915#4387]: https://gitlab.freedesktop.org/drm/intel/issues/4387
[i915#4391]: https://gitlab.freedesktop.org/drm/intel/issues/4391
[i915#4538]: https://gitlab.freedesktop.org/drm/intel/issues/4538
[i915#4613]: https://gitlab.freedesktop.org/drm/intel/issues/4613
[i915#4812]: https://gitlab.freedesktop.org/drm/intel/issues/4812
[i915#4833]: https://gitlab.freedesktop.org/drm/intel/issues/4833
[i915#4852]: https://gitlab.freedesktop.org/drm/intel/issues/4852
[i915#4859]: https://gitlab.freedesktop.org/drm/intel/issues/4859
[i915#4860]: https://gitlab.freedesktop.org/drm/intel/issues/4860
[i915#4884]: https://gitlab.freedesktop.org/drm/intel/issues/4884
[i915#5115]: https://gitlab.freedesktop.org/drm/intel/issues/5115
[i915#5176]: https://gitlab.freedesktop.org/drm/intel/issues/5176
[i915#5235]: https://gitlab.freedesktop.org/drm/intel/issues/5235
[i915#5286]: https://gitlab.freedesktop.org/drm/intel/issues/5286
[i915#5289]: https://gitlab.freedesktop.org/drm/intel/issues/5289
[i915#5325]: https://gitlab.freedesktop.org/drm/intel/issues/5325
[i915#533]: https://gitlab.freedesktop.org/drm/intel/issues/533
[i915#5461]: https://gitlab.freedesktop.org/drm/intel/issues/5461
[i915#5563]: https://gitlab.freedesktop.org/drm/intel/issues/5563
[i915#5566]: https://gitlab.freedesktop.org/drm/intel/issues/5566
[i915#5723]: https://gitlab.freedesktop.org/drm/intel/issues/5723
[i915#5784]: https://gitlab.freedesktop.org/drm/intel/issues/5784
[i915#6095]: https://gitlab.freedesktop.org/drm/intel/issues/6095
[i915#6227]: https://gitlab.freedesktop.org/drm/intel/issues/6227
[i915#6230]: https://gitlab.freedesktop.org/drm/intel/issues/6230
[i915#6245]: https://gitlab.freedesktop.org/drm/intel/issues/6245
[i915#6248]: https://gitlab.freedesktop.org/drm/intel/issues/6248
[i915#6252]: https://gitlab.freedesktop.org/drm/intel/issues/6252
[i915#6259]: https://gitlab.freedesktop.org/drm/intel/issues/6259
[i915#6268]: https://gitlab.freedesktop.org/drm/intel/issues/6268
[i915#6335]: https://gitlab.freedesktop.org/drm/intel/issues/6335
[i915#6433]: https://gitlab.freedesktop.org/drm/intel/issues/6433
[i915#6493]: https://gitlab.freedesktop.org/drm/intel/issues/6493
[i915#6497]: https://gitlab.freedesktop.org/drm/intel/issues/6497
[i915#6524]: https://gitlab.freedesktop.org/drm/intel/issues/6524
[i915#658]: https://gitlab.freedesktop.org/drm/intel/issues/658
[i915#6590]: https://gitlab.freedesktop.org/drm/intel/issues/6590
[i915#6621]: https://gitlab.freedesktop.org/drm/intel/issues/6621
[i915#6768]: https://gitlab.freedesktop.org/drm/intel/issues/6768
[i915#6944]: https://gitlab.freedesktop.org/drm/intel/issues/6944
[i915#6946]: https://gitlab.freedesktop.org/drm/intel/issues/6946
[i915#6953]: https://gitlab.freedesktop.org/drm/intel/issues/6953
[i915#7037]: https://gitlab.freedesktop.org/drm/intel/issues/7037
[i915#7052]: https://gitlab.freedesktop.org/drm/intel/issues/7052
[i915#7116]: https://gitlab.freedesktop.org/drm/intel/issues/7116
[i915#7118]: https://gitlab.freedesktop.org/drm/intel/issues/7118
[i915#7128]: https://gitlab.freedesktop.org/drm/intel/issues/7128
[i915#7456]: https://gitlab.freedesktop.org/drm/intel/issues/7456
[i915#7561]: https://gitlab.freedesktop.org/drm/intel/issues/7561
[i915#7651]: https://gitlab.freedesktop.org/drm/intel/issues/7651
[i915#7697]: https://gitlab.freedesktop.org/drm/intel/issues/7697
[i915#7701]: https://gitlab.freedesktop.org/drm/intel/issues/7701
[i915#7707]: https://gitlab.freedesktop.org/drm/intel/issues/7707
[i915#7711]: https://gitlab.freedesktop.org/drm/intel/issues/7711
[i915#7742]: https://gitlab.freedesktop.org/drm/intel/issues/7742
[i915#7828]: https://gitlab.freedesktop.org/drm/intel/issues/7828
[i915#79]: https://gitlab.freedesktop.org/drm/intel/issues/79
[i915#7949]: https://gitlab.freedesktop.org/drm/intel/issues/7949
[i915#7957]: https://gitlab.freedesktop.org/drm/intel/issues/7957
[i915#7975]: https://gitlab.freedesktop.org/drm/intel/issues/7975
Build changes
-------------
* Linux: CI_DRM_12699 -> Patchwork_113560v4
CI-20190529: 20190529
CI_DRM_12699: 412c3ca0460a03d10ef8cd18a09417050edc85d9 @ git://anongit.freedesktop.org/gfx-ci/linux
IGT_7149: 1c7ea154b625e1fb826f1519b816b4256dd10b62 @ https://gitlab.freedesktop.org/drm/igt-gpu-tools.git
Patchwork_113560v4: 412c3ca0460a03d10ef8cd18a09417050edc85d9 @ git://anongit.freedesktop.org/gfx-ci/linux
== Logs ==
For more details see: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_113560v4/index.html
Hi Andrzej,
Quoted 9 lines · Andrzej Hajda
Write-combining memory allows speculative reads by CPU.
ggtt->error_captureis WC mapped to CPU, so CPU/MMU can try to prefetch memory beyond theerror_capture, ie it tries to read memory pointed by next PTE in GGTT.
If this PTE points to invalid address DMAR errors will occur. This behaviour was observed on ADL, RPL, DG2 platforms. To avoid it, guard scratch page should be added aftererror_capture.Signed-off-by Andrzej Hajda <[email protected]>
Thanks,
Andi
Quoted 95 lines
---
This patch tries to diminish plague of DMAR read errors present in CI for ADL*, RPL*, DG2 platforms, see for example [1] (grep DMAR). CI is usually tolerant for these errors, so the scale of the problem is not really visible.
To show it I have counted lines containing DMAR read errors in dmesgs produced by CI for all three versions of the patch, but in contrast to v2 I have grepped only for lines containing "PTE Read access". Below stats for kernel w/o patch vs patched one.
v1: 210 vs 0
v2: 201 vs 0
v3: 214 vs 0
Apparently the patch fixes all common PTE read errors.In previous version there were different numbers due to less exact grepping, "grep DMAR" catched write errors and "DMAR: DRHD: handling fault status reg" lines, anyway the actual number of errors is much bigger - DMAR errors are rate-limited.
[1]: http://gfx-ci.igk.intel.com/tree/drm-tip/CI_DRM_12678/bat-adln-1/dmesg0.txt
Changelog:
v2:
- modified commit message (I hope the diagnosis is correct),
- added bug checks to ensure scratch is initialized on gen3 platforms. CI produces strange stacktrace for it suggesting scratch[0] is NULL, to be removed after resolving the issue with gen3 platforms.
v3:
- removed bug checks, replaced with gen check.Regards
Andrzej--- drivers/gpu/drm/i915/gt/intel_ggtt.c | 30 +++++++++++++++++++++++++--- 1 file changed, 27 insertions(+), 3 deletions(-)drivers/gpu/drm/i915/gt/intel_ggtt.c +27
-3@@ -503,6 +503,13 @@ static void cleanup_init_ggtt(struct i915_ggtt *ggtt)mutex_destroy (&ggtt->error_mutex); } +static void ggtt_insert_scratch_page (struct i915_ggtt *ggtt,u64 offset) +{ +struct i915_address_space *vm = &ggtt->vm; + + vm->insert_page (vm,px_dma (vm->scratch[0 ]), offset,I915_CACHE_NONE ,0 ); +} +static int init_ggtt (struct i915_ggtt *ggtt) {/* @@ -553,6 +560,13 @@ static int init_ggtt(struct i915_ggtt *ggtt)* bug, which we expect to cause other failures... */ ggtt->error_capture.size =I915_GTT_PAGE_SIZE ; +/* +* Since CPU can perform speculative reads on error capture +* (write-combining allows it) and since gen12 it really happens +* add scratch page after error capture to avoid DMAR errors. +*/ +if (GRAPHICS_VER (ggtt->vm.i915) >=12 ) + ggtt->error_capture.size +=I915_GTT_PAGE_SIZE ; ggtt->error_capture.color =I915_COLOR_UNEVICTABLE ;if (drm_mm_reserve_node (&ggtt->vm.mm, &ggtt->error_capture)) drm_mm_insert_node_in_range(&ggtt->vm.mm,@@ -562,11 +576,21 @@ static int init_ggtt(struct i915_ggtt *ggtt)0 , ggtt->mappable_end, DRM_MM_INSERT_LOW); } -if (drm_mm_node_allocated (&ggtt->error_capture)) +if (drm_mm_node_allocated (&ggtt->error_capture)) { +u64 start = ggtt->error_capture.start; +u64 end = ggtt->error_capture.start + ggtt->error_capture.size; +u64 i; + +/* +* During error capture, memcpying from the GGTT is triggering a +* prefetch of the following PTE, so fill it with a guard page. +*/ +for (i = start +I915_GTT_PAGE_SIZE ; i < end; i +=I915_GTT_PAGE_SIZE ) +ggtt_insert_scratch_page (ggtt, i);drm_dbg (&ggtt->vm.i915->drm,"Reserved GGTT:[%llx, %llx] for use by error capture\n" , - ggtt->error_capture.start, - ggtt->error_capture.start + ggtt->error_capture.size); + start, end); + }/* * The upper portion of the GuC address space has a sizeable hole Signature · 1 line
2.34.1