<feed xmlns='http://www.w3.org/2005/Atom'>
<title>blackbird-op-linux/drivers/hwtracing/intel_th, branch master</title>
<subtitle>Blackbird™ Linux sources for OpenPOWER</subtitle>
<id>https://git.raptorcs.com/git/blackbird-op-linux/atom?h=master</id>
<link rel='self' href='https://git.raptorcs.com/git/blackbird-op-linux/atom?h=master'/>
<link rel='alternate' type='text/html' href='https://git.raptorcs.com/git/blackbird-op-linux/'/>
<updated>2019-12-17T14:45:59+00:00</updated>
<entry>
<title>intel_th: msu: Fix window switching without windows</title>
<updated>2019-12-17T14:45:59+00:00</updated>
<author>
<name>Alexander Shishkin</name>
<email>alexander.shishkin@linux.intel.com</email>
</author>
<published>2019-12-17T11:55:27+00:00</published>
<link rel='alternate' type='text/html' href='https://git.raptorcs.com/git/blackbird-op-linux/commit/?id=05b686b573cfb35a227c30787083a6631ff0f0c9'/>
<id>urn:sha1:05b686b573cfb35a227c30787083a6631ff0f0c9</id>
<content type='text'>
Commit 6cac7866c2741 ("intel_th: msu: Add a sysfs attribute to trigger
window switch") adds a NULL pointer dereference in the case when there are
no windows allocated:

&gt; BUG: kernel NULL pointer dereference, address: 0000000000000000
&gt; #PF: supervisor read access in kernel mode
&gt; #PF: error_code(0x0000) - not-present page
&gt; PGD 0 P4D 0
&gt; Oops: 0000 1 SMP
&gt; CPU: 5 PID: 1110 Comm: bash Not tainted 5.5.0-rc1+ #1
&gt; RIP: 0010:msc_win_switch+0xa/0x80 [intel_th_msu]
&gt; Call Trace:
&gt; ? win_switch_store+0x9b/0xc0 [intel_th_msu]
&gt; dev_attr_store+0x17/0x30
&gt; sysfs_kf_write+0x3e/0x50
&gt; kernfs_fop_write+0xda/0x1b0
&gt; __vfs_write+0x1b/0x40
&gt; vfs_write+0xb9/0x1a0
&gt; ksys_write+0x67/0xe0
&gt; __x64_sys_write+0x1a/0x20
&gt; do_syscall_64+0x57/0x1d0
&gt; entry_SYSCALL_64_after_hwframe+0x44/0xa9

Fix that by disallowing window switching with multiwindow buffers without
windows.

Signed-off-by: Alexander Shishkin &lt;alexander.shishkin@linux.intel.com&gt;
Fixes: 6cac7866c274 ("intel_th: msu: Add a sysfs attribute to trigger window switch")
Reviewed-by: Andy Shevchenko &lt;andriy.shevchenko@linux.intel.com&gt;
Reported-by: Ammy Yi &lt;ammy.yi@intel.com&gt;
Tested-by: Ammy Yi &lt;ammy.yi@intel.com&gt;
Cc: stable@vger.kernel.org # v5.2+
Link: https://lore.kernel.org/r/20191217115527.74383-5-alexander.shishkin@linux.intel.com
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>intel_th: Fix freeing IRQs</title>
<updated>2019-12-17T14:45:58+00:00</updated>
<author>
<name>Alexander Shishkin</name>
<email>alexander.shishkin@linux.intel.com</email>
</author>
<published>2019-12-17T11:55:26+00:00</published>
<link rel='alternate' type='text/html' href='https://git.raptorcs.com/git/blackbird-op-linux/commit/?id=ab832e38e4f0f45b16c3633714d868b7ec6b33b4'/>
<id>urn:sha1:ab832e38e4f0f45b16c3633714d868b7ec6b33b4</id>
<content type='text'>
Commit aac8da65174a ("intel_th: msu: Start handling IRQs") implicitly
relies on the use of devm_request_irq() to subsequently free the irqs on
device removal, but in case of the pci_free_irq_vectors() API, the
handlers need to be freed before it is called. Therefore, at the moment
the driver's remove path trips a BUG_ON(irq_has_action()):

&gt; kernel BUG at drivers/pci/msi.c:375!
&gt; invalid opcode: 0000 1 SMP
&gt; CPU: 2 PID: 818 Comm: rmmod Not tainted 5.5.0-rc1+ #1
&gt; RIP: 0010:free_msi_irqs+0x67/0x1c0
&gt; pci_disable_msi+0x116/0x150
&gt; pci_free_irq_vectors+0x1b/0x20
&gt; intel_th_pci_remove+0x22/0x30 [intel_th_pci]
&gt; pci_device_remove+0x3e/0xb0
&gt; device_release_driver_internal+0xf0/0x1c0
&gt; driver_detach+0x4c/0x8f
&gt; bus_remove_driver+0x5c/0xd0
&gt; driver_unregister+0x31/0x50
&gt; pci_unregister_driver+0x40/0x90
&gt; intel_th_pci_driver_exit+0x10/0xad6 [intel_th_pci]
&gt; __x64_sys_delete_module+0x147/0x290
&gt; ? exit_to_usermode_loop+0xd7/0x120
&gt; do_syscall_64+0x57/0x1b0
&gt; entry_SYSCALL_64_after_hwframe+0x44/0xa9

Fix this by explicitly freeing irqs before freeing the vectors. We keep
using the devm_* variants because they are still useful in early error
paths.

Signed-off-by: Alexander Shishkin &lt;alexander.shishkin@linux.intel.com&gt;
Reviewed-by: Andy Shevchenko &lt;andriy.shevchenko@linux.intel.com&gt;
Fixes: aac8da65174a ("intel_th: msu: Start handling IRQs")
Reported-by: Ammy Yi &lt;ammy.yi@intel.com&gt;
Tested-by: Ammy Yi &lt;ammy.yi@intel.com&gt;
Cc: stable@vger.kernel.org # v5.2+
Link: https://lore.kernel.org/r/20191217115527.74383-4-alexander.shishkin@linux.intel.com
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>intel_th: pci: Add Elkhart Lake SOC support</title>
<updated>2019-12-17T14:45:57+00:00</updated>
<author>
<name>Alexander Shishkin</name>
<email>alexander.shishkin@linux.intel.com</email>
</author>
<published>2019-12-17T11:55:25+00:00</published>
<link rel='alternate' type='text/html' href='https://git.raptorcs.com/git/blackbird-op-linux/commit/?id=88385866bab8d5e18c7f45d1023052c783572e03'/>
<id>urn:sha1:88385866bab8d5e18c7f45d1023052c783572e03</id>
<content type='text'>
This adds support for Intel Trace Hub in Elkhart Lake.

Signed-off-by: Alexander Shishkin &lt;alexander.shishkin@linux.intel.com&gt;
Reviewed-by: Andy Shevchenko &lt;andriy.shevchenko@linux.intel.com&gt;
Cc: stable@vger.kernel.org
Link: https://lore.kernel.org/r/20191217115527.74383-3-alexander.shishkin@linux.intel.com
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>intel_th: pci: Add Comet Lake PCH-V support</title>
<updated>2019-12-17T14:45:57+00:00</updated>
<author>
<name>Alexander Shishkin</name>
<email>alexander.shishkin@linux.intel.com</email>
</author>
<published>2019-12-17T11:55:24+00:00</published>
<link rel='alternate' type='text/html' href='https://git.raptorcs.com/git/blackbird-op-linux/commit/?id=e4de2a5d51f97a6e720a1c0911f93e2d8c2f1c08'/>
<id>urn:sha1:e4de2a5d51f97a6e720a1c0911f93e2d8c2f1c08</id>
<content type='text'>
This adds Intel(R) Trace Hub PCI ID for Comet Lake PCH-V.

Signed-off-by: Alexander Shishkin &lt;alexander.shishkin@linux.intel.com&gt;
Reviewed-by: Andy Shevchenko &lt;andriy.shevchenko@linux.intel.com&gt;
Cc: &lt;stable@vger.kernel.org&gt;
Link: https://lore.kernel.org/r/20191217115527.74383-2-alexander.shishkin@linux.intel.com
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>intel_th: pci: Add Tiger Lake CPU support</title>
<updated>2019-11-20T13:37:30+00:00</updated>
<author>
<name>Alexander Shishkin</name>
<email>alexander.shishkin@linux.intel.com</email>
</author>
<published>2019-11-20T13:08:06+00:00</published>
<link rel='alternate' type='text/html' href='https://git.raptorcs.com/git/blackbird-op-linux/commit/?id=6e6c18bcb78c0dc0601ebe216bed12c844492d0c'/>
<id>urn:sha1:6e6c18bcb78c0dc0601ebe216bed12c844492d0c</id>
<content type='text'>
This adds support for the Trace Hub in Tiger Lake CPU.

Signed-off-by: Alexander Shishkin &lt;alexander.shishkin@linux.intel.com&gt;
Reviewed-by: Andy Shevchenko &lt;andriy.shevchenko@linux.intel.com&gt;
Cc: stable@vger.kernel.org
Link: https://lore.kernel.org/r/20191120130806.44028-4-alexander.shishkin@linux.intel.com
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>intel_th: pci: Add Ice Lake CPU support</title>
<updated>2019-11-20T13:37:30+00:00</updated>
<author>
<name>Alexander Shishkin</name>
<email>alexander.shishkin@linux.intel.com</email>
</author>
<published>2019-11-20T13:08:05+00:00</published>
<link rel='alternate' type='text/html' href='https://git.raptorcs.com/git/blackbird-op-linux/commit/?id=6a1743422a7c0fda26764a544136cac13e5ae486'/>
<id>urn:sha1:6a1743422a7c0fda26764a544136cac13e5ae486</id>
<content type='text'>
This adds support for the Trace Hub in Ice Lake CPU.

Signed-off-by: Alexander Shishkin &lt;alexander.shishkin@linux.intel.com&gt;
Reviewed-by: Andy Shevchenko &lt;andriy.shevchenko@linux.intel.com&gt;
Cc: stable@vger.kernel.org
Link: https://lore.kernel.org/r/20191120130806.44028-3-alexander.shishkin@linux.intel.com
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>intel_th: Fix a double put_device() in error path</title>
<updated>2019-11-20T13:37:29+00:00</updated>
<author>
<name>Alexander Shishkin</name>
<email>alexander.shishkin@linux.intel.com</email>
</author>
<published>2019-11-20T13:08:04+00:00</published>
<link rel='alternate' type='text/html' href='https://git.raptorcs.com/git/blackbird-op-linux/commit/?id=512592779a337feb5905d8fcf9498dbf33672d4a'/>
<id>urn:sha1:512592779a337feb5905d8fcf9498dbf33672d4a</id>
<content type='text'>
Commit a753bfcfdb1f ("intel_th: Make the switch allocate its subdevices")
factored out intel_th_subdevice_alloc() from intel_th_populate(), but got
the error path wrong, resulting in two instances of a double put_device()
on a freshly initialized, but not 'added' device.

Fix this by only doing one put_device() in the error path.

Signed-off-by: Alexander Shishkin &lt;alexander.shishkin@linux.intel.com&gt;
Fixes: a753bfcfdb1f ("intel_th: Make the switch allocate its subdevices")
Reported-by: Wen Yang &lt;wenyang@linux.alibaba.com&gt;
Reviewed-by: Andy Shevchenko &lt;andriy.shevchenko@linux.intel.com&gt;
Cc: stable@vger.kernel.org # v4.14+
Link: https://lore.kernel.org/r/20191120130806.44028-2-alexander.shishkin@linux.intel.com
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>intel_th: pci: Add Jasper Lake PCH support</title>
<updated>2019-11-04T14:01:25+00:00</updated>
<author>
<name>Alexander Shishkin</name>
<email>alexander.shishkin@linux.intel.com</email>
</author>
<published>2019-10-28T07:06:51+00:00</published>
<link rel='alternate' type='text/html' href='https://git.raptorcs.com/git/blackbird-op-linux/commit/?id=9d55499d8da49e9261e95a490f3fda41d955f505'/>
<id>urn:sha1:9d55499d8da49e9261e95a490f3fda41d955f505</id>
<content type='text'>
This adds support for Intel TH on Jasper Lake PCH.

Signed-off-by: Alexander Shishkin &lt;alexander.shishkin@linux.intel.com&gt;
Reviewed-by: Andy Shevchenko &lt;andriy.shevchenko@linux.intel.com&gt;
Cc: stable@vger.kernel.org
Link: https://lore.kernel.org/r/20191028070651.9770-8-alexander.shishkin@linux.intel.com
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>intel_th: pci: Add Comet Lake PCH support</title>
<updated>2019-11-04T14:01:25+00:00</updated>
<author>
<name>Alexander Shishkin</name>
<email>alexander.shishkin@linux.intel.com</email>
</author>
<published>2019-10-28T07:06:50+00:00</published>
<link rel='alternate' type='text/html' href='https://git.raptorcs.com/git/blackbird-op-linux/commit/?id=3adbb5718dd5264666ddbc2b9b43799d292e9cb6'/>
<id>urn:sha1:3adbb5718dd5264666ddbc2b9b43799d292e9cb6</id>
<content type='text'>
This adds support for Intel TH on Comet Lake PCH.

Signed-off-by: Alexander Shishkin &lt;alexander.shishkin@linux.intel.com&gt;
Reviewed-by: Andy Shevchenko &lt;andriy.shevchenko@linux.intel.com&gt;
Cc: stable@vger.kernel.org
Link: https://lore.kernel.org/r/20191028070651.9770-7-alexander.shishkin@linux.intel.com
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>intel_th: msu: Fix possible memory leak in mode_store()</title>
<updated>2019-11-04T14:01:24+00:00</updated>
<author>
<name>Wei Yongjun</name>
<email>weiyongjun1@huawei.com</email>
</author>
<published>2019-10-28T07:06:49+00:00</published>
<link rel='alternate' type='text/html' href='https://git.raptorcs.com/git/blackbird-op-linux/commit/?id=1fa1b6ca0fda97cbfccdc6b80b1a6b2920751665'/>
<id>urn:sha1:1fa1b6ca0fda97cbfccdc6b80b1a6b2920751665</id>
<content type='text'>
'mode' is malloced in mode_store() and should be freed before leaving
from the error handling cases, otherwise it will cause memory leak.

Fixes: 615c164da0eb ("intel_th: msu: Introduce buffer interface")
Signed-off-by: Wei Yongjun &lt;weiyongjun1@huawei.com&gt;
Signed-off-by: Alexander Shishkin &lt;alexander.shishkin@linux.intel.com&gt;
Reviewed-by: Andy Shevchenko &lt;andriy.shevchenko@linux.intel.com&gt;
Link: https://lore.kernel.org/lkml/20190801013825.182543-1-weiyongjun1@huawei.com/
Link: https://lore.kernel.org/r/20191028070651.9770-6-alexander.shishkin@linux.intel.com
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
</feed>
