aboutsummaryrefslogtreecommitdiffstats
path: root/xen/arch/x86/platform_hypercall.c
diff options
context:
space:
mode:
authorKeir Fraser <keir.fraser@citrix.com>2010-05-14 11:39:15 +0100
committerKeir Fraser <keir.fraser@citrix.com>2010-05-14 11:39:15 +0100
commit2a814aeaaf1e2fe258ab72fc60bb86b7ca4cb102 (patch)
tree3bb398c9e2e984e80df50f50b292d12248ddcea6 /xen/arch/x86/platform_hypercall.c
parent5afdabbf824c995b6d66b4e69cd85c8948a3edb8 (diff)
downloadxen-2a814aeaaf1e2fe258ab72fc60bb86b7ca4cb102.tar.gz
xen-2a814aeaaf1e2fe258ab72fc60bb86b7ca4cb102.tar.bz2
xen-2a814aeaaf1e2fe258ab72fc60bb86b7ca4cb102.zip
x86: Do no thold cpu_add_remove_lock across stop_machine_run().
Instead we protect against concurrent online/offline requests for a single CPU asynchronously, using a cpumask for bookkeeping. This means that cpu_add_remove_lock no longer needs to be acquired via spin_trylock. 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.c7
1 files changed, 1 insertions, 6 deletions
diff --git a/xen/arch/x86/platform_hypercall.c b/xen/arch/x86/platform_hypercall.c
index 81639e91f1..67a5fbb73c 100644
--- a/xen/arch/x86/platform_hypercall.c
+++ b/xen/arch/x86/platform_hypercall.c
@@ -409,12 +409,7 @@ ret_t do_platform_op(XEN_GUEST_HANDLE(xen_platform_op_t) u_xenpf_op)
g_info = &op->u.pcpu_info;
- /* spin_trylock() avoids deadlock with stop_machine_run(). */
- if ( !spin_trylock(&cpu_add_remove_lock) )
- {
- ret = -EBUSY;
- break;
- }
+ spin_lock(&cpu_add_remove_lock);
if ( (g_info->xen_cpuid >= NR_CPUS) ||
(g_info->xen_cpuid < 0) ||