<feed xmlns='http://www.w3.org/2005/Atom'>
<title>linux-toradex.git/drivers/xen, branch v3.2.74</title>
<subtitle>Linux kernel for Apalis and Colibri modules</subtitle>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/'/>
<entry>
<title>xen/gntdevt: Fix race condition in gntdev_release()</title>
<updated>2015-10-13T02:46:01+00:00</updated>
<author>
<name>Marek Marczykowski-Górecki</name>
<email>marmarek@invisiblethingslab.com</email>
</author>
<published>2015-06-26T01:28:24+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=a97233643dcf324d983d92118099213fd08b7fba'/>
<id>a97233643dcf324d983d92118099213fd08b7fba</id>
<content type='text'>
commit 30b03d05e07467b8c6ec683ea96b5bffcbcd3931 upstream.

While gntdev_release() is called the MMU notifier is still registered
and can traverse priv-&gt;maps list even if no pages are mapped (which is
the case -- gntdev_release() is called after all). But
gntdev_release() will clear that list, so make sure that only one of
those things happens at the same time.

Signed-off-by: Marek Marczykowski-Górecki &lt;marmarek@invisiblethingslab.com&gt;
Signed-off-by: David Vrabel &lt;david.vrabel@citrix.com&gt;
[bwh: Backported to 3.2: adjust context]
Signed-off-by: Ben Hutchings &lt;ben@decadent.org.uk&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
commit 30b03d05e07467b8c6ec683ea96b5bffcbcd3931 upstream.

While gntdev_release() is called the MMU notifier is still registered
and can traverse priv-&gt;maps list even if no pages are mapped (which is
the case -- gntdev_release() is called after all). But
gntdev_release() will clear that list, so make sure that only one of
those things happens at the same time.

Signed-off-by: Marek Marczykowski-Górecki &lt;marmarek@invisiblethingslab.com&gt;
Signed-off-by: David Vrabel &lt;david.vrabel@citrix.com&gt;
[bwh: Backported to 3.2: adjust context]
Signed-off-by: Ben Hutchings &lt;ben@decadent.org.uk&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>xen/gntdev: convert priv-&gt;lock to a mutex</title>
<updated>2015-10-13T02:46:01+00:00</updated>
<author>
<name>David Vrabel</name>
<email>david.vrabel@citrix.com</email>
</author>
<published>2015-01-09T18:06:12+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=f96051e525023fcb88fe5df5858cbee0371c0b4a'/>
<id>f96051e525023fcb88fe5df5858cbee0371c0b4a</id>
<content type='text'>
commit 1401c00e59ea021c575f74612fe2dbba36d6a4ee upstream.

Unmapping may require sleeping and we unmap while holding priv-&gt;lock, so
convert it to a mutex.

