<feed xmlns='http://www.w3.org/2005/Atom'>
<title>kernel.git/drivers/gpu/drm/i915/gem, branch linux-5.3.y</title>
<subtitle>Hosts the 0x221E linux distro kernel.
</subtitle>
<id>https://git.0xinfinity.dev/distro/kernel.git/atom?h=linux-5.3.y</id>
<link rel='self' href='https://git.0xinfinity.dev/distro/kernel.git/atom?h=linux-5.3.y'/>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/'/>
<updated>2019-11-29T09:07:51Z</updated>
<entry>
<title>drm/i915/userptr: Try to acquire the page lock around set_page_dirty()</title>
<updated>2019-11-29T09:07:51Z</updated>
<author>
<name>Chris Wilson</name>
</author>
<published>2019-11-11T13:32:03Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=07109f078f6650eb4c9911e429ad3ff03f8d73ae'/>
<id>urn:sha1:07109f078f6650eb4c9911e429ad3ff03f8d73ae</id>
<content type='text'>
commit 2d691aeca4aecbb8d0414a777a46981a8e142b05 upstream.

set_page_dirty says:

	For pages with a mapping this should be done under the page lock
	for the benefit of asynchronous memory errors who prefer a
	consistent dirty state. This rule can be broken in some special
	cases, but should be better not to.

Under those rules, it is only safe for us to use the plain set_page_dirty
calls for shmemfs/anonymous memory. Userptr may be used with real
mappings and so needs to use the locked version (set_page_dirty_lock).

However, following a try_to_unmap() we may want to remove the userptr and
so call put_pages(). However, try_to_unmap() acquires the page lock and
so we must avoid recursively locking the pages ourselves -- which means
that we cannot safely acquire the lock around set_page_dirty(). Since we
can't be sure of the lock, we have to risk skip dirtying the page, or
else risk calling set_page_dirty() without a lock and so risk fs
corruption.

Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=203317
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=112012
Fixes: 5cc9ed4b9a7a ("drm/i915: Introduce mapping of user pages into video memory (userptr) ioctl")
References: cb6d7c7dc7ff ("drm/i915/userptr: Acquire the page lock around set_page_dirty()")
References: 505a8ec7e11a ("Revert "drm/i915/userptr: Acquire the page lock around set_page_dirty()"")
References: 6dcc693bc57f ("ext4: warn when page is dirtied without buffers")
Signed-off-by: Chris Wilson &lt;chris@chris-wilson.co.uk&gt;
Cc: Lionel Landwerlin &lt;lionel.g.landwerlin@intel.com&gt;
Cc: Tvrtko Ursulin &lt;tvrtko.ursulin@intel.com&gt;
Cc: Joonas Lahtinen &lt;joonas.lahtinen@linux.intel.com&gt;
Cc: stable@vger.kernel.org
Reviewed-by: Tvrtko Ursulin &lt;tvrtko.ursulin@intel.com&gt;
Link: https://patchwork.freedesktop.org/patch/msgid/20191111133205.11590-1-chris@chris-wilson.co.uk
(cherry picked from commit 0d4bbe3d407f79438dc4f87943db21f7134cfc65)
Signed-off-by: Joonas Lahtinen &lt;joonas.lahtinen@linux.intel.com&gt;
(cherry picked from commit cee7fb437edcdb2f9f8affa959e274997f5dca4d)
Signed-off-by: Rodrigo Vivi &lt;rodrigo.vivi@intel.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

</content>
</entry>
<entry>
<title>drm/i915/cmdparser: Add support for backward jumps</title>
<updated>2019-11-12T18:28:25Z</updated>
<author>
<name>Jon Bloomfield</name>
</author>
<published>2018-09-20T16:58:36Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=1a3aabb5f347d18ad446f2126dba24e02e320ae8'/>
<id>urn:sha1:1a3aabb5f347d18ad446f2126dba24e02e320ae8</id>
<content type='text'>
commit f8c08d8faee5567803c8c533865296ca30286bbf upstream.

