Synchronise lazy execstate before calling tasklet handlers.
authorKeir Fraser <keir.fraser@citrix.com>
Mon, 19 Apr 2010 16:48:20 +0000 (17:48 +0100)
committerKeir Fraser <keir.fraser@citrix.com>
Mon, 19 Apr 2010 16:48:20 +0000 (17:48 +0100)
This ensures we are properly running on idle-vcpu state, which certain
things (e.g., use of vmx_vmcs_{enter,exit}) rely on. It also means we
don't need to do the same thing in the stopmachine_run handler.

Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
xen/common/stop_machine.c
xen/common/tasklet.c

index 99604cde328619159f2bb66677e967e3b0fbba00..9f5dd1e79917b52353308ff85c988677d3b01472 100644 (file)
@@ -98,7 +98,6 @@ int stop_machine_run(int (*fn)(void *), void *data, unsigned int cpu)
     for_each_cpu_mask ( i, allbutself )
         tasklet_schedule_on_cpu(&per_cpu(stopmachine_tasklet, i), i);
 
-    sync_local_execstate();
     stopmachine_set_state(STOPMACHINE_PREPARE);
 
     local_irq_disable();
@@ -121,7 +120,6 @@ static void stopmachine_action(unsigned long unused)
 {
     enum stopmachine_state state = STOPMACHINE_START;
 
-    sync_local_execstate();
     smp_mb();
 
     while ( state != STOPMACHINE_EXIT )
index 1ee2758663bec227356adcf574c9b108a48b6a7b..05665ebc5ddfa230254a5cc856158dcd85e244d4 100644 (file)
@@ -76,6 +76,7 @@ void do_tasklet(void)
     t->is_running = 1;
 
     spin_unlock_irq(&tasklet_lock);
+    sync_local_execstate();
     t->func(t->data);
     spin_lock_irq(&tasklet_lock);