<feed xmlns='http://www.w3.org/2005/Atom'>
<title>linux.git/drivers/xen, branch v4.0-rc2</title>
<subtitle>Linux kernel source tree</subtitle>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux.git/'/>
<entry>
<title>xen-scsiback: mark pvscsi frontend request consumed only after last read</title>
<updated>2015-02-23T16:30:25+00:00</updated>
<author>
<name>Juergen Gross</name>
<email>jgross@suse.com</email>
</author>
<published>2015-02-17T07:02:47+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux.git/commit/?id=facb5732b0bb59ebbc11b5d5abc249e677ddbeb6'/>
<id>facb5732b0bb59ebbc11b5d5abc249e677ddbeb6</id>
<content type='text'>
A request in the ring buffer mustn't be read after it has been marked
as consumed. Otherwise it might already have been reused by the
frontend without violating the ring protocol.

To avoid inconsistencies in the backend only work on a private copy
of the request. This will ensure a malicious guest not being able to
bypass consistency checks of the backend by modifying an active
request.

Signed-off-by: Juergen Gross &lt;jgross@suse.com&gt;
Cc: &lt;stable@vger.kernel.org&gt;
Signed-off-by: David Vrabel &lt;david.vrabel@citrix.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
A request in the ring buffer mustn't be read after it has been marked
as consumed. Otherwise it might already have been reused by the
frontend without violating the ring protocol.

To avoid inconsistencies in the backend only work on a private copy
of the request. This will ensure a malicious guest not being able to
bypass consistency checks of the backend by modifying an active
request.

Signed-off-by: Juergen Gross &lt;jgross@suse.com&gt;
Cc: &lt;stable@vger.kernel.org&gt;
Signed-off-by: David Vrabel &lt;david.vrabel@citrix.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>x86/xen: allow privcmd hypercalls to be preempted</title>
<updated>2015-02-23T16:30:24+00:00</updated>
<author>
<name>David Vrabel</name>
<email>david.vrabel@citrix.com</email>
</author>
<published>2015-02-19T15:23:17+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux.git/commit/?id=fdfd811ddde3678247248ca9a27faa999ca4cd51'/>
<id>fdfd811ddde3678247248ca9a27faa999ca4cd51</id>
<content type='text'>
Hypercalls submitted by user space tools via the privcmd driver can
take a long time (potentially many 10s of seconds) if the hypercall
has many sub-operations.

A fully preemptible kernel may deschedule such as task in any upcall
called from a hypercall continuation.

However, in a kernel with voluntary or no preemption, hypercall
continuations in Xen allow event handlers to be run but the task
issuing the hypercall will not be descheduled until the hypercall is
complete and the ioctl returns to user space.  These long running
tasks may also trigger the kernel's soft lockup detection.

Add xen_preemptible_hcall_begin() and xen_preemptible_hcall_end() to
bracket hypercalls that may be preempted.  Use these in the privcmd
driver.

When returning from an upcall, call xen_maybe_preempt_hcall() which
adds a schedule point if if the current task was within a preemptible
hypercall.

Since _cond_resched() can move the task to a different CPU, clear and
set xen_in_preemptible_hcall around the call.

Signed-off-by: David Vrabel &lt;david.vrabel@citrix.com&gt;
Reviewed-by: Boris Ostrovsky &lt;boris.ostrovsky@oracle.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Hypercalls submitted by user space tools via the privcmd driver can
take a long time (potentially many 10s of seconds) if the hypercall
has many sub-operations.

A fully preemptible kernel may deschedule such as task in any upcall
called from a hypercall continuation.

However, in a kernel with voluntary or no preemption, hypercall
continuations in Xen allow event handlers to be run but the task
issuing the hypercall will not be descheduled until the hypercall is
complete and the ioctl returns to user space.  These long running
tasks may also trigger the kernel's soft lockup detection.

Add xen_preemptible_hcall_begin() and xen_preemptible_hcall_end() to
bracket hypercalls that may be preempted.  Use these in the privcmd
driver.

When returning from an upcall, call xen_maybe_preempt_hcall() which
adds a schedule point if if the current task was within a preemptible
hypercall.

Since _cond_resched() can move the task to a different CPU, clear and
set xen_in_preemptible_hcall around the call.