To keep things manageable, the pre-gen9 cmdparser does not
attempt to track any form of nested BB_START's. This did not
prevent usermode from using nested starts, or even chained
batches because the cmdparser is not strictly enforced pre gen9.

Instead, the existence of a nested BB_START would cause the batch
to be emitted in insecure mode, and any privileged capabilities
would not be available.

For Gen9, the cmdparser becomes mandatory (for BCS at least), and
so not providing any form of nested BB_START support becomes
overly restrictive. Any such batch will simply not run.

We make heavy use of backward jumps in igt, and it is much easier
to add support for this restricted subset of nested jumps, than to
rewrite the whole of our test suite to avoid them.

Add the required logic to support limited backward jumps, to
instructions that have already been validated by the parser.

Note that it's not sufficient to simply approve any BB_START
that jumps backwards in the buffer because this would allow an
attacker to embed a rogue instruction sequence within the
operand words of a harmless instruction (say LRI) and jump to
that.

We introduce a bit array to track every instr offset successfully
validated, and test the target of BB_START against this. If the
target offset hits, it is re-written to the same offset in the
shadow buffer and the BB_START cmd is allowed.

Note: This patch deliberately ignores checkpatch issues in the
cmdtables, in order to match the style of the surrounding code.
We'll correct the entire file in one go in a later patch.

v2: set dispatch secure late (Mika)
v3: rebase (Mika)
v4: Clear whitelist on each parse
Minor review updates (Chris)
v5: Correct backward jump batching
v6: fix compilation error due to struct eb shuffle (Mika)

Cc: Tony Luck &lt;tony.luck@intel.com&gt;
Cc: Dave Airlie &lt;airlied@redhat.com&gt;
Cc: Takashi Iwai &lt;tiwai@suse.de&gt;
Cc: Tyler Hicks &lt;tyhicks@canonical.com&gt;
Signed-off-by: Jon Bloomfield &lt;jon.bloomfield@intel.com&gt;
Signed-off-by: Mika Kuoppala &lt;mika.kuoppala@linux.intel.com&gt;
Reviewed-by: Chris Wilson &lt;chris.p.wilson@intel.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>drm/i915: Allow parsing of unsized batches</title>
<updated>2019-11-12T18:28:24Z</updated>
<author>
<name>Jon Bloomfield</name>
</author>
<published>2018-08-01T16:45:50Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=41e79b82c420f88c709f53dd2f3e61e0c01d511b'/>
<id>urn:sha1:41e79b82c420f88c709f53dd2f3e61e0c01d511b</id>
<content type='text'>
commit 435e8fc059dbe0eec823a75c22da2972390ba9e0 upstream.

In "drm/i915: Add support for mandatory cmdparsing" we introduced the
concept of mandatory parsing. This allows the cmdparser to be invoked
even when user passes batch_len=0 to the execbuf ioctl's.

However, the cmdparser needs to know the extents of the buffer being
scanned. Refactor the code to ensure the cmdparser uses the actual
object size, instead of the incoming length, if user passes 0.

Signed-off-by: Jon Bloomfield &lt;jon.bloomfield@intel.com&gt;
Cc: Tony Luck &lt;tony.luck@intel.com&gt;
Cc: Dave Airlie &lt;airlied@redhat.com&gt;
Cc: Takashi Iwai &lt;tiwai@suse.de&gt;
Cc: Tyler Hicks &lt;tyhicks@canonical.com&gt;
Reviewed-by: Chris Wilson &lt;chris.p.wilson@intel.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>drm/i915: Support ro ppgtt mapped cmdparser shadow buffers</title>
<updated>2019-11-12T18:28:24Z</updated>
<author>
<name>Jon Bloomfield</name>
</author>
<published>2018-05-22T20:59:06Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=78340a6f2ec06a4f851ad82dd2b1787280c389de'/>
<id>urn:sha1:78340a6f2ec06a4f851ad82dd2b1787280c389de</id>
<content type='text'>
commit 4f7af1948abcb18b4772fe1bcd84d7d27d96258c upstream.

