/* calls in xen/common code that are unused on ia64 */
-void sync_lazy_execstate_cpu(unsigned int cpu) {}
+void sync_vcpu_execstate(struct vcpu *v) {}
#ifdef CONFIG_VTI
int grant_table_create(struct domain *d) { return 0; }
return switch_required;
}
-void sync_lazy_execstate_cpu(unsigned int cpu)
+void sync_vcpu_execstate(struct vcpu *v)
{
+ unsigned int cpu = v->processor;
+
+ if ( !cpu_isset(cpu, v->domain->cpumask) )
+ return;
+
if ( cpu == smp_processor_id() )
{
(void)__sync_lazy_execstate();
&& spin_is_locked(&schedule_data[v->processor].schedule_lock) )
cpu_relax();
- /* Counteract lazy context switching. */
- if ( cpu_isset(v->processor, v->domain->cpumask) )
- sync_lazy_execstate_cpu(v->processor);
+ sync_vcpu_execstate(v);
}
void vcpu_wake(struct vcpu *v)
void vcpu_sleep_sync(struct vcpu *d);
/*
- * Force loading of currently-executing domain state on the specified CPU.
- * This is used to counteract lazy state switching where required.
+ * Force synchronisation of given VCPU's state. If it is currently descheduled,
+ * this call will ensure that all its state is committed to memory and that
+ * no CPU is using critical state (e.g., page tables) belonging to the VCPU.
*/
-extern void sync_lazy_execstate_cpu(unsigned int cpu);
+extern void sync_vcpu_execstate(struct vcpu *v);
/*
* Called by the scheduler to switch to another VCPU. On entry, although
* The callee must ensure that the local CPU is no longer running in @prev's
* context, and that the context is saved to memory, before returning.
* Alternatively, if implementing lazy context switching, it suffices to ensure
- * that invoking sync_lazy_execstate() will switch and commit @prev's state.
+ * that invoking sync_vcpu_execstate() will switch and commit @prev's state.
*/
extern void context_switch(
struct vcpu *prev,