Signed-off-by: David Vrabel &lt;david.vrabel@citrix.com&gt;
Reviewed-by: Boris Ostrovsky &lt;boris.ostrovsky@oracle.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>Merge tag 'scsi-misc' of git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi</title>
<updated>2015-02-11T18:28:45+00:00</updated>
<author>
<name>Linus Torvalds</name>
<email>torvalds@linux-foundation.org</email>
</author>
<published>2015-02-11T18:28:45+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux.git/commit/?id=540a7c5061f10a07748c89b6741af90db1a07252'/>
<id>540a7c5061f10a07748c89b6741af90db1a07252</id>
<content type='text'>
Pull first round of SCSI updates from James Bottomley:
 "This is the usual grab bag of driver updates (hpsa, storvsc, mp2sas,
  megaraid_sas, ses) plus an assortment of minor updates.

  There's also an update to ufs which adds new phy drivers and finally a
  new logging infrastructure for SCSI"

* tag 'scsi-misc' of git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi: (114 commits)
  scsi_logging: return void for dev_printk() functions
  scsi: print single-character strings with seq_putc
  scsi: merge consecutive seq_puts calls
  scsi: replace seq_printf with seq_puts
  aha152x: replace seq_printf with seq_puts
  advansys: replace seq_printf with seq_puts
  scsi: remove SPRINTF macro
  sg: remove an unused variable
  hpsa: Use local workqueues instead of system workqueues
  hpsa: add in P840ar controller model name
  hpsa: add in gen9 controller model names
  hpsa: detect and report failures changing controller transport modes
  hpsa: shorten the wait for the CISS doorbell mode change ack
  hpsa: refactor duplicated scan completion code into a new routine
  hpsa: move SG descriptor set-up out of hpsa_scatter_gather()
  hpsa: do not use function pointers in fast path command submission
  hpsa: print CDBs instead of kernel virtual addresses for uncommon errors
  hpsa: do not use a void pointer for scsi_cmd field of struct CommandList
  hpsa: return failed from device reset/abort handlers
  hpsa: check for ctlr lockup after command allocation in main io path
  ...
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Pull first round of SCSI updates from James Bottomley:
 "This is the usual grab bag of driver updates (hpsa, storvsc, mp2sas,
  megaraid_sas, ses) plus an assortment of minor updates.

  There's also an update to ufs which adds new phy drivers and finally a
  new logging infrastructure for SCSI"

* tag 'scsi-misc' of git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi: (114 commits)
  scsi_logging: return void for dev_printk() functions
  scsi: print single-character strings with seq_putc
  scsi: merge consecutive seq_puts calls
  scsi: replace seq_printf with seq_puts
  aha152x: replace seq_printf with seq_puts
  advansys: replace seq_printf with seq_puts
  scsi: remove SPRINTF macro
  sg: remove an unused variable
  hpsa: Use local workqueues instead of system workqueues
  hpsa: add in P840ar controller model name
  hpsa: add in gen9 controller model names
  hpsa: detect and report failures changing controller transport modes
  hpsa: shorten the wait for the CISS doorbell mode change ack
  hpsa: refactor duplicated scan completion code into a new routine
  hpsa: move SG descriptor set-up out of hpsa_scatter_gather()
  hpsa: do not use function pointers in fast path command submission
  hpsa: print CDBs instead of kernel virtual addresses for uncommon errors
  hpsa: do not use a void pointer for scsi_cmd field of struct CommandList
  hpsa: return failed from device reset/abort handlers
  hpsa: check for ctlr lockup after command allocation in main io path
  ...
