<feed xmlns='http://www.w3.org/2005/Atom'>
<title>kernel/linux.git/drivers/gpu/drm/amd/amdkfd/kfd_process.c, branch v4.9.331</title>
<subtitle>Linux kernel stable tree (mirror)</subtitle>
<id>https://git.radix-linux.su/kernel/linux.git/atom?h=v4.9.331</id>
<link rel='self' href='https://git.radix-linux.su/kernel/linux.git/atom?h=v4.9.331'/>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/'/>
<updated>2018-09-26T06:36:39+00:00</updated>
<entry>
<title>drm/amdkfd: Fix error codes in kfd_get_process</title>
<updated>2018-09-26T06:36:39+00:00</updated>
<author>
<name>Wei Lu</name>
<email>wei.lu2@amd.com</email>
</author>
<published>2018-07-12T02:32:47+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=4dfa5ee4defd6783f33fa69c02d7e346494ebe8e'/>
<id>urn:sha1:4dfa5ee4defd6783f33fa69c02d7e346494ebe8e</id>
<content type='text'>
[ Upstream commit e47cb828eb3fca3e8999a0b9aa053dda18552071 ]

Return ERR_PTR(-EINVAL) if kfd_get_process fails to find the process.
This fixes kernel oopses when a child process calls KFD ioctls with
a file descriptor inherited from the parent process.

Signed-off-by: Wei Lu &lt;wei.lu2@amd.com&gt;
Reviewed-by: Felix Kuehling &lt;Felix.Kuehling@amd.com&gt;
Signed-off-by: Felix Kuehling &lt;Felix.Kuehling@amd.com&gt;
Acked-by: Christian König &lt;christian.koenig@amd.com&gt;
Signed-off-by: Oded Gabbay &lt;oded.gabbay@gmail.com&gt;
Signed-off-by: Sasha Levin &lt;alexander.levin@microsoft.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>drm/amdkfd: NULL dereference involving create_process()</title>
<updated>2018-04-13T17:48:16+00:00</updated>
<author>
<name>Dan Carpenter</name>
<email>dan.carpenter@oracle.com</email>
</author>
<published>2017-06-14T10:58:53+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=00ceff917d1b5b945756579ba34482179f56ecf2'/>
<id>urn:sha1:00ceff917d1b5b945756579ba34482179f56ecf2</id>
<content type='text'>
[ Upstream commit b312b2b25b6ac9e2eb03f4ca651b33108752de3a ]

We accidentally return ERR_PTR(0) which is NULL.  The caller is not
expecting that and it leads to an Oops.

Fixes: dd59239a9862 ("amdkfd: init aperture once per process")
Signed-off-by: Dan Carpenter &lt;dan.carpenter@oracle.com&gt;
Reviewed-by: Felix Kuehling &lt;felix.kuehling@amd.com&gt;
Signed-off-by: Oded Gabbay &lt;oded.gabbay@gmail.com&gt;
Signed-off-by: Sasha Levin &lt;alexander.levin@microsoft.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>drm/amdkfd: Reuse function to find a process through pasid</title>
<updated>2016-09-19T17:58:35+00:00</updated>
<author>
<name>Edward O'Callaghan</name>
<email>funfunctor@folklore1984.net</email>
</author>
<published>2016-09-17T05:01:42+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=ad16a469ffa1f1bbf8f31e110b4d68cee39757d2'/>
<id>urn:sha1:ad16a469ffa1f1bbf8f31e110b4d68cee39757d2</id>
<content type='text'>
The kfd_lookup_process_by_pasid() is just for that purpose,
so use it instead of repeating the code.

v2: return on the condition (p == NULL) instead of BUG_ON(!p).

Signed-off-by: Edward O'Callaghan &lt;funfunctor@folklore1984.net&gt;
Reviewed-by: Oded Gabbay &lt;oded.gabbay@gmail.com&gt;
Signed-off-by: Oded Gabbay &lt;oded.gabbay@gmail.com&gt;
</content>
</entry>
<entry>
<title>drm/amdkfd: destroy mutex if process creation fails</title>
<updated>2016-07-03T05:05:45+00:00</updated>
<author>
<name>Oded Gabbay</name>
<email>oded.gabbay@gmail.com</email>
</author>
<published>2016-06-23T14:54:29+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=7fd5e03ca6b41a591bd9fda083362b8a07cfb5f7'/>
<id>urn:sha1:7fd5e03ca6b41a591bd9fda083362b8a07cfb5f7</id>
<content type='text'>
Signed-off-by: Oded Gabbay &lt;oded.gabbay@gmail.com&gt;
</content>
</entry>
<entry>
<title>drm/amdkfd: Remove create_workqueue()</title>
<updated>2016-07-03T05:05:45+00:00</updated>
<author>
<name>Bhaktipriya Shridhar</name>
<email>bhaktipriya96@gmail.com</email>
</author>
<published>2016-05-29T15:44:11+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=fd320bf69297c3e4dbbb03193ec0b9cb68f3488a'/>
<id>urn:sha1:fd320bf69297c3e4dbbb03193ec0b9cb68f3488a</id>
<content type='text'>
alloc_workqueue replaces deprecated create_workqueue().

create_workqueue has been replaced with alloc_workqueue with max_active
as 0 since there is no need for throttling the number of active work items.

WQ_MEM_RECLAIM has not been set to because kfd_process_wq will not be
used in memory reclaim path.

kfd_process_wq is used for delay destruction. A work item embedded in
kfd_process gets queued to kfd_process_wq and when it executes it
destroys and frees the containing kfd_process and thus itself.

This requires a dedicated workqueue because a work item once queued, may
get freed at any point of time and any external entity cannot
flush the work item. So, in order to wait for such a work item,
it needs to be put on a dedicated workqueue.

