aboutsummaryrefslogtreecommitdiffstats
path: root/xen/arch/x86/platform_hypercall.c
diff options
context:
space:
mode:
authorKeir Fraser <keir.fraser@citrix.com>2010-04-15 11:33:39 +0100
committerKeir Fraser <keir.fraser@citrix.com>2010-04-15 11:33:39 +0100
commit86cd882200f54655c553c40341cd8ab3ecf378ad (patch)
tree2386ccfe170580b1af61061f05cb44d47ff5610f /xen/arch/x86/platform_hypercall.c
parentdcc9060e4a4a7bb6287ca346580529c8d803c780 (diff)
downloadxen-86cd882200f54655c553c40341cd8ab3ecf378ad.tar.gz
xen-86cd882200f54655c553c40341cd8ab3ecf378ad.tar.bz2
xen-86cd882200f54655c553c40341cd8ab3ecf378ad.zip
Update comments around spin_trylock() usage for sysctl and xenpf locks.
Since the execution of stop_machine_run() via cpu_down() is now always deferred to a hypercall continuation context, the above locks are not held at that time. Hence the trylock is not specifically to avoid deadlock with stop_machine_run(), but rather a more general paranoia about deadlocks in general. Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
Diffstat (limited to 'xen/arch/x86/platform_hypercall.c')
-rw-r--r--xen/arch/x86/platform_hypercall.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/xen/arch/x86/platform_hypercall.c b/xen/arch/x86/platform_hypercall.c
index dc2214930a..26883b4d1c 100644
--- a/xen/arch/x86/platform_hypercall.c
+++ b/xen/arch/x86/platform_hypercall.c
@@ -73,7 +73,11 @@ ret_t do_platform_op(XEN_GUEST_HANDLE(xen_platform_op_t) u_xenpf_op)
if ( op->interface_version != XENPF_INTERFACE_VERSION )
return -EACCES;
- /* spin_trylock() avoids deadlock with stop_machine_run(). */
+ /*
+ * Trylock here avoids deadlock with an existing platform critical section
+ * which might (for some current or future reason) want to synchronise
+ * with this vcpu.
+ */
while ( !spin_trylock(&xenpf_lock) )
if ( hypercall_preempt_check() )
return hypercall_create_continuation(