</pre>
</div>
</content>
</entry>
<entry>
<title>Merge tag 'pm+acpi-3.20-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm</title>
<updated>2015-02-10T23:09:41+00:00</updated>
<author>
<name>Linus Torvalds</name>
<email>torvalds@linux-foundation.org</email>
</author>
<published>2015-02-10T23:09:41+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux.git/commit/?id=872912352c5be930e9568e5f3b6d73107d9f278d'/>
<id>872912352c5be930e9568e5f3b6d73107d9f278d</id>
<content type='text'>
Pull ACPI and power management updates from Rafael Wysocki:
 "We have a few new features this time, including a new SFI-based
  cpufreq driver, a new devfreq driver for Tegra Activity Monitor, a new
  devfreq class for providing its governors with raw utilization data
  and a new ACPI driver for AMD SoCs.

  Still, the majority of changes here are reworks of existing code to
  make it more straightforward or to prepare it for implementing new
  features on top of it.  The primary example is the rework of ACPI
  resources handling from Jiang Liu, Thomas Gleixner and Lv Zheng with
  support for IOAPIC hotplug implemented on top of it, but there is
  quite a number of changes of this kind in the cpufreq core, ACPICA,
  ACPI EC driver, ACPI processor driver and the generic power domains
  core code too.

  The most active developer is Viresh Kumar with his cpufreq changes.

  Specifics:

   - Rework of the core ACPI resources parsing code to fix issues in it
     and make using resource offsets more convenient and consolidation
     of some resource-handing code in a couple of places that have grown
     analagous data structures and code to cover the the same gap in the
     core (Jiang Liu, Thomas Gleixner, Lv Zheng).

   - ACPI-based IOAPIC hotplug support on top of the resources handling
     rework (Jiang Liu, Yinghai Lu).

   - ACPICA update to upstream release 20150204 including an interrupt
     handling rework that allows drivers to install raw handlers for
     ACPI GPEs which then become entirely responsible for the given GPE
     and the ACPICA core code won't touch it (Lv Zheng, David E Box,
     Octavian Purdila).

   - ACPI EC driver rework to fix several concurrency issues and other
     problems related to events handling on top of the ACPICA's new
     support for raw GPE handlers (Lv Zheng).

   - New ACPI driver for AMD SoCs analogous to the LPSS (Low-Power
     Subsystem) driver for Intel chips (Ken Xue).

   - Two minor fixes of the ACPI LPSS driver (Heikki Krogerus, Jarkko
     Nikula).

   - Two new blacklist entries for machines (Samsung 730U3E/740U3E and
     510R) where the native backlight interface doesn't work correctly
     while the ACPI one does (Hans de Goede).

   - Rework of the ACPI processor driver's handling of idle states to
     make the code more straightforward and less bloated overall (Rafael
     J Wysocki).

   - Assorted minor fixes related to ACPI and SFI (Andreas Ruprecht,
     Andy Shevchenko, Hanjun Guo, Jan Beulich, Rafael J Wysocki, Yaowei
     Bai).

   - PCI core power management modification to avoid resuming (some)
     runtime-suspended devices during system suspend if they are in the
     right states already (Rafael J Wysocki).

   - New SFI-based cpufreq driver for Intel platforms using SFI
     (Srinidhi Kasagar).

   - cpufreq core fixes, cleanups and simplifications (Viresh Kumar,
     Doug Anderson, Wolfram Sang).

   - SkyLake CPU support and other updates for the intel_pstate driver
     (Kristen Carlson Accardi, Srinivas Pandruvada).

   - cpufreq-dt driver cleanup (Markus Elfring).

   - Init fix for the ARM big.LITTLE cpuidle driver (Sudeep Holla).

   - Generic power domains core code fixes and cleanups (Ulf Hansson).

   - Operating Performance Points (OPP) core code cleanups and kernel
     documentation update (Nishanth Menon).

   - New dabugfs interface to make the list of PM QoS constraints
     available to user space (Nishanth Menon).

   - New devfreq driver for Tegra Activity Monitor (Tomeu Vizoso).

   - New devfreq class (devfreq_event) to provide raw utilization data
     to devfreq governors (Chanwoo Choi).

   - Assorted minor fixes and cleanups related to power management
     (Andreas Ruprecht, Krzysztof Kozlowski, Rickard Strandqvist, Pavel
     Machek, Todd E Brandt, Wonhong Kwon).

   - turbostat updates (Len Brown) and cpupower Makefile improvement
     (Sriram Raghunathan)"

