* Re: [Intel-gfx] [RFC PATCH] x86/mm: Fix PAT bit missing from page protection modify mask
2023-04-24 12:35 [Intel-gfx] [RFC PATCH] x86/mm: Fix PAT bit missing from page protection modify mask Janusz Krzysztofik
@ 2023-04-24 13:29 ` Juergen Gross
2023-04-24 15:09 ` Marek Marczykowski-Górecki
` (7 subsequent siblings)
8 siblings, 0 replies; 10+ messages in thread
From: Juergen Gross @ 2023-04-24 13:29 UTC (permalink / raw)
To: Janusz Krzysztofik, Thomas Gleixner, Ingo Molnar, Borislav Petkov,
Dave Hansen
Cc: Yu Zhao, David Hildenbrand, intel-gfx, x86, linux-kernel,
dri-devel, Andrzej Hajda, H. Peter Anvin, Andrew Morton,
Chris Wilson, Nirmoy Das
[-- Attachment #1.1.1: Type: text/plain, Size: 3300 bytes --]
On 24.04.23 14:35, Janusz Krzysztofik wrote:
> Visible glitches have been observed when running graphics applications on
> Linux under Xen hypervisor. Those observations have been confirmed with
> failures from kms_pwrite_crc Intel GPU test that verifies data coherency
> of DRM frame buffer objects using hardware CRC checksums calculated by
> display controllers, exposed to userspace via debugfs. Affected
> processing paths have then been identified with new test variants that
> mmap the objects using different methods and caching modes.
>
> When running as a Xen PV guest, Linux uses Xen provided PAT configuration
> which is different from its native one. In particular, Xen specific PTE
> encoding of write-combining caching, likely used by graphics applications,
> differs from the Linux default one found among statically defined minimal
> set of supported modes. Since Xen defines PTE encoding of the WC mode as
> _PAGE_PAT, it no longer belongs to the minimal set, depends on correct
> handling of _PAGE_PAT bit, and can be mismatched with write-back caching.
>
> When a user calls mmap() for a DRM buffer object, DRM device specific
> .mmap file operation, called from mmap_region(), takes care of setting PTE
> encoding bits in a vm_page_prot field of an associated virtual memory area
> structure. Unfortunately, _PAGE_PAT bit is not preserved when the vma's
> .vm_flags are then applied to .vm_page_prot via vm_set_page_prot(). Bits
> to be preserved are determined with _PAGE_CHG_MASK symbol that doesn't
> cover _PAGE_PAT. As a consequence, WB caching is requested instead of WC
> when running under Xen (also, WP is silently changed to WT, and UC
> downgraded to UC_MINUS). When running on bare metal, WC is not affected,
> but WP and WT extra modes are unintentionally replaced with WC and UC,
> respectively.
>
> WP and WT modes, encoded with _PAGE_PAT bit set, were introduced by commit
> 281d4078bec3 ("x86: Make page cache mode a real type"). Care was taken
> to extend _PAGE_CACHE_MASK symbol with that additional bit, but that
> symbol has never been used for identification of bits preserved when
> applying page protection flags. Support for all cache modes under Xen,
> including the problematic WC mode, was then introduced by commit
> 47591df50512 ("xen: Support Xen pv-domains using PAT").
>
> Extend bitmask used by pgprot_modify() for selecting bits to be preserved
> with _PAGE_PAT bit. However, since that bit can be reused as _PAGE_PSE,
> and the _PAGE_CHG_MASK symbol, primarly used by pte_modify(), is likely
> intentionally defined with that bit not set, keep that symbol unchanged.
Hmm, I wonder whether pte_mkhuge() shouldn't just set _PAGE_PSE, but use
pgprot_4k_2_large() before doing so.
OTOH a use case like in remove_migration_pte(), where pte_mkhuge() is
directly followed by a call of arch_make_huge_pte(), which in turn is
calling pte_mkhuge() again, would set _always_ the PAT bit.
When running as a Xen PV guest this doesn't matter at all, as large or
huge pages aren't supported there. So clearly something for the MM
maintainers. :-)
Juergen
P.S.: Janusz, nice catch! The QubesOS folks who reported the problem
originally will test your patch under Xen soon.
[-- Attachment #1.1.2: OpenPGP public key --]
[-- Type: application/pgp-keys, Size: 3149 bytes --]
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 495 bytes --]
^ permalink raw reply [flat|nested] 10+ messages in thread* Re: [Intel-gfx] [RFC PATCH] x86/mm: Fix PAT bit missing from page protection modify mask
2023-04-24 12:35 [Intel-gfx] [RFC PATCH] x86/mm: Fix PAT bit missing from page protection modify mask Janusz Krzysztofik
2023-04-24 13:29 ` Juergen Gross
@ 2023-04-24 15:09 ` Marek Marczykowski-Górecki
2023-04-24 20:11 ` [Intel-gfx] ✗ Fi.CI.CHECKPATCH: warning for " Patchwork
` (6 subsequent siblings)
8 siblings, 0 replies; 10+ messages in thread
From: Marek Marczykowski-Górecki @ 2023-04-24 15:09 UTC (permalink / raw)
To: Janusz Krzysztofik
Cc: Juergen Gross, x86, Yu Zhao, David Hildenbrand, intel-gfx,
Dave Hansen, linux-kernel, dri-devel, Andrzej Hajda, Ingo Molnar,
Borislav Petkov, H. Peter Anvin, Thomas Gleixner, Chris Wilson,
Andrew Morton, Nirmoy Das
[-- Attachment #1: Type: text/plain, Size: 3145 bytes --]
On Mon, Apr 24, 2023 at 02:35:24PM +0200, Janusz Krzysztofik wrote:
> Visible glitches have been observed when running graphics applications on
> Linux under Xen hypervisor. Those observations have been confirmed with
> failures from kms_pwrite_crc Intel GPU test that verifies data coherency
> of DRM frame buffer objects using hardware CRC checksums calculated by
> display controllers, exposed to userspace via debugfs. Affected
> processing paths have then been identified with new test variants that
> mmap the objects using different methods and caching modes.
>
> When running as a Xen PV guest, Linux uses Xen provided PAT configuration
> which is different from its native one. In particular, Xen specific PTE
> encoding of write-combining caching, likely used by graphics applications,
> differs from the Linux default one found among statically defined minimal
> set of supported modes. Since Xen defines PTE encoding of the WC mode as
> _PAGE_PAT, it no longer belongs to the minimal set, depends on correct
> handling of _PAGE_PAT bit, and can be mismatched with write-back caching.
>
> When a user calls mmap() for a DRM buffer object, DRM device specific
> .mmap file operation, called from mmap_region(), takes care of setting PTE
> encoding bits in a vm_page_prot field of an associated virtual memory area
> structure. Unfortunately, _PAGE_PAT bit is not preserved when the vma's
> .vm_flags are then applied to .vm_page_prot via vm_set_page_prot(). Bits
> to be preserved are determined with _PAGE_CHG_MASK symbol that doesn't
> cover _PAGE_PAT. As a consequence, WB caching is requested instead of WC
> when running under Xen (also, WP is silently changed to WT, and UC
> downgraded to UC_MINUS). When running on bare metal, WC is not affected,
> but WP and WT extra modes are unintentionally replaced with WC and UC,
> respectively.
>
> WP and WT modes, encoded with _PAGE_PAT bit set, were introduced by commit
> 281d4078bec3 ("x86: Make page cache mode a real type"). Care was taken
> to extend _PAGE_CACHE_MASK symbol with that additional bit, but that
> symbol has never been used for identification of bits preserved when
> applying page protection flags. Support for all cache modes under Xen,
> including the problematic WC mode, was then introduced by commit
> 47591df50512 ("xen: Support Xen pv-domains using PAT").
>
> Extend bitmask used by pgprot_modify() for selecting bits to be preserved
> with _PAGE_PAT bit. However, since that bit can be reused as _PAGE_PSE,
> and the _PAGE_CHG_MASK symbol, primarly used by pte_modify(), is likely
> intentionally defined with that bit not set, keep that symbol unchanged.
>
> Closes: https://gitlab.freedesktop.org/drm/intel/-/issues/7648
> Fixes: 281d4078bec3 ("x86: Make page cache mode a real type")
> Signed-off-by: Janusz Krzysztofik <janusz.krzysztofik@linux.intel.com>
> Cc: stable@vger.kernel.org # v3.19+
I can confirm it fixes the issue, thanks!
Tested-by: Marek Marczykowski-Górecki <marmarek@invisiblethingslab.com>
--
Best Regards,
Marek Marczykowski-Górecki
Invisible Things Lab
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 484 bytes --]
^ permalink raw reply [flat|nested] 10+ messages in thread* [Intel-gfx] ✗ Fi.CI.CHECKPATCH: warning for x86/mm: Fix PAT bit missing from page protection modify mask
2023-04-24 12:35 [Intel-gfx] [RFC PATCH] x86/mm: Fix PAT bit missing from page protection modify mask Janusz Krzysztofik
2023-04-24 13:29 ` Juergen Gross
2023-04-24 15:09 ` Marek Marczykowski-Górecki
@ 2023-04-24 20:11 ` Patchwork
2023-04-24 20:11 ` [Intel-gfx] ✗ Fi.CI.SPARSE: " Patchwork
` (5 subsequent siblings)
8 siblings, 0 replies; 10+ messages in thread
From: Patchwork @ 2023-04-24 20:11 UTC (permalink / raw)
To: Janusz Krzysztofik; +Cc: intel-gfx
== Series Details ==
Series: x86/mm: Fix PAT bit missing from page protection modify mask
URL : https://patchwork.freedesktop.org/series/116883/
State : warning
== Summary ==
Error: dim checkpatch failed
43584c6560ff x86/mm: Fix PAT bit missing from page protection modify mask
-:50: WARNING:COMMIT_LOG_USE_LINK: Unknown link reference 'Closes:', use 'Link:' instead
#50:
Closes: https://gitlab.freedesktop.org/drm/intel/-/issues/7648
total: 0 errors, 1 warnings, 0 checks, 12 lines checked
^ permalink raw reply [flat|nested] 10+ messages in thread* [Intel-gfx] ✗ Fi.CI.SPARSE: warning for x86/mm: Fix PAT bit missing from page protection modify mask
2023-04-24 12:35 [Intel-gfx] [RFC PATCH] x86/mm: Fix PAT bit missing from page protection modify mask Janusz Krzysztofik
` (2 preceding siblings ...)
2023-04-24 20:11 ` [Intel-gfx] ✗ Fi.CI.CHECKPATCH: warning for " Patchwork
@ 2023-04-24 20:11 ` Patchwork
2023-04-24 20:29 ` [Intel-gfx] ✓ Fi.CI.BAT: success " Patchwork
` (4 subsequent siblings)
8 siblings, 0 replies; 10+ messages in thread
From: Patchwork @ 2023-04-24 20:11 UTC (permalink / raw)
To: Janusz Krzysztofik; +Cc: intel-gfx
== Series Details ==
Series: x86/mm: Fix PAT bit missing from page protection modify mask
URL : https://patchwork.freedesktop.org/series/116883/
State : warning
== Summary ==
Error: dim sparse failed
Sparse version: v0.6.2
Fast mode used, each commit won't be checked separately.
^ permalink raw reply [flat|nested] 10+ messages in thread* [Intel-gfx] ✓ Fi.CI.BAT: success for x86/mm: Fix PAT bit missing from page protection modify mask
2023-04-24 12:35 [Intel-gfx] [RFC PATCH] x86/mm: Fix PAT bit missing from page protection modify mask Janusz Krzysztofik
` (3 preceding siblings ...)
2023-04-24 20:11 ` [Intel-gfx] ✗ Fi.CI.SPARSE: " Patchwork
@ 2023-04-24 20:29 ` Patchwork
2023-04-25 1:16 ` [Intel-gfx] ✓ Fi.CI.IGT: " Patchwork
` (3 subsequent siblings)
8 siblings, 0 replies; 10+ messages in thread
From: Patchwork @ 2023-04-24 20:29 UTC (permalink / raw)
To: Janusz Krzysztofik; +Cc: intel-gfx
[-- Attachment #1: Type: text/plain, Size: 4229 bytes --]
== Series Details ==
Series: x86/mm: Fix PAT bit missing from page protection modify mask
URL : https://patchwork.freedesktop.org/series/116883/
State : success
== Summary ==
CI Bug Log - changes from CI_DRM_13054 -> Patchwork_116883v1
====================================================
Summary
-------
**SUCCESS**
No regressions found.
External URL: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_116883v1/index.html
Participating hosts (38 -> 37)
------------------------------
Missing (1): fi-snb-2520m
Known issues
------------
Here are the changes found in Patchwork_116883v1 that come from known issues:
### IGT changes ###
#### Issues hit ####
* igt@gem_exec_suspend@basic-s3@smem:
- bat-rpls-1: NOTRUN -> [ABORT][1] ([i915#6687] / [i915#7978])
[1]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_116883v1/bat-rpls-1/igt@gem_exec_suspend@basic-s3@smem.html
* igt@i915_selftest@live@hangcheck:
- bat-dg2-8: [PASS][2] -> [ABORT][3] ([i915#7913] / [i915#7979])
[2]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_13054/bat-dg2-8/igt@i915_selftest@live@hangcheck.html
[3]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_116883v1/bat-dg2-8/igt@i915_selftest@live@hangcheck.html
* igt@i915_selftest@live@slpc:
- bat-rpls-1: NOTRUN -> [DMESG-FAIL][4] ([i915#6367])
[4]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_116883v1/bat-rpls-1/igt@i915_selftest@live@slpc.html
* igt@kms_pipe_crc_basic@nonblocking-crc@pipe-d-dp-1:
- bat-dg2-8: [PASS][5] -> [FAIL][6] ([i915#7932])
[5]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_13054/bat-dg2-8/igt@kms_pipe_crc_basic@nonblocking-crc@pipe-d-dp-1.html
[6]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_116883v1/bat-dg2-8/igt@kms_pipe_crc_basic@nonblocking-crc@pipe-d-dp-1.html
#### Possible fixes ####
* igt@i915_selftest@live@migrate:
- bat-adlp-6: [DMESG-FAIL][7] ([i915#7699]) -> [PASS][8]
[7]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_13054/bat-adlp-6/igt@i915_selftest@live@migrate.html
[8]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_116883v1/bat-adlp-6/igt@i915_selftest@live@migrate.html
* igt@i915_selftest@live@requests:
- bat-rpls-1: [ABORT][9] ([i915#4983] / [i915#7911]) -> [PASS][10]
[9]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_13054/bat-rpls-1/igt@i915_selftest@live@requests.html
[10]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_116883v1/bat-rpls-1/igt@i915_selftest@live@requests.html
* igt@kms_pipe_crc_basic@nonblocking-crc-frame-sequence@pipe-d-dp-1:
- bat-dg2-8: [FAIL][11] ([i915#7932]) -> [PASS][12]
[11]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_13054/bat-dg2-8/igt@kms_pipe_crc_basic@nonblocking-crc-frame-sequence@pipe-d-dp-1.html
[12]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_116883v1/bat-dg2-8/igt@kms_pipe_crc_basic@nonblocking-crc-frame-sequence@pipe-d-dp-1.html
[i915#4983]: https://gitlab.freedesktop.org/drm/intel/issues/4983
[i915#6367]: https://gitlab.freedesktop.org/drm/intel/issues/6367
[i915#6687]: https://gitlab.freedesktop.org/drm/intel/issues/6687
[i915#7699]: https://gitlab.freedesktop.org/drm/intel/issues/7699
[i915#7911]: https://gitlab.freedesktop.org/drm/intel/issues/7911
[i915#7913]: https://gitlab.freedesktop.org/drm/intel/issues/7913
[i915#7932]: https://gitlab.freedesktop.org/drm/intel/issues/7932
[i915#7978]: https://gitlab.freedesktop.org/drm/intel/issues/7978
[i915#7979]: https://gitlab.freedesktop.org/drm/intel/issues/7979
Build changes
-------------
* Linux: CI_DRM_13054 -> Patchwork_116883v1
CI-20190529: 20190529
CI_DRM_13054: 8cabe2adb8e028197f9535daffd3d5ff98d51d8b @ git://anongit.freedesktop.org/gfx-ci/linux
IGT_7266: 94411dd85f9ad6d76fb7b2097197122703a3914c @ https://gitlab.freedesktop.org/drm/igt-gpu-tools.git
Patchwork_116883v1: 8cabe2adb8e028197f9535daffd3d5ff98d51d8b @ git://anongit.freedesktop.org/gfx-ci/linux
### Linux commits
51783673cfcd x86/mm: Fix PAT bit missing from page protection modify mask
== Logs ==
For more details see: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_116883v1/index.html
[-- Attachment #2: Type: text/html, Size: 5064 bytes --]
^ permalink raw reply [flat|nested] 10+ messages in thread* [Intel-gfx] ✓ Fi.CI.IGT: success for x86/mm: Fix PAT bit missing from page protection modify mask
2023-04-24 12:35 [Intel-gfx] [RFC PATCH] x86/mm: Fix PAT bit missing from page protection modify mask Janusz Krzysztofik
` (4 preceding siblings ...)
2023-04-24 20:29 ` [Intel-gfx] ✓ Fi.CI.BAT: success " Patchwork
@ 2023-04-25 1:16 ` Patchwork
2023-04-28 10:15 ` [Intel-gfx] [RFC PATCH] " Andi Shyti
` (2 subsequent siblings)
8 siblings, 0 replies; 10+ messages in thread
From: Patchwork @ 2023-04-25 1:16 UTC (permalink / raw)
To: Janusz Krzysztofik; +Cc: intel-gfx
[-- Attachment #1: Type: text/plain, Size: 12135 bytes --]
== Series Details ==
Series: x86/mm: Fix PAT bit missing from page protection modify mask
URL : https://patchwork.freedesktop.org/series/116883/
State : success
== Summary ==
CI Bug Log - changes from CI_DRM_13054_full -> Patchwork_116883v1_full
====================================================
Summary
-------
**SUCCESS**
No regressions found.
Participating hosts (7 -> 7)
------------------------------
No changes in participating hosts
Known issues
------------
Here are the changes found in Patchwork_116883v1_full that come from known issues:
### IGT changes ###
#### Issues hit ####
* igt@gem_barrier_race@remote-request@rcs0:
- shard-apl: [PASS][1] -> [ABORT][2] ([i915#8211] / [i915#8234])
[1]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_13054/shard-apl6/igt@gem_barrier_race@remote-request@rcs0.html
[2]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_116883v1/shard-apl1/igt@gem_barrier_race@remote-request@rcs0.html
* igt@gen9_exec_parse@allowed-single:
- shard-apl: [PASS][3] -> [ABORT][4] ([i915#5566])
[3]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_13054/shard-apl2/igt@gen9_exec_parse@allowed-single.html
[4]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_116883v1/shard-apl3/igt@gen9_exec_parse@allowed-single.html
* igt@i915_pm_rps@reset:
- shard-snb: [PASS][5] -> [INCOMPLETE][6] ([i915#7790])
[5]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_13054/shard-snb6/igt@i915_pm_rps@reset.html
[6]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_116883v1/shard-snb4/igt@i915_pm_rps@reset.html
* igt@kms_color@ctm-green-to-red@pipe-a-hdmi-a-1:
- shard-snb: NOTRUN -> [SKIP][7] ([fdo#109271]) +36 similar issues
[7]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_116883v1/shard-snb1/igt@kms_color@ctm-green-to-red@pipe-a-hdmi-a-1.html
* igt@kms_setmode@basic@pipe-a-hdmi-a-1:
- shard-snb: NOTRUN -> [FAIL][8] ([i915#5465]) +1 similar issue
[8]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_116883v1/shard-snb1/igt@kms_setmode@basic@pipe-a-hdmi-a-1.html
* igt@perf@oa-exponents@0-rcs0:
- shard-glk: [PASS][9] -> [ABORT][10] ([i915#5213])
[9]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_13054/shard-glk7/igt@perf@oa-exponents@0-rcs0.html
[10]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_116883v1/shard-glk6/igt@perf@oa-exponents@0-rcs0.html
#### Possible fixes ####
* igt@gem_eio@reset-stress:
- {shard-dg1}: [FAIL][11] ([i915#5784]) -> [PASS][12]
[11]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_13054/shard-dg1-17/igt@gem_eio@reset-stress.html
[12]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_116883v1/shard-dg1-17/igt@gem_eio@reset-stress.html
* igt@gem_exec_fair@basic-pace-share@rcs0:
- shard-glk: [FAIL][13] ([i915#2842]) -> [PASS][14]
[13]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_13054/shard-glk2/igt@gem_exec_fair@basic-pace-share@rcs0.html
[14]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_116883v1/shard-glk5/igt@gem_exec_fair@basic-pace-share@rcs0.html
* igt@i915_pm_rc6_residency@rc6-idle@vecs0:
- {shard-dg1}: [FAIL][15] ([i915#3591]) -> [PASS][16]
[15]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_13054/shard-dg1-14/igt@i915_pm_rc6_residency@rc6-idle@vecs0.html
[16]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_116883v1/shard-dg1-16/igt@i915_pm_rc6_residency@rc6-idle@vecs0.html
* igt@i915_pm_rpm@modeset-non-lpsp:
- {shard-rkl}: [SKIP][17] ([i915#1397]) -> [PASS][18]
[17]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_13054/shard-rkl-7/igt@i915_pm_rpm@modeset-non-lpsp.html
[18]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_116883v1/shard-rkl-3/igt@i915_pm_rpm@modeset-non-lpsp.html
* igt@i915_pm_rps@engine-order:
- shard-apl: [FAIL][19] ([i915#6537]) -> [PASS][20]
[19]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_13054/shard-apl3/igt@i915_pm_rps@engine-order.html
[20]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_116883v1/shard-apl4/igt@i915_pm_rps@engine-order.html
* igt@kms_async_flips@alternate-sync-async-flip@pipe-a-hdmi-a-1:
- shard-glk: [FAIL][21] ([i915#2521]) -> [PASS][22]
[21]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_13054/shard-glk1/igt@kms_async_flips@alternate-sync-async-flip@pipe-a-hdmi-a-1.html
[22]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_116883v1/shard-glk4/igt@kms_async_flips@alternate-sync-async-flip@pipe-a-hdmi-a-1.html
* igt@kms_cursor_legacy@flip-vs-cursor-atomic-transitions:
- shard-glk: [FAIL][23] ([i915#2346]) -> [PASS][24]
[23]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_13054/shard-glk9/igt@kms_cursor_legacy@flip-vs-cursor-atomic-transitions.html
[24]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_116883v1/shard-glk8/igt@kms_cursor_legacy@flip-vs-cursor-atomic-transitions.html
* igt@kms_cursor_legacy@single-move@pipe-b:
- {shard-dg1}: [INCOMPLETE][25] ([i915#8011] / [i915#8347]) -> [PASS][26]
[25]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_13054/shard-dg1-14/igt@kms_cursor_legacy@single-move@pipe-b.html
[26]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_116883v1/shard-dg1-16/igt@kms_cursor_legacy@single-move@pipe-b.html
{name}: This element is suppressed. This means it is ignored when computing
the status of the difference (SUCCESS, WARNING, or FAILURE).
[fdo#109271]: https://bugs.freedesktop.org/show_bug.cgi?id=109271
[fdo#109283]: https://bugs.freedesktop.org/show_bug.cgi?id=109283
[fdo#109289]: https://bugs.freedesktop.org/show_bug.cgi?id=109289
[fdo#111068]: https://bugs.freedesktop.org/show_bug.cgi?id=111068
[fdo#111615]: https://bugs.freedesktop.org/show_bug.cgi?id=111615
[fdo#111825]: https://bugs.freedesktop.org/show_bug.cgi?id=111825
[fdo#111827]: https://bugs.freedesktop.org/show_bug.cgi?id=111827
[fdo#112054]: https://bugs.freedesktop.org/show_bug.cgi?id=112054
[fdo#112283]: https://bugs.freedesktop.org/show_bug.cgi?id=112283
[i915#1072]: https://gitlab.freedesktop.org/drm/intel/issues/1072
[i915#1257]: https://gitlab.freedesktop.org/drm/intel/issues/1257
[i915#1397]: https://gitlab.freedesktop.org/drm/intel/issues/1397
[i915#1839]: https://gitlab.freedesktop.org/drm/intel/issues/1839
[i915#1937]: https://gitlab.freedesktop.org/drm/intel/issues/1937
[i915#2346]: https://gitlab.freedesktop.org/drm/intel/issues/2346
[i915#2433]: https://gitlab.freedesktop.org/drm/intel/issues/2433
[i915#2437]: https://gitlab.freedesktop.org/drm/intel/issues/2437
[i915#2521]: https://gitlab.freedesktop.org/drm/intel/issues/2521
[i915#2527]: https://gitlab.freedesktop.org/drm/intel/issues/2527
[i915#2575]: https://gitlab.freedesktop.org/drm/intel/issues/2575
[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#2842]: https://gitlab.freedesktop.org/drm/intel/issues/2842
[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#3359]: https://gitlab.freedesktop.org/drm/intel/issues/3359
[i915#3458]: https://gitlab.freedesktop.org/drm/intel/issues/3458
[i915#3539]: https://gitlab.freedesktop.org/drm/intel/issues/3539
[i915#3555]: https://gitlab.freedesktop.org/drm/intel/issues/3555
[i915#3591]: https://gitlab.freedesktop.org/drm/intel/issues/3591
[i915#3638]: https://gitlab.freedesktop.org/drm/intel/issues/3638
[i915#3689]: https://gitlab.freedesktop.org/drm/intel/issues/3689
[i915#3708]: https://gitlab.freedesktop.org/drm/intel/issues/3708
[i915#3886]: https://gitlab.freedesktop.org/drm/intel/issues/3886
[i915#4036]: https://gitlab.freedesktop.org/drm/intel/issues/4036
[i915#4077]: https://gitlab.freedesktop.org/drm/intel/issues/4077
[i915#4079]: https://gitlab.freedesktop.org/drm/intel/issues/4079
[i915#4083]: https://gitlab.freedesktop.org/drm/intel/issues/4083
[i915#4103]: https://gitlab.freedesktop.org/drm/intel/issues/4103
[i915#4212]: https://gitlab.freedesktop.org/drm/intel/issues/4212
[i915#4213]: https://gitlab.freedesktop.org/drm/intel/issues/4213
[i915#426]: https://gitlab.freedesktop.org/drm/intel/issues/426
[i915#4270]: https://gitlab.freedesktop.org/drm/intel/issues/4270
[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#4579]: https://gitlab.freedesktop.org/drm/intel/issues/4579
[i915#4771]: https://gitlab.freedesktop.org/drm/intel/issues/4771
[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#4860]: https://gitlab.freedesktop.org/drm/intel/issues/4860
[i915#4958]: https://gitlab.freedesktop.org/drm/intel/issues/4958
[i915#5176]: https://gitlab.freedesktop.org/drm/intel/issues/5176
[i915#5213]: https://gitlab.freedesktop.org/drm/intel/issues/5213
[i915#5235]: https://gitlab.freedesktop.org/drm/intel/issues/5235
[i915#5286]: https://gitlab.freedesktop.org/drm/intel/issues/5286
[i915#5288]: https://gitlab.freedesktop.org/drm/intel/issues/5288
[i915#5289]: https://gitlab.freedesktop.org/drm/intel/issues/5289
[i915#5325]: https://gitlab.freedesktop.org/drm/intel/issues/5325
[i915#5354]: https://gitlab.freedesktop.org/drm/intel/issues/5354
[i915#5439]: https://gitlab.freedesktop.org/drm/intel/issues/5439
[i915#5465]: https://gitlab.freedesktop.org/drm/intel/issues/5465
[i915#5563]: https://gitlab.freedesktop.org/drm/intel/issues/5563
[i915#5566]: https://gitlab.freedesktop.org/drm/intel/issues/5566
[i915#5784]: https://gitlab.freedesktop.org/drm/intel/issues/5784
[i915#6095]: https://gitlab.freedesktop.org/drm/intel/issues/6095
[i915#6433]: https://gitlab.freedesktop.org/drm/intel/issues/6433
[i915#6524]: https://gitlab.freedesktop.org/drm/intel/issues/6524
[i915#6537]: https://gitlab.freedesktop.org/drm/intel/issues/6537
[i915#658]: https://gitlab.freedesktop.org/drm/intel/issues/658
[i915#6590]: https://gitlab.freedesktop.org/drm/intel/issues/6590
[i915#6946]: https://gitlab.freedesktop.org/drm/intel/issues/6946
[i915#7116]: https://gitlab.freedesktop.org/drm/intel/issues/7116
[i915#7561]: https://gitlab.freedesktop.org/drm/intel/issues/7561
[i915#7697]: https://gitlab.freedesktop.org/drm/intel/issues/7697
[i915#7701]: https://gitlab.freedesktop.org/drm/intel/issues/7701
[i915#7711]: https://gitlab.freedesktop.org/drm/intel/issues/7711
[i915#7790]: https://gitlab.freedesktop.org/drm/intel/issues/7790
[i915#7828]: https://gitlab.freedesktop.org/drm/intel/issues/7828
[i915#8011]: https://gitlab.freedesktop.org/drm/intel/issues/8011
[i915#8178]: https://gitlab.freedesktop.org/drm/intel/issues/8178
[i915#8211]: https://gitlab.freedesktop.org/drm/intel/issues/8211
[i915#8234]: https://gitlab.freedesktop.org/drm/intel/issues/8234
[i915#8311]: https://gitlab.freedesktop.org/drm/intel/issues/8311
[i915#8347]: https://gitlab.freedesktop.org/drm/intel/issues/8347
Build changes
-------------
* Linux: CI_DRM_13054 -> Patchwork_116883v1
CI-20190529: 20190529
CI_DRM_13054: 8cabe2adb8e028197f9535daffd3d5ff98d51d8b @ git://anongit.freedesktop.org/gfx-ci/linux
IGT_7266: 94411dd85f9ad6d76fb7b2097197122703a3914c @ https://gitlab.freedesktop.org/drm/igt-gpu-tools.git
Patchwork_116883v1: 8cabe2adb8e028197f9535daffd3d5ff98d51d8b @ 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_116883v1/index.html
[-- Attachment #2: Type: text/html, Size: 8186 bytes --]
^ permalink raw reply [flat|nested] 10+ messages in thread* Re: [Intel-gfx] [RFC PATCH] x86/mm: Fix PAT bit missing from page protection modify mask
2023-04-24 12:35 [Intel-gfx] [RFC PATCH] x86/mm: Fix PAT bit missing from page protection modify mask Janusz Krzysztofik
` (5 preceding siblings ...)
2023-04-25 1:16 ` [Intel-gfx] ✓ Fi.CI.IGT: " Patchwork
@ 2023-04-28 10:15 ` Andi Shyti
2023-04-28 11:37 ` Andi Shyti
2023-05-02 20:42 ` Andi Shyti
8 siblings, 0 replies; 10+ messages in thread
From: Andi Shyti @ 2023-04-28 10:15 UTC (permalink / raw)
To: Janusz Krzysztofik
Cc: Juergen Gross, x86, Yu Zhao, David Hildenbrand, intel-gfx,
Dave Hansen, linux-kernel, dri-devel, Andrzej Hajda, Ingo Molnar,
Borislav Petkov, H. Peter Anvin, Thomas Gleixner, Chris Wilson,
Andrew Morton, Nirmoy Das
Hi Janusz,
On Mon, Apr 24, 2023 at 02:35:24PM +0200, Janusz Krzysztofik wrote:
> Visible glitches have been observed when running graphics applications on
> Linux under Xen hypervisor. Those observations have been confirmed with
> failures from kms_pwrite_crc Intel GPU test that verifies data coherency
> of DRM frame buffer objects using hardware CRC checksums calculated by
> display controllers, exposed to userspace via debugfs. Affected
> processing paths have then been identified with new test variants that
> mmap the objects using different methods and caching modes.
>
> When running as a Xen PV guest, Linux uses Xen provided PAT configuration
> which is different from its native one. In particular, Xen specific PTE
> encoding of write-combining caching, likely used by graphics applications,
> differs from the Linux default one found among statically defined minimal
> set of supported modes. Since Xen defines PTE encoding of the WC mode as
> _PAGE_PAT, it no longer belongs to the minimal set, depends on correct
> handling of _PAGE_PAT bit, and can be mismatched with write-back caching.
>
> When a user calls mmap() for a DRM buffer object, DRM device specific
> .mmap file operation, called from mmap_region(), takes care of setting PTE
> encoding bits in a vm_page_prot field of an associated virtual memory area
> structure. Unfortunately, _PAGE_PAT bit is not preserved when the vma's
> .vm_flags are then applied to .vm_page_prot via vm_set_page_prot(). Bits
> to be preserved are determined with _PAGE_CHG_MASK symbol that doesn't
> cover _PAGE_PAT. As a consequence, WB caching is requested instead of WC
> when running under Xen (also, WP is silently changed to WT, and UC
> downgraded to UC_MINUS). When running on bare metal, WC is not affected,
> but WP and WT extra modes are unintentionally replaced with WC and UC,
> respectively.
>
> WP and WT modes, encoded with _PAGE_PAT bit set, were introduced by commit
> 281d4078bec3 ("x86: Make page cache mode a real type"). Care was taken
> to extend _PAGE_CACHE_MASK symbol with that additional bit, but that
> symbol has never been used for identification of bits preserved when
> applying page protection flags. Support for all cache modes under Xen,
> including the problematic WC mode, was then introduced by commit
> 47591df50512 ("xen: Support Xen pv-domains using PAT").
>
> Extend bitmask used by pgprot_modify() for selecting bits to be preserved
> with _PAGE_PAT bit. However, since that bit can be reused as _PAGE_PSE,
> and the _PAGE_CHG_MASK symbol, primarly used by pte_modify(), is likely
> intentionally defined with that bit not set, keep that symbol unchanged.
>
> Closes: https://gitlab.freedesktop.org/drm/intel/-/issues/7648
> Fixes: 281d4078bec3 ("x86: Make page cache mode a real type")
> Signed-off-by: Janusz Krzysztofik <janusz.krzysztofik@linux.intel.com>
> Cc: stable@vger.kernel.org # v3.19+
> ---
> arch/x86/include/asm/pgtable.h | 6 ++++--
> 1 file changed, 4 insertions(+), 2 deletions(-)
>
> diff --git a/arch/x86/include/asm/pgtable.h b/arch/x86/include/asm/pgtable.h
> index 7425f32e52932..f797f8da2e5b6 100644
> --- a/arch/x86/include/asm/pgtable.h
> +++ b/arch/x86/include/asm/pgtable.h
> @@ -654,8 +654,10 @@ static inline pmd_t pmd_modify(pmd_t pmd, pgprot_t newprot)
> #define pgprot_modify pgprot_modify
> static inline pgprot_t pgprot_modify(pgprot_t oldprot, pgprot_t newprot)
> {
> - pgprotval_t preservebits = pgprot_val(oldprot) & _PAGE_CHG_MASK;
> - pgprotval_t addbits = pgprot_val(newprot) & ~_PAGE_CHG_MASK;
> + unsigned long mask = _PAGE_CHG_MASK | _PAGE_CACHE_MASK;
nice catch!
Reviewed-by: Andi Shyti <andi.shyti@linux.intel.com>
Thanks,
Andi
> +
> + pgprotval_t preservebits = pgprot_val(oldprot) & mask;
> + pgprotval_t addbits = pgprot_val(newprot) & ~mask;
> return __pgprot(preservebits | addbits);
> }
>
> --
> 2.40.0
^ permalink raw reply [flat|nested] 10+ messages in thread* Re: [Intel-gfx] [RFC PATCH] x86/mm: Fix PAT bit missing from page protection modify mask
2023-04-24 12:35 [Intel-gfx] [RFC PATCH] x86/mm: Fix PAT bit missing from page protection modify mask Janusz Krzysztofik
` (6 preceding siblings ...)
2023-04-28 10:15 ` [Intel-gfx] [RFC PATCH] " Andi Shyti
@ 2023-04-28 11:37 ` Andi Shyti
2023-05-02 20:42 ` Andi Shyti
8 siblings, 0 replies; 10+ messages in thread
From: Andi Shyti @ 2023-04-28 11:37 UTC (permalink / raw)
To: Janusz Krzysztofik
Cc: Juergen Gross, x86, Yu Zhao, David Hildenbrand, intel-gfx,
Dave Hansen, linux-kernel, dri-devel, Andrzej Hajda, Ingo Molnar,
Borislav Petkov, H. Peter Anvin, Thomas Gleixner, Chris Wilson,
Andrew Morton, Nirmoy Das
Hi Janusz,
On Mon, Apr 24, 2023 at 02:35:24PM +0200, Janusz Krzysztofik wrote:
> Visible glitches have been observed when running graphics applications on
> Linux under Xen hypervisor. Those observations have been confirmed with
> failures from kms_pwrite_crc Intel GPU test that verifies data coherency
> of DRM frame buffer objects using hardware CRC checksums calculated by
> display controllers, exposed to userspace via debugfs. Affected
> processing paths have then been identified with new test variants that
> mmap the objects using different methods and caching modes.
BTW, are you going to update those tests in IGT?
Andi
^ permalink raw reply [flat|nested] 10+ messages in thread* Re: [Intel-gfx] [RFC PATCH] x86/mm: Fix PAT bit missing from page protection modify mask
2023-04-24 12:35 [Intel-gfx] [RFC PATCH] x86/mm: Fix PAT bit missing from page protection modify mask Janusz Krzysztofik
` (7 preceding siblings ...)
2023-04-28 11:37 ` Andi Shyti
@ 2023-05-02 20:42 ` Andi Shyti
8 siblings, 0 replies; 10+ messages in thread
From: Andi Shyti @ 2023-05-02 20:42 UTC (permalink / raw)
To: Janusz Krzysztofik
Cc: Juergen Gross, x86, Yu Zhao, David Hildenbrand, intel-gfx,
Dave Hansen, linux-kernel, dri-devel, Andrzej Hajda, Ingo Molnar,
Borislav Petkov, H. Peter Anvin, Thomas Gleixner, Chris Wilson,
Andrew Morton, Nirmoy Das
Hi,
a kind reminder on this patch, would be fantastic if anyone from
the x86 maintainers cha give it a look.
The patch has been tested thoroughly and even if it's marked as
an RFC in my opinion it can be already considered for a proper
review.
Thanks,
Andi
On Mon, Apr 24, 2023 at 02:35:24PM +0200, Janusz Krzysztofik wrote:
> Visible glitches have been observed when running graphics applications on
> Linux under Xen hypervisor. Those observations have been confirmed with
> failures from kms_pwrite_crc Intel GPU test that verifies data coherency
> of DRM frame buffer objects using hardware CRC checksums calculated by
> display controllers, exposed to userspace via debugfs. Affected
> processing paths have then been identified with new test variants that
> mmap the objects using different methods and caching modes.
>
> When running as a Xen PV guest, Linux uses Xen provided PAT configuration
> which is different from its native one. In particular, Xen specific PTE
> encoding of write-combining caching, likely used by graphics applications,
> differs from the Linux default one found among statically defined minimal
> set of supported modes. Since Xen defines PTE encoding of the WC mode as
> _PAGE_PAT, it no longer belongs to the minimal set, depends on correct
> handling of _PAGE_PAT bit, and can be mismatched with write-back caching.
>
> When a user calls mmap() for a DRM buffer object, DRM device specific
> .mmap file operation, called from mmap_region(), takes care of setting PTE
> encoding bits in a vm_page_prot field of an associated virtual memory area
> structure. Unfortunately, _PAGE_PAT bit is not preserved when the vma's
> .vm_flags are then applied to .vm_page_prot via vm_set_page_prot(). Bits
> to be preserved are determined with _PAGE_CHG_MASK symbol that doesn't
> cover _PAGE_PAT. As a consequence, WB caching is requested instead of WC
> when running under Xen (also, WP is silently changed to WT, and UC
> downgraded to UC_MINUS). When running on bare metal, WC is not affected,
> but WP and WT extra modes are unintentionally replaced with WC and UC,
> respectively.
>
> WP and WT modes, encoded with _PAGE_PAT bit set, were introduced by commit
> 281d4078bec3 ("x86: Make page cache mode a real type"). Care was taken
> to extend _PAGE_CACHE_MASK symbol with that additional bit, but that
> symbol has never been used for identification of bits preserved when
> applying page protection flags. Support for all cache modes under Xen,
> including the problematic WC mode, was then introduced by commit
> 47591df50512 ("xen: Support Xen pv-domains using PAT").
>
> Extend bitmask used by pgprot_modify() for selecting bits to be preserved
> with _PAGE_PAT bit. However, since that bit can be reused as _PAGE_PSE,
> and the _PAGE_CHG_MASK symbol, primarly used by pte_modify(), is likely
> intentionally defined with that bit not set, keep that symbol unchanged.
>
> Closes: https://gitlab.freedesktop.org/drm/intel/-/issues/7648
> Fixes: 281d4078bec3 ("x86: Make page cache mode a real type")
> Signed-off-by: Janusz Krzysztofik <janusz.krzysztofik@linux.intel.com>
> Cc: stable@vger.kernel.org # v3.19+
> ---
> arch/x86/include/asm/pgtable.h | 6 ++++--
> 1 file changed, 4 insertions(+), 2 deletions(-)
>
> diff --git a/arch/x86/include/asm/pgtable.h b/arch/x86/include/asm/pgtable.h
> index 7425f32e52932..f797f8da2e5b6 100644
> --- a/arch/x86/include/asm/pgtable.h
> +++ b/arch/x86/include/asm/pgtable.h
> @@ -654,8 +654,10 @@ static inline pmd_t pmd_modify(pmd_t pmd, pgprot_t newprot)
> #define pgprot_modify pgprot_modify
> static inline pgprot_t pgprot_modify(pgprot_t oldprot, pgprot_t newprot)
> {
> - pgprotval_t preservebits = pgprot_val(oldprot) & _PAGE_CHG_MASK;
> - pgprotval_t addbits = pgprot_val(newprot) & ~_PAGE_CHG_MASK;
> + unsigned long mask = _PAGE_CHG_MASK | _PAGE_CACHE_MASK;
> +
> + pgprotval_t preservebits = pgprot_val(oldprot) & mask;
> + pgprotval_t addbits = pgprot_val(newprot) & ~mask;
> return __pgprot(preservebits | addbits);
> }
>
> --
> 2.40.0
^ permalink raw reply [flat|nested] 10+ messages in thread