ia64/xen-unstable

changeset 8518:83eeb056f7c2

Handle migration of x86 VCPUs between physical CPUs.
If required, context_switch() must pull state off of
old CPU.

Signed-off-by: Keir Fraser <keir@xensource.com>
author kaf24@firebug.cl.cam.ac.uk
date Sat Jan 07 17:52:43 2006 +0100 (2006-01-07)
parents 0aff653824db
children 4c2c02ca4a7a
files xen/arch/x86/domain.c
line diff
     1.1 --- a/xen/arch/x86/domain.c	Sat Jan 07 16:53:25 2006 +0100
     1.2 +++ b/xen/arch/x86/domain.c	Sat Jan 07 17:52:43 2006 +0100
     1.3 @@ -749,11 +749,21 @@ void context_switch(struct vcpu *prev, s
     1.4  {
     1.5      unsigned int cpu = smp_processor_id();
     1.6  
     1.7 +    ASSERT(local_irq_is_enabled());
     1.8 +
     1.9      set_current(next);
    1.10  
    1.11      if ( (percpu_ctxt[cpu].curr_vcpu != next) &&
    1.12           !is_idle_domain(next->domain) )
    1.13      {
    1.14 +        /* This may happen if next has been migrated by the scheduler. */
    1.15 +        if ( unlikely(!cpus_empty(next->vcpu_dirty_cpumask)) )
    1.16 +        {
    1.17 +            ASSERT(!cpu_isset(cpu, next->vcpu_dirty_cpumask));
    1.18 +            sync_vcpu_execstate(next);
    1.19 +            ASSERT(cpus_empty(next->vcpu_dirty_cpumask));
    1.20 +        }
    1.21 +
    1.22          local_irq_disable();
    1.23          __context_switch();
    1.24          local_irq_enable();