aboutsummaryrefslogtreecommitdiffstats
path: root/xen/common/wait.c
Commit message (Collapse)AuthorAgeFilesLines
* x86: Fix __prepare_to_wait() asm test for stack sizeKeir Fraser2013-05-021-1/+1
| | | | Signed-off-by: Keir Fraser <keir@xen.org>
* xen: Introduce ASSERT_NOT_IN_ATOMIC() to give more info on in_atomic() crash.Keir Fraser2013-01-141-1/+1
| | | | Signed-off-by: Keir Fraser <keir@xen.org>
* x86: save/restore only partial register state where possibleJan Beulich2012-10-301-1/+5
| | | | | | | | | | | | | | | | | | | | | | | | ... and make restore conditional not only upon having saved the state, but also upon whether saved state was actually modified (and register values are known to have been preserved). Note that RBP is unconditionally considered a volatile register (i.e. irrespective of CONFIG_FRAME_POINTER), since the RBP handling would become overly complicated due to the need to save/restore it on the compat mode hypercall path [6th argument]. Note further that for compat mode code paths, saving/restoring R8...R15 is entirely unnecessary - we don't allow those guests to enter 64-bit mode, and hence they have no way of seeing these registers' contents (and there consequently also is no information leak, except if the context saving domctl would be considered such). Finally, note that this may not properly deal with gdbstub's needs, yet (but if so, I can't really suggest adjustments, as I don't know that code). Signed-off-by: Jan Beulich <jbeulich@suse.com> Acked-by: Keir Fraser <keir@xen.org>
* x86: slightly streamline __prepare_to_wait() inline assemblyJan Beulich2012-09-261-5/+3
| | | | | Signed-off-by: Jan Beulich <jbeulich@suse.com> Acked-by: Keir Fraser <keir@xen.org>
* xen: Remove x86_32 build target.Keir Fraser2012-09-121-10/+0
| | | | Signed-off-by: Keir Fraser <keir@xen.org>
* x86: fix wait code asm() constraintsJan Beulich2012-08-061-9/+10
| | | | | | | | | | | | | | | | | | | | This fixes theoretical issues with those constraints - operands that get clobbered before consuming all input operands must be marked so according the the gcc documentation. Beyond that, the change is merely code improvement, not a bug fix. In __prepare_to_wait(), properly mark early clobbered registers. By doing so, we at once eliminate the need to save/restore rCX and rDI. In check_wakeup_from_wait(), make the current constraints match by removing the code that actuall alters registers. By adjusting the resume address in __prepare_to_wait(), we can simply re-use the copying operation there (rather than doing a second pointless copy in the opposite direction after branching to the resume point), which at once eliminates the need for re-loading rCX and rDI inside the asm(). Signed-off-by: Jan Beulich <jbeulich@suse.com> Acked-by: Keir Fraser <keir@xen.org>
* Include some header files that are not automatically included on all archsStefano Stabellini2012-01-231-0/+1
| | | | | | | Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com> Signed-off-by: Ian Campbell <ian.campbell@citrix.com> Signed-off-by: Tim Deegan <Tim.Deegan@citrix.com> Committed-by: Keir Fraser <keir@xen.org>
* waitqueue: Hold a reference to a domain on a waitqueue.Keir Fraser2011-11-251-0/+8
| | | | | | Also allow waitqueues to be dynamically destroyed. Signed-off-by: Keir Fraser <keir@xen.org>
* waitqueue: Implement wake_up_{nr,one,all}.Keir Fraser2011-11-251-2/+12
| | | | Signed-off-by: Keir Fraser <keir@xen.org>
* x86/waitqueue: Because we have per-cpu stacks, we must wake up on tehKeir Fraser2011-11-241-0/+27
| | | | | | | same cpu that we slept on. Otherwise stack references are bogus on wakeup. Signed-off-by: Keir Fraser <keir@xen.org>
* waitqueue: Reorder prepare_to_wait() so that vcpu is definitely on theKeir Fraser2011-11-241-3/+4
| | | | | | | | | | queue on exit, even after a wakeup. Otherwise, when we go round the loop in wait_event(), we may not actually sleep after the first iteration, as we do not put ourselves back on the queue on wakeup. Signed-off-by: Keir Fraser <keir@xen.org>
* waitqueue: Detect saved-stack overflow and crash the guest.Keir Fraser2011-11-241-4/+15
| | | | Signed-off-by: Keir Fraser <keir@xen.org>
* x86,waitqueue: Allocate whole page for shadow stack.Keir Fraser2011-11-221-2/+14
| | | | Signed-off-by: Keir Fraser <keir@xen.org>
* waitqueue: Double size of x86 shadow stack.Keir Fraser2011-11-081-1/+1
| | | | Signed-off-by: Keir Fraser <keir@xen.org>
* use xzalloc in common codeJan Beulich2011-10-041-2/+1
| | | | | Signed-off-by: Jan Beulich <jbeulich@suse.com> Acked-by: Keir Fraser <keir@xen.org>
* waitqueue: Add license info to source file.Keir Fraser2010-11-181-0/+16
| | | | Signed-off-by: Keir Fraser <keir@xen.org>
* Wait queues, allowing conditional sleep in hypervisor context.Keir Fraser2010-11-171-0/+165
Signed-off-by: Keir Fraser <keir@xen.org>