For Gen7, the original cmdparser motive was to permit limited
use of register read/write instructions in unprivileged BB's.
This worked by copying the user supplied bb to a kmd owned
bb, and running it in secure mode, from the ggtt, only if
the scanner finds no unsafe commands or registers.

For Gen8+ we can't use this same technique because running bb's
from the ggtt also disables access to ppgtt space. But we also
do not actually require 'secure' execution since we are only
trying to reduce the available command/register set. Instead we
will copy the user buffer to a kmd owned read-only bb in ppgtt,
and run in the usual non-secure mode.

Note that ro pages are only supported by ppgtt (not ggtt), but
luckily that's exactly what we need.

Add the required paths to map the shadow buffer to ppgtt ro for Gen8+

v2: IS_GEN7/IS_GEN (Mika)
v3: rebase
v4: rebase
v5: rebase

Signed-off-by: Jon Bloomfield &lt;jon.bloomfield@intel.com&gt;
Cc: Tony Luck &lt;tony.luck@intel.com&gt;
Cc: Dave Airlie &lt;airlied@redhat.com&gt;
Cc: Takashi Iwai &lt;tiwai@suse.de&gt;
Cc: Tyler Hicks &lt;tyhicks@canonical.com&gt;
Signed-off-by: Mika Kuoppala &lt;mika.kuoppala@linux.intel.com&gt;
Reviewed-by: Chris Wilson &lt;chris.p.wilson@intel.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>drm/i915: Add support for mandatory cmdparsing</title>
<updated>2019-11-12T18:28:23Z</updated>
<author>
<name>Jon Bloomfield</name>
</author>
<published>2018-08-01T16:33:59Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=110416def1d659f815103c77ccca70936ec2636c'/>
<id>urn:sha1:110416def1d659f815103c77ccca70936ec2636c</id>
<content type='text'>
commit 311a50e76a33d1e029563c24b2ff6db0c02b5afe upstream.

The existing cmdparser for gen7 can be bypassed by specifying
batch_len=0 in the execbuf call. This is safe because bypassing
simply reduces the cmd-set available.

In a later patch we will introduce cmdparsing for gen9, as a
security measure, which must be strictly enforced since without
it we are vulnerable to DoS attacks.

Introduce the concept of 'required' cmd parsing that cannot be
bypassed by submitting zero-length bb's.

v2: rebase (Mika)
v2: rebase (Mika)
v3: fix conflict on engine flags (Mika)

Signed-off-by: Jon Bloomfield &lt;jon.bloomfield@intel.com&gt;
Cc: Tony Luck &lt;tony.luck@intel.com&gt;
Cc: Dave Airlie &lt;airlied@redhat.com&gt;
Cc: Takashi Iwai &lt;tiwai@suse.de&gt;
Cc: Tyler Hicks &lt;tyhicks@canonical.com&gt;
Signed-off-by: Mika Kuoppala &lt;mika.kuoppala@linux.intel.com&gt;
Reviewed-by: Chris Wilson &lt;chris.p.wilson@intel.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>drm/i915: Remove Master tables from cmdparser</title>
<updated>2019-11-12T18:28:23Z</updated>
<author>
<name>Jon Bloomfield</name>
</author>
<published>2018-06-08T17:05:26Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=7819546459c63b98fe14d43137ef8e4eebeb78f4'/>
<id>urn:sha1:7819546459c63b98fe14d43137ef8e4eebeb78f4</id>
<content type='text'>
commit 66d8aba1cd6db34af10de465c0d52af679288cb6 upstream.

The previous patch has killed support for secure batches
on gen6+, and hence the cmdparsers master tables are
now dead code. Remove them.