kfd_module_exit() calls kfd_process_destroy_wq which ensures that all
pending work items are finished before the module is removed.

flush_workqueue is unnecessary since destroy_workqueue() itself calls
drain_workqueue() which flushes repeatedly till the workqueue
becomes empty.

Hence flush_workqueue has been removed.

Signed-off-by: Bhaktipriya Shridhar &lt;bhaktipriya96@gmail.com&gt;
Acked-by: Tejun Heo &lt;tj@kernel.org&gt;
Signed-off-by: Oded Gabbay &lt;oded.gabbay@gmail.com&gt;
</content>
</entry>
<entry>
<title>drm/amdkfd: destroy dbgmgr in notifier release</title>
<updated>2016-06-03T05:50:40+00:00</updated>
<author>
<name>Oded Gabbay</name>
<email>oded.gabbay@gmail.com</email>
</author>
<published>2016-05-26T05:41:48+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=bc4755a4bd1845ef6e88ac8c62f12e05bb530256'/>
<id>urn:sha1:bc4755a4bd1845ef6e88ac8c62f12e05bb530256</id>
<content type='text'>
amdkfd need to destroy the debug manager in case amdkfd's notifier
function is called before the unbind function, because in that case,
the unbind function will exit without destroying debug manager.

Signed-off-by: Oded Gabbay &lt;oded.gabbay@gmail.com&gt;
CC: Stable &lt;stable@vger.kernel.org&gt;
</content>
</entry>
<entry>
<title>drm/amdkfd: unbind only existing processes</title>
<updated>2016-06-03T05:50:40+00:00</updated>
<author>
<name>Oded Gabbay</name>
<email>oded.gabbay@gmail.com</email>
</author>
<published>2016-05-26T05:41:08+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=121b78e679ee3ffab780115e260b2775d0cc1f73'/>
<id>urn:sha1:121b78e679ee3ffab780115e260b2775d0cc1f73</id>
<content type='text'>
When unbinding a process from a device (initiated by amd_iommu_v2), the
driver needs to make sure that process still exists in the process table.
There is a possibility that amdkfd's own notifier handler -
kfd_process_notifier_release() - was called before the unbind function
and it already removed the process from the process table.

v2:
Because there can be only one process with the specified pasid, and
because *p can't be NULL inside the hash_for_each_rcu macro, it is more
reasonable to just put the whole code inside the if statement that
compares the pasid value. That way, when we exit hash_for_each_rcu, we
simply exit the function as well.

Signed-off-by: Oded Gabbay &lt;oded.gabbay@gmail.com&gt;
CC: Stable &lt;stable@vger.kernel.org&gt;
</content>
</entry>
<entry>
<title>drivers/gpu/drm/amd/amdkfd: use in_compat_syscall to check open() caller type</title>
<updated>2016-03-22T22:36:02+00:00</updated>
<author>
<name>Andy Lutomirski</name>
<email>luto@kernel.org</email>
</author>
<published>2016-03-22T21:25:19+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=10f1685fd59d4ded226123550bdaef176b99f65f'/>
<id>urn:sha1:10f1685fd59d4ded226123550bdaef176b99f65f</id>
<content type='text'>
amdkfd wants to know syscall type, not task type.  Check directly.

Unfortunately, amdkfd is making nasty assumptions that a process'
bitness is a well-defined constant thing.  This isn't the case on x86.
I don't know how much this matters, but this patch has no effect on
generated code on x86, so amdkfd is equally broken with and without this
patch.

Signed-off-by: Andy Lutomirski &lt;luto@kernel.org&gt;
Cc: Oded Gabbay &lt;oded.gabbay@gmail.com&gt;
Cc: David Airlie &lt;airlied@linux.ie&gt;
Signed-off-by: Andrew Morton &lt;akpm@linux-foundation.org&gt;
Signed-off-by: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
</content>
</entry>
<entry>
<title>drm/amdkfd: Remove unnecessary cast in kfree</title>
<updated>2016-01-28T12:40:11+00:00</updated>
<author>
<name>Amitoj Kaur Chawla</name>
<email>amitoj1606@gmail.com</email>
</author>
<published>2016-01-25T17:33:57+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=642f0f2a1563b5ab6f5de896f602177ac1f06652'/>
<id>urn:sha1:642f0f2a1563b5ab6f5de896f602177ac1f06652</id>
<content type='text'>
Remove an unnecassary cast in the argument to kfree.

Found using Coccinelle. The semantic patch used to find this is as follows:

//&lt;smpl&gt;
@@
type T;
expression *f;
@@

- kfree((T *)(f));
+ kfree(f);
//&lt;/smpl&gt;

Signed-off-by: Amitoj Kaur Chawla &lt;amitoj1606@gmail.com&gt;
Signed-off-by: Oded Gabbay &lt;oded.gabbay@gmail.com&gt;
</content>
</entry>
<entry>
<title>drm/amdkfd: validate pdd where it acquired first</title>
<updated>2015-07-09T10:27:52+00:00</updated>
<author>
<name>Maninder Singh</name>
<email>maninder1.s@samsung.com</email>
</author>
<published>2015-07-09T09:11:53+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=a0f67441b06525a1e5fd713ba0d75af4e5d6b198'/>
<id>urn:sha1:a0f67441b06525a1e5fd713ba0d75af4e5d6b198</id>
<content type='text'>
Currently pdd is validate after dereferencing it, which is
not correct, Thus validate pdd before its first use.

Signed-off-by: Maninder Singh &lt;maninder1.s@samsung.com&gt;
Signed-off-by: Oded Gabbay &lt;oded.gabbay@gmail.com&gt;
</content>
</entry>
</feed>