* tag 'pm+acpi-3.20-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm: (151 commits)
  tools/power turbostat: relax dependency on APERF_MSR
  tools/power turbostat: relax dependency on invariant TSC
  Merge branch 'pci/host-generic' of git://git.kernel.org/pub/scm/linux/kernel/git/helgaas/pci into acpi-resources
  tools/power turbostat: decode MSR_*_PERF_LIMIT_REASONS
  tools/power turbostat: relax dependency on root permission
  ACPI / video: Add disable_native_backlight quirk for Samsung 510R
  ACPI / PM: Remove unneeded nested #ifdef
  USB / PM: Remove unneeded #ifdef and associated dead code
  intel_pstate: provide option to only use intel_pstate with HWP
  ACPI / EC: Add GPE reference counting debugging messages
  ACPI / EC: Add query flushing support
  ACPI / EC: Refine command storm prevention support
  ACPI / EC: Add command flushing support.
  ACPI / EC: Introduce STARTED/STOPPED flags to replace BLOCKED flag
  ACPI: add AMD ACPI2Platform device support for x86 system
  ACPI / table: remove duplicate NULL check for the handler of acpi_table_parse()
  ACPI / EC: Update revision due to raw handler mode.
  ACPI / EC: Reduce ec_poll() by referencing the last register access timestamp.
  ACPI / EC: Fix several GPE handling issues by deploying ACPI_GPE_DISPATCH_RAW_HANDLER mode.
  ACPICA: Events: Enable APIs to allow interrupt/polling adaptive request based GPE handling model
  ...
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Pull ACPI and power management updates from Rafael Wysocki:
 "We have a few new features this time, including a new SFI-based
  cpufreq driver, a new devfreq driver for Tegra Activity Monitor, a new
  devfreq class for providing its governors with raw utilization data
  and a new ACPI driver for AMD SoCs.

  Still, the majority of changes here are reworks of existing code to
  make it more straightforward or to prepare it for implementing new
  features on top of it.  The primary example is the rework of ACPI
  resources handling from Jiang Liu, Thomas Gleixner and Lv Zheng with
  support for IOAPIC hotplug implemented on top of it, but there is
  quite a number of changes of this kind in the cpufreq core, ACPICA,
  ACPI EC driver, ACPI processor driver and the generic power domains
  core code too.

  The most active developer is Viresh Kumar with his cpufreq changes.

  Specifics:

   - Rework of the core ACPI resources parsing code to fix issues in it
     and make using resource offsets more convenient and consolidation
     of some resource-handing code in a couple of places that have grown
     analagous data structures and code to cover the the same gap in the
     core (Jiang Liu, Thomas Gleixner, Lv Zheng).

   - ACPI-based IOAPIC hotplug support on top of the resources handling
     rework (Jiang Liu, Yinghai Lu).

   - ACPICA update to upstream release 20150204 including an interrupt
     handling rework that allows drivers to install raw handlers for
     ACPI GPEs which then become entirely responsible for the given GPE
     and the ACPICA core code won't touch it (Lv Zheng, David E Box,
     Octavian Purdila).

   - ACPI EC driver rework to fix several concurrency issues and other
     problems related to events handling on top of the ACPICA's new
     support for raw GPE handlers (Lv Zheng).

   - New ACPI driver for AMD SoCs analogous to the LPSS (Low-Power
     Subsystem) driver for Intel chips (Ken Xue).

   - Two minor fixes of the ACPI LPSS driver (Heikki Krogerus, Jarkko
     Nikula).

   - Two new blacklist entries for machines (Samsung 730U3E/740U3E and
     510R) where the native backlight interface doesn't work correctly
     while the ACPI one does (Hans de Goede).

   - Rework of the ACPI processor driver's handling of idle states to
     make the code more straightforward and less bloated overall (Rafael
     J Wysocki).

   - Assorted minor fixes related to ACPI and SFI (Andreas Ruprecht,
     Andy Shevchenko, Hanjun Guo, Jan Beulich, Rafael J Wysocki, Yaowei
     Bai).

   - PCI core power management modification to avoid resuming (some)
     runtime-suspended devices during system suspend if they are in the
     right states already (Rafael J Wysocki).

   - New SFI-based cpufreq driver for Intel platforms using SFI
     (Srinidhi Kasagar).

   - cpufreq core fixes, cleanups and simplifications (Viresh Kumar,
     Doug Anderson, Wolfram Sang).

   - SkyLake CPU support and other updates for the intel_pstate driver
     (Kristen Carlson Accardi, Srinivas Pandruvada).

   - cpufreq-dt driver cleanup (Markus Elfring).

   - Init fix for the ARM big.LITTLE cpuidle driver (Sudeep Holla).

   - Generic power domains core code fixes and cleanups (Ulf Hansson).

   - Operating Performance Points (OPP) core code cleanups and kernel
     documentation update (Nishanth Menon).

   - New dabugfs interface to make the list of PM QoS constraints
     available to user space (Nishanth Menon).

   - New devfreq driver for Tegra Activity Monitor (Tomeu Vizoso).

   - New devfreq class (devfreq_event) to provide raw utilization data
     to devfreq governors (Chanwoo Choi).

   - Assorted minor fixes and cleanups related to power management
     (Andreas Ruprecht, Krzysztof Kozlowski, Rickard Strandqvist, Pavel
     Machek, Todd E Brandt, Wonhong Kwon).

   - turbostat updates (Len Brown) and cpupower Makefile improvement
     (Sriram Raghunathan)"