Signed-off-by: Jon Bloomfield &lt;jon.bloomfield@intel.com&gt;
Cc: Tony Luck &lt;tony.luck@intel.com&gt;
Cc: Dave Airlie &lt;airlied@redhat.com&gt;
Cc: Takashi Iwai &lt;tiwai@suse.de&gt;
Cc: Tyler Hicks &lt;tyhicks@canonical.com&gt;
Reviewed-by: Chris Wilson &lt;chris.p.wilson@intel.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>drm/i915: Disable Secure Batches for gen6+</title>
<updated>2019-11-12T18:28:23Z</updated>
<author>
<name>Jon Bloomfield</name>
</author>
<published>2018-06-08T15:53:46Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=b5ccff64277dab16ace19034b5a45666b28babb9'/>
<id>urn:sha1:b5ccff64277dab16ace19034b5a45666b28babb9</id>
<content type='text'>
commit 44157641d448cbc0c4b73c5231d2b911f0cb0427 upstream.

Retroactively stop reporting support for secure batches
through the api for gen6+ so that older binaries trigger
the fallback path instead.

Older binaries use secure batches pre gen6 to access resources
that are not available to normal usermode processes. However,
all known userspace explicitly checks for HAS_SECURE_BATCHES
before relying on the secure batch feature.

Since there are no known binaries relying on this for newer gens
we can kill secure batches from gen6, via I915_PARAM_HAS_SECURE_BATCHES.

v2: rebase (Mika)
v3: rebase (Mika)

Signed-off-by: Jon Bloomfield &lt;jon.bloomfield@intel.com&gt;
Cc: Tony Luck &lt;tony.luck@intel.com&gt;
Cc: Dave Airlie &lt;airlied@redhat.com&gt;
Cc: Takashi Iwai &lt;tiwai@suse.de&gt;
Cc: Tyler Hicks &lt;tyhicks@canonical.com&gt;
Signed-off-by: Mika Kuoppala &lt;mika.kuoppala@linux.intel.com&gt;
Reviewed-by: Chris Wilson &lt;chris.p.wilson@intel.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>drm/i915/userptr: Never allow userptr into the mappable GGTT</title>
<updated>2019-10-29T08:22:25Z</updated>
<author>
<name>Chris Wilson</name>
</author>
<published>2019-09-28T08:25:46Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=7332164441a786daba25818c527df6b27324e276'/>
<id>urn:sha1:7332164441a786daba25818c527df6b27324e276</id>
<content type='text'>
commit 4f2a572eda67aecb1e7e4fc26cc985fb8158f6e8 upstream.

Daniel Vetter uncovered a nasty cycle in using the mmu-notifiers to
invalidate userptr objects which also happen to be pulled into GGTT
mmaps. That is when we unbind the userptr object (on mmu invalidation),
we revoke all CPU mmaps, which may then recurse into mmu invalidation.

We looked for ways of breaking the cycle, but the revocation on
invalidation is required and cannot be avoided. The only solution we
could see was to not allow such GGTT bindings of userptr objects in the
first place. In practice, no one really wants to use a GGTT mmapping of
a CPU pointer...

Just before Daniel's explosive lockdep patches land in v5.4-rc1, we got
a genuine blip from CI:

&lt;4&gt;[  246.793958] ======================================================
&lt;4&gt;[  246.793972] WARNING: possible circular locking dependency detected
&lt;4&gt;[  246.793989] 5.3.0-gbd6c56f50d15-drmtip_372+ #1 Tainted: G     U
&lt;4&gt;[  246.794003] ------------------------------------------------------
&lt;4&gt;[  246.794017] kswapd0/145 is trying to acquire lock:
&lt;4&gt;[  246.794030] 000000003f565be6 (&amp;dev-&gt;struct_mutex/1){+.+.}, at: userptr_mn_invalidate_range_start+0x18f/0x220 [i915]
&lt;4&gt;[  246.794250]
                  but task is already holding lock:
&lt;4&gt;[  246.794263] 000000001799cef9 (&amp;anon_vma-&gt;rwsem){++++}, at: page_lock_anon_vma_read+0xe6/0x2a0
&lt;4&gt;[  246.794291]
                  which lock already depends on the new lock.

&lt;4&gt;[  246.794307]
                  the existing dependency chain (in reverse order) is:
&lt;4&gt;[  246.794322]
                  -&gt; #3 (&amp;anon_vma-&gt;rwsem){++++}:
&lt;4&gt;[  246.794344]        down_write+0x33/0x70
&lt;4&gt;[  246.794357]        __vma_adjust+0x3d9/0x7b0
&lt;4&gt;[  246.794370]        __split_vma+0x16a/0x180
&lt;4&gt;[  246.794385]        mprotect_fixup+0x2a5/0x320
&lt;4&gt;[  246.794399]        do_mprotect_pkey+0x208/0x2e0
&lt;4&gt;[  246.794413]        __x64_sys_mprotect+0x16/0x20
&lt;4&gt;[  246.794429]        do_syscall_64+0x55/0x1c0
&lt;4&gt;[  246.794443]        entry_SYSCALL_64_after_hwframe+0x49/0xbe
&lt;4&gt;[  246.794456]
                  -&gt; #2 (&amp;mapping-&gt;i_mmap_rwsem){++++}:
&lt;4&gt;[  246.794478]        down_write+0x33/0x70
&lt;4&gt;[  246.794493]        unmap_mapping_pages+0x48/0x130
&lt;4&gt;[  246.794519]        i915_vma_revoke_mmap+0x81/0x1b0 [i915]
&lt;4&gt;[  246.794519]        i915_vma_unbind+0x11d/0x4a0 [i915]
&lt;4&gt;[  246.794519]        i915_vma_destroy+0x31/0x300 [i915]
&lt;4&gt;[  246.794519]        __i915_gem_free_objects+0xb8/0x4b0 [i915]
&lt;4&gt;[  246.794519]        drm_file_free.part.0+0x1e6/0x290
&lt;4&gt;[  246.794519]        drm_release+0xa6/0xe0
&lt;4&gt;[  246.794519]        __fput+0xc2/0x250
&lt;4&gt;[  246.794519]        task_work_run+0x82/0xb0
&lt;4&gt;[  246.794519]        do_exit+0x35b/0xdb0
&lt;4&gt;[  246.794519]        do_group_exit+0x34/0xb0
&lt;4&gt;[  246.794519]        __x64_sys_exit_group+0xf/0x10
&lt;4&gt;[  246.794519]        do_syscall_64+0x55/0x1c0
&lt;4&gt;[  246.794519]        entry_SYSCALL_64_after_hwframe+0x49/0xbe
&lt;4&gt;[  246.794519]
                  -&gt; #1 (&amp;vm-&gt;mutex){+.+.}:
&lt;4&gt;[  246.794519]        i915_gem_shrinker_taints_mutex+0x6d/0xe0 [i915]
&lt;4&gt;[  246.794519]        i915_address_space_init+0x9f/0x160 [i915]
&lt;4&gt;[  246.794519]        i915_ggtt_init_hw+0x55/0x170 [i915]
&lt;4&gt;[  246.794519]        i915_driver_probe+0xc9f/0x1620 [i915]
&lt;4&gt;[  246.794519]        i915_pci_probe+0x43/0x1b0 [i915]
&lt;4&gt;[  246.794519]        pci_device_probe+0x9e/0x120
&lt;4&gt;[  246.794519]        really_probe+0xea/0x3d0
&lt;4&gt;[  246.794519]        driver_probe_device+0x10b/0x120
&lt;4&gt;[  246.794519]        device_driver_attach+0x4a/0x50
&lt;4&gt;[  246.794519]        __driver_attach+0x97/0x130
&lt;4&gt;[  246.794519]        bus_for_each_dev+0x74/0xc0
&lt;4&gt;[  246.794519]        bus_add_driver+0x13f/0x210
&lt;4&gt;[  246.794519]        driver_register+0x56/0xe0
&lt;4&gt;[  246.794519]        do_one_initcall+0x58/0x300
&lt;4&gt;[  246.794519]        do_init_module+0x56/0x1f6
&lt;4&gt;[  246.794519]        load_module+0x25bd/0x2a40
&lt;4&gt;[  246.794519]        __se_sys_finit_module+0xd3/0xf0
&lt;4&gt;[  246.794519]        do_syscall_64+0x55/0x1c0
&lt;4&gt;[  246.794519]        entry_SYSCALL_64_after_hwframe+0x49/0xbe
&lt;4&gt;[  246.794519]
                  -&gt; #0 (&amp;dev-&gt;struct_mutex/1){+.+.}:
&lt;4&gt;[  246.794519]        __lock_acquire+0x15d8/0x1e90
&lt;4&gt;[  246.794519]        lock_acquire+0xa6/0x1c0
&lt;4&gt;[  246.794519]        __mutex_lock+0x9d/0x9b0
&lt;4&gt;[  246.794519]        userptr_mn_invalidate_range_start+0x18f/0x220 [i915]
&lt;4&gt;[  246.794519]        __mmu_notifier_invalidate_range_start+0x85/0x110
&lt;4&gt;[  246.794519]        try_to_unmap_one+0x76b/0x860
&lt;4&gt;[  246.794519]        rmap_walk_anon+0x104/0x280
&lt;4&gt;[  246.794519]        try_to_unmap+0xc0/0xf0
&lt;4&gt;[  246.794519]        shrink_page_list+0x561/0xc10
&lt;4&gt;[  246.794519]        shrink_inactive_list+0x220/0x440
&lt;4&gt;[  246.794519]        shrink_node_memcg+0x36e/0x740
&lt;4&gt;[  246.794519]        shrink_node+0xcb/0x490
&lt;4&gt;[  246.794519]        balance_pgdat+0x241/0x580
&lt;4&gt;[  246.794519]        kswapd+0x16c/0x530
&lt;4&gt;[  246.794519]        kthread+0x119/0x130
&lt;4&gt;[  246.794519]        ret_from_fork+0x24/0x50
&lt;4&gt;[  246.794519]
                  other info that might help us debug this:

&lt;4&gt;[  246.794519] Chain exists of:
                    &amp;dev-&gt;struct_mutex/1 --&gt; &amp;mapping-&gt;i_mmap_rwsem --&gt; &amp;anon_vma-&gt;rwsem

&lt;4&gt;[  246.794519]  Possible unsafe locking scenario:

&lt;4&gt;[  246.794519]        CPU0                    CPU1
&lt;4&gt;[  246.794519]        ----                    ----
&lt;4&gt;[  246.794519]   lock(&amp;anon_vma-&gt;rwsem);
&lt;4&gt;[  246.794519]                                lock(&amp;mapping-&gt;i_mmap_rwsem);
&lt;4&gt;[  246.794519]                                lock(&amp;anon_vma-&gt;rwsem);
&lt;4&gt;[  246.794519]   lock(&amp;dev-&gt;struct_mutex/1);
&lt;4&gt;[  246.794519]
                   *** DEADLOCK ***

v2: Say no to mmap_ioctl

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=111744
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=111870
Signed-off-by: Chris Wilson &lt;chris@chris-wilson.co.uk&gt;
Cc: Tvrtko Ursulin &lt;tvrtko.ursulin@intel.com&gt;
Cc: Daniel Vetter &lt;daniel.vetter@ffwll.ch&gt;
Cc: stable@vger.kernel.org
Reviewed-by: Tvrtko Ursulin &lt;tvrtko.ursulin@intel.com&gt;
Link: https://patchwork.freedesktop.org/patch/msgid/20190928082546.3473-1-chris@chris-wilson.co.uk
(cherry picked from commit a4311745bba9763e3c965643d4531bd5765b0513)
Signed-off-by: Rodrigo Vivi &lt;rodrigo.vivi@intel.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