Signed-off-by: David Vrabel &lt;david.vrabel@citrix.com&gt;
Reviewed-by: Stefano Stabellini &lt;stefano.stabellini@eu.citrix.com&gt;
[bwh: Backported to 3.2:
 - Adjust context
 - Drop changes to functions we don't have]
Signed-off-by: Ben Hutchings &lt;ben@decadent.org.uk&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
commit 1401c00e59ea021c575f74612fe2dbba36d6a4ee upstream.

Unmapping may require sleeping and we unmap while holding priv-&gt;lock, so
convert it to a mutex.

Signed-off-by: David Vrabel &lt;david.vrabel@citrix.com&gt;
Reviewed-by: Stefano Stabellini &lt;stefano.stabellini@eu.citrix.com&gt;
[bwh: Backported to 3.2:
 - Adjust context
 - Drop changes to functions we don't have]
Signed-off-by: Ben Hutchings &lt;ben@decadent.org.uk&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>xen/events: don't bind non-percpu VIRQs with percpu chip</title>
<updated>2015-08-06T23:32:12+00:00</updated>
<author>
<name>David Vrabel</name>
<email>david.vrabel@citrix.com</email>
</author>
<published>2015-05-19T17:40:49+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=14204ab641926fca1fed8afb61dcf8f4dc382166'/>
<id>14204ab641926fca1fed8afb61dcf8f4dc382166</id>
<content type='text'>
commit 77bb3dfdc0d554befad58fdefbc41be5bc3ed38a upstream.

A non-percpu VIRQ (e.g., VIRQ_CONSOLE) may be freed on a different
VCPU than it is bound to.  This can result in a race between
handle_percpu_irq() and removing the action in __free_irq() because
handle_percpu_irq() does not take desc-&gt;lock.  The interrupt handler
sees a NULL action and oopses.

Only use the percpu chip/handler for per-CPU VIRQs (like VIRQ_TIMER).

  # cat /proc/interrupts | grep virq
   40:      87246          0  xen-percpu-virq      timer0
   44:          0          0  xen-percpu-virq      debug0
   47:          0      20995  xen-percpu-virq      timer1
   51:          0          0  xen-percpu-virq      debug1
   69:          0          0   xen-dyn-virq      xen-pcpu
   74:          0          0   xen-dyn-virq      mce
   75:         29          0   xen-dyn-virq      hvc_console

Signed-off-by: David Vrabel &lt;david.vrabel@citrix.com&gt;
[bwh: Backported to 3.2: adjust filename, context, indentation]
Signed-off-by: Ben Hutchings &lt;ben@decadent.org.uk&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
commit 77bb3dfdc0d554befad58fdefbc41be5bc3ed38a upstream.

A non-percpu VIRQ (e.g., VIRQ_CONSOLE) may be freed on a different
VCPU than it is bound to.  This can result in a race between
handle_percpu_irq() and removing the action in __free_irq() because
handle_percpu_irq() does not take desc-&gt;lock.  The interrupt handler
sees a NULL action and oopses.

Only use the percpu chip/handler for per-CPU VIRQs (like VIRQ_TIMER).

  # cat /proc/interrupts | grep virq
   40:      87246          0  xen-percpu-virq      timer0
   44:          0          0  xen-percpu-virq      debug0
   47:          0      20995  xen-percpu-virq      timer1
   51:          0          0  xen-percpu-virq      debug1
   69:          0          0   xen-dyn-virq      xen-pcpu
   74:          0          0   xen-dyn-virq      mce
   75:         29          0   xen-dyn-virq      hvc_console

Signed-off-by: David Vrabel &lt;david.vrabel@citrix.com&gt;
[bwh: Backported to 3.2: adjust filename, context, indentation]
Signed-off-by: Ben Hutchings &lt;ben@decadent.org.uk&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>xen-pciback: Add name prefix to global 'permissive' variable</title>
<updated>2015-08-06T23:32:08+00:00</updated>
<author>
<name>Ben Hutchings</name>
<email>ben@decadent.org.uk</email>
</author>
<published>2015-04-12T23:26:35+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=56481c2920bb35e8a0b8abd55eeb5e52e8bce042'/>
<id>56481c2920bb35e8a0b8abd55eeb5e52e8bce042</id>
<content type='text'>
commit 8014bcc86ef112eab9ee1db312dba4e6b608cf89 upstream.

The variable for the 'permissive' module parameter used to be static
but was recently changed to be extern.  This puts it in the kernel
global namespace if the driver is built-in, so its name should begin
with a prefix identifying the driver.

Signed-off-by: Ben Hutchings &lt;ben@decadent.org.uk&gt;
Fixes: af6fc858a35b ("xen-pciback: limit guest control of command register")
Signed-off-by: David Vrabel &lt;david.vrabel@citrix.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
commit 8014bcc86ef112eab9ee1db312dba4e6b608cf89 upstream.

The variable for the 'permissive' module parameter used to be static
but was recently changed to be extern.  This puts it in the kernel
global namespace if the driver is built-in, so its name should begin
with a prefix identifying the driver.

Signed-off-by: Ben Hutchings &lt;ben@decadent.org.uk&gt;
Fixes: af6fc858a35b ("xen-pciback: limit guest control of command register")
Signed-off-by: David Vrabel &lt;david.vrabel@citrix.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>xen-pciback: limit guest control of command register</title>
<updated>2015-05-09T22:16:29+00:00</updated>
<author>
<name>Jan Beulich</name>
<email>JBeulich@suse.com</email>
</author>
<published>2015-03-11T13:51:17+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=6dc77dfffb8317d01fc9c2d25d0288c7b31b8623'/>
<id>6dc77dfffb8317d01fc9c2d25d0288c7b31b8623</id>
<content type='text'>
commit af6fc858a35b90e89ea7a7ee58e66628c55c776b upstream.

Otherwise the guest can abuse that control to cause e.g. PCIe
Unsupported Request responses by disabling memory and/or I/O decoding
and subsequently causing (CPU side) accesses to the respective address
ranges, which (depending on system configuration) may be fatal to the
host.

Note that to alter any of the bits collected together as
PCI_COMMAND_GUEST permissive mode is now required to be enabled
globally or on the specific device.

This is CVE-2015-2150 / XSA-120.

Signed-off-by: Jan Beulich &lt;jbeulich@suse.com&gt;
Reviewed-by: Konrad Rzeszutek Wilk &lt;konrad.wilk@oracle.com&gt;
Signed-off-by: David Vrabel &lt;david.vrabel@citrix.com&gt;
[bwh: Backported to 3.2: also change type of permissive from int to bool]
Signed-off-by: Ben Hutchings &lt;ben@decadent.org.uk&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
commit af6fc858a35b90e89ea7a7ee58e66628c55c776b upstream.

Otherwise the guest can abuse that control to cause e.g. PCIe
Unsupported Request responses by disabling memory and/or I/O decoding
and subsequently causing (CPU side) accesses to the respective address
ranges, which (depending on system configuration) may be fatal to the
host.

Note that to alter any of the bits collected together as
PCI_COMMAND_GUEST permissive mode is now required to be enabled
globally or on the specific device.

This is CVE-2015-2150 / XSA-120.

Signed-off-by: Jan Beulich &lt;jbeulich@suse.com&gt;
Reviewed-by: Konrad Rzeszutek Wilk &lt;konrad.wilk@oracle.com&gt;
Signed-off-by: David Vrabel &lt;david.vrabel@citrix.com&gt;
[bwh: Backported to 3.2: also change type of permissive from int to bool]
Signed-off-by: Ben Hutchings &lt;ben@decadent.org.uk&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>xen/manage: Fix USB interaction issues when resuming</title>
<updated>2015-05-09T22:16:15+00:00</updated>
<author>
<name>Ross Lagerwall</name>
<email>ross.lagerwall@citrix.com</email>
</author>
<published>2015-01-19T13:19:38+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=8bcd2a0924ca7c226d254fa45c75c6882b60af2d'/>
<id>8bcd2a0924ca7c226d254fa45c75c6882b60af2d</id>
<content type='text'>
commit 72978b2fe2f2cdf9f319c6c6dcdbe92b38de2be2 upstream.

Commit 61a734d305e1 ("xen/manage: Always freeze/thaw processes when
suspend/resuming") ensured that userspace processes were always frozen
before suspending to reduce interaction issues when resuming devices.
However, freeze_processes() does not freeze kernel threads.  Freeze
kernel threads as well to prevent deadlocks with the khubd thread when
resuming devices.

This is what native suspend and resume does.

Example deadlock:
[ 7279.648010]  [&lt;ffffffff81446bde&gt;] ? xen_poll_irq_timeout+0x3e/0x50
[ 7279.648010]  [&lt;ffffffff81448d60&gt;] xen_poll_irq+0x10/0x20
[ 7279.648010]  [&lt;ffffffff81011723&gt;] xen_lock_spinning+0xb3/0x120
[ 7279.648010]  [&lt;ffffffff810115d1&gt;] __raw_callee_save_xen_lock_spinning+0x11/0x20
[ 7279.648010]  [&lt;ffffffff815620b6&gt;] ? usb_control_msg+0xe6/0x120
[ 7279.648010]  [&lt;ffffffff81747e50&gt;] ? _raw_spin_lock_irq+0x50/0x60
[ 7279.648010]  [&lt;ffffffff8174522c&gt;] wait_for_completion+0xac/0x160
[ 7279.648010]  [&lt;ffffffff8109c520&gt;] ? try_to_wake_up+0x2c0/0x2c0
[ 7279.648010]  [&lt;ffffffff814b60f2&gt;] dpm_wait+0x32/0x40
[ 7279.648010]  [&lt;ffffffff814b6eb0&gt;] device_resume+0x90/0x210
[ 7279.648010]  [&lt;ffffffff814b7d71&gt;] dpm_resume+0x121/0x250
[ 7279.648010]  [&lt;ffffffff8144c570&gt;] ? xenbus_dev_request_and_reply+0xc0/0xc0
[ 7279.648010]  [&lt;ffffffff814b80d5&gt;] dpm_resume_end+0x15/0x30
[ 7279.648010]  [&lt;ffffffff81449fba&gt;] do_suspend+0x10a/0x200
[ 7279.648010]  [&lt;ffffffff8144a2f0&gt;] ? xen_pre_suspend+0x20/0x20
[ 7279.648010]  [&lt;ffffffff8144a1d0&gt;] shutdown_handler+0x120/0x150
[ 7279.648010]  [&lt;ffffffff8144c60f&gt;] xenwatch_thread+0x9f/0x160
[ 7279.648010]  [&lt;ffffffff810ac510&gt;] ? finish_wait+0x80/0x80
[ 7279.648010]  [&lt;ffffffff8108d189&gt;] kthread+0xc9/0xe0
[ 7279.648010]  [&lt;ffffffff8108d0c0&gt;] ? flush_kthread_worker+0x80/0x80
[ 7279.648010]  [&lt;ffffffff8175087c&gt;] ret_from_fork+0x7c/0xb0
[ 7279.648010]  [&lt;ffffffff8108d0c0&gt;] ? flush_kthread_worker+0x80/0x80

[ 7441.216287] INFO: task khubd:89 blocked for more than 120 seconds.
[ 7441.219457]       Tainted: G            X 3.13.11-ckt12.kz #1
[ 7441.222176] "echo 0 &gt; /proc/sys/kernel/hung_task_timeout_secs" disables this message.
[ 7441.225827] khubd           D ffff88003f433440     0    89      2 0x00000000
[ 7441.229258]  ffff88003ceb9b98 0000000000000046 ffff88003ce83000 0000000000013440
[ 7441.232959]  ffff88003ceb9fd8 0000000000013440 ffff88003cd13000 ffff88003ce83000
[ 7441.236658]  0000000000000286 ffff88003d3e0000 ffff88003ceb9bd0 00000001001aa01e
[ 7441.240415] Call Trace:
[ 7441.241614]  [&lt;ffffffff817442f9&gt;] schedule+0x29/0x70
[ 7441.243930]  [&lt;ffffffff81743406&gt;] schedule_timeout+0x166/0x2c0
[ 7441.246681]  [&lt;ffffffff81075b80&gt;] ? call_timer_fn+0x110/0x110
[ 7441.249339]  [&lt;ffffffff8174357e&gt;] schedule_timeout_uninterruptible+0x1e/0x20
[ 7441.252644]  [&lt;ffffffff81077710&gt;] msleep+0x20/0x30
[ 7441.254812]  [&lt;ffffffff81555f00&gt;] hub_port_reset+0xf0/0x580
[ 7441.257400]  [&lt;ffffffff81558465&gt;] hub_port_init+0x75/0xb40
[ 7441.259981]  [&lt;ffffffff814bb3c9&gt;] ? update_autosuspend+0x39/0x60
[ 7441.262817]  [&lt;ffffffff814bb4f0&gt;] ? pm_runtime_set_autosuspend_delay+0x50/0xa0
[ 7441.266212]  [&lt;ffffffff8155a64a&gt;] hub_thread+0x71a/0x1750
[ 7441.268728]  [&lt;ffffffff810ac510&gt;] ? finish_wait+0x80/0x80
[ 7441.271272]  [&lt;ffffffff81559f30&gt;] ? usb_port_resume+0x670/0x670
[ 7441.274067]  [&lt;ffffffff8108d189&gt;] kthread+0xc9/0xe0
[ 7441.276305]  [&lt;ffffffff8108d0c0&gt;] ? flush_kthread_worker+0x80/0x80
[ 7441.279131]  [&lt;ffffffff8175087c&gt;] ret_from_fork+0x7c/0xb0
[ 7441.281659]  [&lt;ffffffff8108d0c0&gt;] ? flush_kthread_worker+0x80/0x80

Signed-off-by: Ross Lagerwall &lt;ross.lagerwall@citrix.com&gt;
Signed-off-by: David Vrabel &lt;david.vrabel@citrix.com&gt;
[bwh: Backported to 3.2: adjust context]
Signed-off-by: Ben Hutchings &lt;ben@decadent.org.uk&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
commit 72978b2fe2f2cdf9f319c6c6dcdbe92b38de2be2 upstream.

Commit 61a734d305e1 ("xen/manage: Always freeze/thaw processes when
suspend/resuming") ensured that userspace processes were always frozen
before suspending to reduce interaction issues when resuming devices.
However, freeze_processes() does not freeze kernel threads.  Freeze
kernel threads as well to prevent deadlocks with the khubd thread when
resuming devices.

This is what native suspend and resume does.

Example deadlock:
[ 7279.648010]  [&lt;ffffffff81446bde&gt;] ? xen_poll_irq_timeout+0x3e/0x50
[ 7279.648010]  [&lt;ffffffff81448d60&gt;] xen_poll_irq+0x10/0x20
[ 7279.648010]  [&lt;ffffffff81011723&gt;] xen_lock_spinning+0xb3/0x120
[ 7279.648010]  [&lt;ffffffff810115d1&gt;] __raw_callee_save_xen_lock_spinning+0x11/0x20
[ 7279.648010]  [&lt;ffffffff815620b6&gt;] ? usb_control_msg+0xe6/0x120
[ 7279.648010]  [&lt;ffffffff81747e50&gt;] ? _raw_spin_lock_irq+0x50/0x60
[ 7279.648010]  [&lt;ffffffff8174522c&gt;] wait_for_completion+0xac/0x160
[ 7279.648010]  [&lt;ffffffff8109c520&gt;] ? try_to_wake_up+0x2c0/0x2c0
[ 7279.648010]  [&lt;ffffffff814b60f2&gt;] dpm_wait+0x32/0x40
[ 7279.648010]  [&lt;ffffffff814b6eb0&gt;] device_resume+0x90/0x210
[ 7279.648010]  [&lt;ffffffff814b7d71&gt;] dpm_resume+0x121/0x250
[ 7279.648010]  [&lt;ffffffff8144c570&gt;] ? xenbus_dev_request_and_reply+0xc0/0xc0
[ 7279.648010]  [&lt;ffffffff814b80d5&gt;] dpm_resume_end+0x15/0x30
[ 7279.648010]  [&lt;ffffffff81449fba&gt;] do_suspend+0x10a/0x200
[ 7279.648010]  [&lt;ffffffff8144a2f0&gt;] ? xen_pre_suspend+0x20/0x20
[ 7279.648010]  [&lt;ffffffff8144a1d0&gt;] shutdown_handler+0x120/0x150
[ 7279.648010]  [&lt;ffffffff8144c60f&gt;] xenwatch_thread+0x9f/0x160
[ 7279.648010]  [&lt;ffffffff810ac510&gt;] ? finish_wait+0x80/0x80
[ 7279.648010]  [&lt;ffffffff8108d189&gt;] kthread+0xc9/0xe0
[ 7279.648010]  [&lt;ffffffff8108d0c0&gt;] ? flush_kthread_worker+0x80/0x80
[ 7279.648010]  [&lt;ffffffff8175087c&gt;] ret_from_fork+0x7c/0xb0
[ 7279.648010]  [&lt;ffffffff8108d0c0&gt;] ? flush_kthread_worker+0x80/0x80

[ 7441.216287] INFO: task khubd:89 blocked for more than 120 seconds.
[ 7441.219457]       Tainted: G            X 3.13.11-ckt12.kz #1
[ 7441.222176] "echo 0 &gt; /proc/sys/kernel/hung_task_timeout_secs" disables this message.
[ 7441.225827] khubd           D ffff88003f433440     0    89      2 0x00000000
[ 7441.229258]  ffff88003ceb9b98 0000000000000046 ffff88003ce83000 0000000000013440
[ 7441.232959]  ffff88003ceb9fd8 0000000000013440 ffff88003cd13000 ffff88003ce83000
[ 7441.236658]  0000000000000286 ffff88003d3e0000 ffff88003ceb9bd0 00000001001aa01e
[ 7441.240415] Call Trace:
[ 7441.241614]  [&lt;ffffffff817442f9&gt;] schedule+0x29/0x70
[ 7441.243930]  [&lt;ffffffff81743406&gt;] schedule_timeout+0x166/0x2c0
[ 7441.246681]  [&lt;ffffffff81075b80&gt;] ? call_timer_fn+0x110/0x110
[ 7441.249339]  [&lt;ffffffff8174357e&gt;] schedule_timeout_uninterruptible+0x1e/0x20
[ 7441.252644]  [&lt;ffffffff81077710&gt;] msleep+0x20/0x30
[ 7441.254812]  [&lt;ffffffff81555f00&gt;] hub_port_reset+0xf0/0x580
[ 7441.257400]  [&lt;ffffffff81558465&gt;] hub_port_init+0x75/0xb40
[ 7441.259981]  [&lt;ffffffff814bb3c9&gt;] ? update_autosuspend+0x39/0x60
[ 7441.262817]  [&lt;ffffffff814bb4f0&gt;] ? pm_runtime_set_autosuspend_delay+0x50/0xa0
[ 7441.266212]  [&lt;ffffffff8155a64a&gt;] hub_thread+0x71a/0x1750
[ 7441.268728]  [&lt;ffffffff810ac510&gt;] ? finish_wait+0x80/0x80
[ 7441.271272]  [&lt;ffffffff81559f30&gt;] ? usb_port_resume+0x670/0x670
[ 7441.274067]  [&lt;ffffffff8108d189&gt;] kthread+0xc9/0xe0
[ 7441.276305]  [&lt;ffffffff8108d0c0&gt;] ? flush_kthread_worker+0x80/0x80
[ 7441.279131]  [&lt;ffffffff8175087c&gt;] ret_from_fork+0x7c/0xb0
[ 7441.281659]  [&lt;ffffffff8108d0c0&gt;] ? flush_kthread_worker+0x80/0x80

Signed-off-by: Ross Lagerwall &lt;ross.lagerwall@citrix.com&gt;
Signed-off-by: David Vrabel &lt;david.vrabel@citrix.com&gt;
[bwh: Backported to 3.2: adjust context]
Signed-off-by: Ben Hutchings &lt;ben@decadent.org.uk&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>xen/manage: Always freeze/thaw processes when suspend/resuming</title>
<updated>2014-11-05T20:27:40+00:00</updated>
<author>
<name>Ross Lagerwall</name>
<email>ross.lagerwall@citrix.com</email>
</author>
<published>2014-08-18T09:41:36+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=11d3b506cc0db26d2f2078bd4df88803cd06c819'/>
<id>11d3b506cc0db26d2f2078bd4df88803cd06c819</id>
<content type='text'>
commit 61a734d305e16944b42730ef582a7171dc733321 upstream.

Always freeze processes when suspending and thaw processes when resuming
to prevent a race noticeable with HVM guests.

This prevents a deadlock where the khubd kthread (which is designed to
be freezable) acquires a usb device lock and then tries to allocate
memory which requires the disk which hasn't been resumed yet.
Meanwhile, the xenwatch thread deadlocks waiting for the usb device
lock.

Freezing processes fixes this because the khubd thread is only thawed
after the xenwatch thread finishes resuming all the devices.

Signed-off-by: Ross Lagerwall &lt;ross.lagerwall@citrix.com&gt;
Signed-off-by: David Vrabel &lt;david.vrabel@citrix.com&gt;
[bwh: Backported to 3.2: adjust context]
Signed-off-by: Ben Hutchings &lt;ben@decadent.org.uk&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
commit 61a734d305e16944b42730ef582a7171dc733321 upstream.

Always freeze processes when suspending and thaw processes when resuming
to prevent a race noticeable with HVM guests.

This prevents a deadlock where the khubd kthread (which is designed to
be freezable) acquires a usb device lock and then tries to allocate
memory which requires the disk which hasn't been resumed yet.
Meanwhile, the xenwatch thread deadlocks waiting for the usb device
lock.

Freezing processes fixes this because the khubd thread is only thawed
after the xenwatch thread finishes resuming all the devices.

Signed-off-by: Ross Lagerwall &lt;ross.lagerwall@citrix.com&gt;
Signed-off-by: David Vrabel &lt;david.vrabel@citrix.com&gt;
[bwh: Backported to 3.2: adjust context]
Signed-off-by: Ben Hutchings &lt;ben@decadent.org.uk&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>xen/manage: fix potential deadlock when resuming the console</title>
<updated>2014-08-06T17:07:34+00:00</updated>
<author>
<name>David Vrabel</name>
<email>david.vrabel@citrix.com</email>
</author>
<published>2014-07-02T16:25:23+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=8a9c266c7bbac51a32d70ca0bc9e70a54233b89e'/>
<id>8a9c266c7bbac51a32d70ca0bc9e70a54233b89e</id>
<content type='text'>
commit 1b6478231c6f5f844185acb32045cf195028cfce upstream.

Calling xen_console_resume() in xen_suspend() causes a warning because
it locks irq_mapping_update_lock (a mutex) and this may sleep.  If a
userspace process is using the evtchn device then this mutex may be
locked at the point of the stop_machine() call and
xen_console_resume() would then deadlock.

Resuming the console after stop_machine() returns avoids this
deadlock.

Signed-off-by: David Vrabel &lt;david.vrabel@citrix.com&gt;
Reviewed-by: Boris Ostrovsky &lt;boris.ostrovsky@oracle.com&gt;
[bwh: Backported to 3.2: adjust context]
Signed-off-by: Ben Hutchings &lt;ben@decadent.org.uk&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
commit 1b6478231c6f5f844185acb32045cf195028cfce upstream.

Calling xen_console_resume() in xen_suspend() causes a warning because
it locks irq_mapping_update_lock (a mutex) and this may sleep.  If a
userspace process is using the evtchn device then this mutex may be
locked at the point of the stop_machine() call and
xen_console_resume() would then deadlock.

Resuming the console after stop_machine() returns avoids this
deadlock.

Signed-off-by: David Vrabel &lt;david.vrabel@citrix.com&gt;
Reviewed-by: Boris Ostrovsky &lt;boris.ostrovsky@oracle.com&gt;
[bwh: Backported to 3.2: adjust context]
Signed-off-by: Ben Hutchings &lt;ben@decadent.org.uk&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>xen-gnt: prevent adding duplicate gnt callbacks</title>
<updated>2013-10-26T20:05:57+00:00</updated>
<author>
<name>Roger Pau Monne</name>
<email>roger.pau@citrix.com</email>
</author>
<published>2013-07-31T15:00:42+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=d6722e140e6f8054f6a136dc3e3a281d16756a46'/>
<id>d6722e140e6f8054f6a136dc3e3a281d16756a46</id>
<content type='text'>
commit 5f338d9001094a56cf87bd8a280b4e7ff953bb59 upstream.

With the current implementation, the callback in the tail of the list
can be added twice, because the check done in
gnttab_request_free_callback is bogus, callback-&gt;next can be NULL if
it is the last callback in the list. If we add the same callback twice
we end up with an infinite loop, were callback == callback-&gt;next.

Replace this check with a proper one that iterates over the list to
see if the callback has already been added.

Signed-off-by: Roger Pau Monné &lt;roger.pau@citrix.com&gt;
Cc: Konrad Rzeszutek Wilk &lt;konrad.wilk@oracle.com&gt;
Cc: David Vrabel &lt;david.vrabel@citrix.com&gt;
Signed-off-by: Konrad Rzeszutek Wilk &lt;konrad.wilk@oracle.com&gt;
Acked-by: Matt Wilson &lt;msw@amazon.com&gt;
Reviewed-by: David Vrabel &lt;david.vrabel@citrix.com&gt;
Signed-off-by: Ben Hutchings &lt;ben@decadent.org.uk&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
commit 5f338d9001094a56cf87bd8a280b4e7ff953bb59 upstream.

With the current implementation, the callback in the tail of the list
can be added twice, because the check done in
gnttab_request_free_callback is bogus, callback-&gt;next can be NULL if
it is the last callback in the list. If we add the same callback twice
we end up with an infinite loop, were callback == callback-&gt;next.

Replace this check with a proper one that iterates over the list to
see if the callback has already been added.

Signed-off-by: Roger Pau Monné &lt;roger.pau@citrix.com&gt;
Cc: Konrad Rzeszutek Wilk &lt;konrad.wilk@oracle.com&gt;
Cc: David Vrabel &lt;david.vrabel@citrix.com&gt;
Signed-off-by: Konrad Rzeszutek Wilk &lt;konrad.wilk@oracle.com&gt;
Acked-by: Matt Wilson &lt;msw@amazon.com&gt;
Reviewed-by: David Vrabel &lt;david.vrabel@citrix.com&gt;
Signed-off-by: Ben Hutchings &lt;ben@decadent.org.uk&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>xen/events: mask events when changing their VCPU binding</title>
<updated>2013-09-10T00:57:26+00:00</updated>
<author>
<name>David Vrabel</name>
<email>david.vrabel@citrix.com</email>
</author>
<published>2013-08-15T12:21:07+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=5e72fdb8d827560893642e85a251d339109a00f4'/>
<id>5e72fdb8d827560893642e85a251d339109a00f4</id>
<content type='text'>
commit 4704fe4f03a5ab27e3c36184af85d5000e0f8a48 upstream.

When a event is being bound to a VCPU there is a window between the
EVTCHNOP_bind_vpcu call and the adjustment of the local per-cpu masks
where an event may be lost.  The hypervisor upcalls the new VCPU but
the kernel thinks that event is still bound to the old VCPU and
ignores it.

There is even a problem when the event is being bound to the same VCPU
as there is a small window beween the clear_bit() and set_bit() calls
in bind_evtchn_to_cpu().  When scanning for pending events, the kernel
may read the bit when it is momentarily clear and ignore the event.

Avoid this by masking the event during the whole bind operation.

Signed-off-by: David Vrabel &lt;david.vrabel@citrix.com&gt;
Signed-off-by: Konrad Rzeszutek Wilk &lt;konrad.wilk@oracle.com&gt;
Reviewed-by: Jan Beulich &lt;jbeulich@suse.com&gt;
[bwh: Backported to 3.2: remove the BM() cast]
Signed-off-by: Ben Hutchings &lt;ben@decadent.org.uk&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
commit 4704fe4f03a5ab27e3c36184af85d5000e0f8a48 upstream.

When a event is being bound to a VCPU there is a window between the
EVTCHNOP_bind_vpcu call and the adjustment of the local per-cpu masks
where an event may be lost.  The hypervisor upcalls the new VCPU but
the kernel thinks that event is still bound to the old VCPU and
ignores it.

There is even a problem when the event is being bound to the same VCPU
as there is a small window beween the clear_bit() and set_bit() calls
in bind_evtchn_to_cpu().  When scanning for pending events, the kernel
may read the bit when it is momentarily clear and ignore the event.

Avoid this by masking the event during the whole bind operation.

Signed-off-by: David Vrabel &lt;david.vrabel@citrix.com&gt;
Signed-off-by: Konrad Rzeszutek Wilk &lt;konrad.wilk@oracle.com&gt;
Reviewed-by: Jan Beulich &lt;jbeulich@suse.com&gt;
[bwh: Backported to 3.2: remove the BM() cast]
Signed-off-by: Ben Hutchings &lt;ben@decadent.org.uk&gt;
</pre>
</div>
</content>
</entry>
</feed>