* tag 'pm+acpi-3.20-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm: (151 commits)
  tools/power turbostat: relax dependency on APERF_MSR
  tools/power turbostat: relax dependency on invariant TSC
  Merge branch 'pci/host-generic' of git://git.kernel.org/pub/scm/linux/kernel/git/helgaas/pci into acpi-resources
  tools/power turbostat: decode MSR_*_PERF_LIMIT_REASONS
  tools/power turbostat: relax dependency on root permission
  ACPI / video: Add disable_native_backlight quirk for Samsung 510R
  ACPI / PM: Remove unneeded nested #ifdef
  USB / PM: Remove unneeded #ifdef and associated dead code
  intel_pstate: provide option to only use intel_pstate with HWP
  ACPI / EC: Add GPE reference counting debugging messages
  ACPI / EC: Add query flushing support
  ACPI / EC: Refine command storm prevention support
  ACPI / EC: Add command flushing support.
  ACPI / EC: Introduce STARTED/STOPPED flags to replace BLOCKED flag
  ACPI: add AMD ACPI2Platform device support for x86 system
  ACPI / table: remove duplicate NULL check for the handler of acpi_table_parse()
  ACPI / EC: Update revision due to raw handler mode.
  ACPI / EC: Reduce ec_poll() by referencing the last register access timestamp.
  ACPI / EC: Fix several GPE handling issues by deploying ACPI_GPE_DISPATCH_RAW_HANDLER mode.
  ACPICA: Events: Enable APIs to allow interrupt/polling adaptive request based GPE handling model
  ...
</pre>
</div>
</content>
</entry>
<entry>
<title>xen/manage: Fix USB interaction issues when resuming</title>
<updated>2015-02-06T15:49:09+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.tavy.me/linux.git/commit/?id=72978b2fe2f2cdf9f319c6c6dcdbe92b38de2be2'/>
<id>72978b2fe2f2cdf9f319c6c6dcdbe92b38de2be2</id>
<content type='text'>
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;
Cc: stable@vger.kernel.org
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 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;
Cc: stable@vger.kernel.org
Signed-off-by: David Vrabel &lt;david.vrabel@citrix.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>xenbus: Add proper handling of XS_ERROR from Xenbus for transactions.</title>
<updated>2015-02-05T15:04:46+00:00</updated>
<author>
<name>Jennifer Herbert</name>
<email>Jennifer.Herbert@citrix.com</email>
</author>
<published>2015-02-05T14:45:40+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux.git/commit/?id=a2e75bc2ee207351e6806e77a5379c6c1dd4598a'/>
<id>a2e75bc2ee207351e6806e77a5379c6c1dd4598a</id>
<content type='text'>
If Xenstore sends back a XS_ERROR for TRANSACTION_END, the driver BUGs
because it cannot find the matching transaction in the list.  For
TRANSACTION_START, it leaks memory.

Check the message as returned from xenbus_dev_request_and_reply(), and
clean up for TRANSACTION_START or discard the error for
TRANSACTION_END.

Signed-off-by: Jennifer Herbert &lt;Jennifer.Herbert@citrix.com&gt;
Signed-off-by: David Vrabel &lt;david.vrabel@citrix.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
If Xenstore sends back a XS_ERROR for TRANSACTION_END, the driver BUGs
because it cannot find the matching transaction in the list.  For
TRANSACTION_START, it leaks memory.

Check the message as returned from xenbus_dev_request_and_reply(), and
clean up for TRANSACTION_START or discard the error for
TRANSACTION_END.

Signed-off-by: Jennifer Herbert &lt;Jennifer.Herbert@citrix.com&gt;
Signed-off-by: David Vrabel &lt;david.vrabel@citrix.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>xen/gntdev: provide find_special_page VMA operation</title>
<updated>2015-01-28T14:04:58+00:00</updated>
<author>
<name>David Vrabel</name>
<email>david.vrabel@citrix.com</email>
</author>
<published>2014-12-18T14:59:07+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux.git/commit/?id=dab069c61aa386f6a46c620f3a1075a4818f285b'/>
<id>dab069c61aa386f6a46c620f3a1075a4818f285b</id>
<content type='text'>
For a PV guest, use the find_special_page op to find the right page.
To handle VMAs being split, remember the start of the original VMA so
the correct index in the pages array can be calculated.

Signed-off-by: David Vrabel &lt;david.vrabel@citrix.com&gt;
Reviewed-by: Stefano Stabellini &lt;stefano.stabellini@eu.citrix.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
For a PV guest, use the find_special_page op to find the right page.
To handle VMAs being split, remember the start of the original VMA so
the correct index in the pages array can be calculated.