</content>
</entry>
<entry>
<title>drm/i915: Mark contents as dirty on a write fault</title>
<updated>2019-10-17T20:47:29Z</updated>
<author>
<name>Chris Wilson</name>
</author>
<published>2019-09-20T12:18:21Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=d2511690fd8d981796d325c0bf4e8a8fcceaf570'/>
<id>urn:sha1:d2511690fd8d981796d325c0bf4e8a8fcceaf570</id>
<content type='text'>
commit b925708f28c2b7a3a362d709bd7f77bc75c1daac upstream.

Since dropping the set-to-gtt-domain in commit a679f58d0510 ("drm/i915:
Flush pages on acquisition"), we no longer mark the contents as dirty on
a write fault. This has the issue of us then not marking the pages as
dirty on releasing the buffer, which means the contents are not written
out to the swap device (should we ever pick that buffer as a victim).
Notably, this is visible in the dumb buffer interface used for cursors.
Having updated the cursor contents via mmap, and swapped away, if the
shrinker should evict the old cursor, upon next reuse, the cursor would
be invisible.

E.g. echo 80 &gt; /proc/sys/kernel/sysrq ; echo f &gt; /proc/sysrq-trigger

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=111541
Fixes: a679f58d0510 ("drm/i915: Flush pages on acquisition")
Signed-off-by: Chris Wilson &lt;chris@chris-wilson.co.uk&gt;
Cc: Matthew Auld &lt;matthew.william.auld@gmail.com&gt;
Cc: Ville Syrjälä &lt;ville.syrjala@linux.intel.com&gt;
Cc: &lt;stable@vger.kernel.org&gt; # v5.2+
Reviewed-by: Matthew Auld &lt;matthew.william.auld@gmail.com&gt;
Link: https://patchwork.freedesktop.org/patch/msgid/20190920121821.7223-1-chris@chris-wilson.co.uk
(cherry picked from commit 5028851cdfdf78dc22eacbc44a0ab0b3f599ee4a)
Signed-off-by: Rodrigo Vivi &lt;rodrigo.vivi@intel.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

</content>
</entry>
<entry>
<title>drm/i915: Perform GGTT restore much earlier during resume</title>
<updated>2019-10-17T20:47:11Z</updated>
<author>
<name>Chris Wilson</name>
</author>
<published>2019-09-09T11:00:08Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=46ba0cfb4f6bfda76984d5c459bedfce0cde66b4'/>
<id>urn:sha1:46ba0cfb4f6bfda76984d5c459bedfce0cde66b4</id>
<content type='text'>
commit 6c76a93c453643e11a1063906c7c39168dd8d163 upstream.

As soon as we re-enable the various functions within the HW, they may go
off and read data via a GGTT offset. Hence, if we have not yet restored
the GGTT PTE before then, they may read and even *write* random locations
in memory.

Detected by DMAR faults during resume.

Signed-off-by: Chris Wilson &lt;chris@chris-wilson.co.uk&gt;
Cc: Mika Kuoppala &lt;mika.kuoppala@linux.intel.com&gt;
Cc: Martin Peres &lt;martin.peres@linux.intel.com&gt;
Cc: Joonas Lahtinen &lt;joonas.lahtinen@linux.intel.com&gt;
Cc: stable@vger.kernel.org
Reviewed-by: Mika Kuoppala &lt;mika.kuoppala@linux.intel.com&gt;
Link: https://patchwork.freedesktop.org/patch/msgid/20190909110011.8958-4-chris@chris-wilson.co.uk
(cherry picked from commit cec5ca08e36fd18d2939b98055346b3b06f56c6c)
Signed-off-by: Rodrigo Vivi &lt;rodrigo.vivi@intel.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

</content>
</entry>
</feed>