Signed-off-by: David Vrabel &lt;david.vrabel@citrix.com&gt;
Reviewed-by: Stefano Stabellini &lt;stefano.stabellini@eu.citrix.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>xen/gntdev: mark userspace PTEs as special on x86 PV guests</title>
<updated>2015-01-28T14:04:21+00:00</updated>
<author>
<name>David Vrabel</name>
<email>david.vrabel@citrix.com</email>
</author>
<published>2014-12-18T14:56:54+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux.git/commit/?id=923b2919e2c318ee1c360a2119a14889fd0fcce4'/>
<id>923b2919e2c318ee1c360a2119a14889fd0fcce4</id>
<content type='text'>
In an x86 PV guest, get_user_pages_fast() on a userspace address range
containing foreign mappings does not work correctly because the M2P
lookup of the MFN from a userspace PTE may return the wrong page.

Force get_user_pages_fast() to fail on such addresses by marking the PTEs
as special.

If Xen has XENFEAT_gnttab_map_avail_bits (available since at least
4.0), we can do so efficiently in the grant map hypercall.  Otherwise,
it needs to be done afterwards.  This is both inefficient and racy
(the mapping is visible to the task before we fixup the PTEs), but
will be fine for well-behaved applications that do not use the mapping
until after the mmap() system call returns.

Guests with XENFEAT_auto_translated_physmap (ARM and x86 HVM or PVH)
do not need this since get_user_pages() has always worked correctly
for them.

Signed-off-by: David Vrabel &lt;david.vrabel@citrix.com&gt;
Reviewed-by: Stefano Stabellini &lt;stefano.stabellini@eu.citrix.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
In an x86 PV guest, get_user_pages_fast() on a userspace address range
containing foreign mappings does not work correctly because the M2P
lookup of the MFN from a userspace PTE may return the wrong page.

Force get_user_pages_fast() to fail on such addresses by marking the PTEs
as special.

If Xen has XENFEAT_gnttab_map_avail_bits (available since at least
4.0), we can do so efficiently in the grant map hypercall.  Otherwise,
it needs to be done afterwards.  This is both inefficient and racy
(the mapping is visible to the task before we fixup the PTEs), but
will be fine for well-behaved applications that do not use the mapping
until after the mmap() system call returns.

Guests with XENFEAT_auto_translated_physmap (ARM and x86 HVM or PVH)
do not need this since get_user_pages() has always worked correctly
for them.

Signed-off-by: David Vrabel &lt;david.vrabel@citrix.com&gt;
Reviewed-by: Stefano Stabellini &lt;stefano.stabellini@eu.citrix.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>xen/gntdev: safely unmap grants in case they are still in use</title>
<updated>2015-01-28T14:03:15+00:00</updated>
<author>
<name>Jennifer Herbert</name>
<email>jennifer.herbert@citrix.com</email>
</author>
<published>2015-01-05T15:07:46+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux.git/commit/?id=745282256c754ac5ed3dbe2fbef6471dc1373417'/>
<id>745282256c754ac5ed3dbe2fbef6471dc1373417</id>
<content type='text'>
Use gnttab_unmap_refs_async() to wait until the mapped pages are no
longer in use before unmapping them.

This allows userspace programs to safely use Direct I/O and AIO to a
network filesystem which may retain refs to pages in queued skbs after
the filesystem I/O has completed.

Signed-off-by: Jennifer Herbert &lt;jennifer.herbert@citrix.com&gt;
Reviewed-by: Stefano Stabellini &lt;stefano.stabellini@eu.citrix.com&gt;
Signed-off-by: David Vrabel &lt;david.vrabel@citrix.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Use gnttab_unmap_refs_async() to wait until the mapped pages are no
longer in use before unmapping them.

This allows userspace programs to safely use Direct I/O and AIO to a
network filesystem which may retain refs to pages in queued skbs after
the filesystem I/O has completed.

Signed-off-by: Jennifer Herbert &lt;jennifer.herbert@citrix.com&gt;
Reviewed-by: Stefano Stabellini &lt;stefano.stabellini@eu.citrix.com&gt;
Signed-off-by: David Vrabel &lt;david.vrabel@citrix.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>xen/gntdev: convert priv-&gt;lock to a mutex</title>
<updated>2015-01-28T14:03:14+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.tavy.me/linux.git/commit/?id=1401c00e59ea021c575f74612fe2dbba36d6a4ee'/>
<id>1401c00e59ea021c575f74612fe2dbba36d6a4ee</id>
<content type='text'>
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;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
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;
</pre>
</div>
</content>
</entry>
</feed>
