ia64/xen-unstable

changeset 8624:1b7d6c2ae2f7

Sync against scheduler tail on other CPUs when context
switching to a new VCPU. Otherwise we cannot pull the
VCPU's state off the other CPU.

Signed-off-by: Keir Fraser <keir@xensource.com>
author kaf24@firebug.cl.cam.ac.uk
date Tue Jan 17 13:25:30 2006 +0100 (2006-01-17)
parents 6ce7c026320e
children af7e4ce46653
files xen/arch/x86/domain.c
line diff
     1.1 --- a/xen/arch/x86/domain.c	Mon Jan 16 23:54:24 2006 +0000
     1.2 +++ b/xen/arch/x86/domain.c	Tue Jan 17 13:25:30 2006 +0100
     1.3 @@ -738,8 +738,12 @@ void context_switch(struct vcpu *prev, s
     1.4      ASSERT(cpus_weight(dirty_mask) <= 1);
     1.5      if ( unlikely(!cpu_isset(cpu, dirty_mask) && !cpus_empty(dirty_mask)) )
     1.6      {
     1.7 +        /* Make sure the next VCPU is not in a scheduling tail. */
     1.8 +        while ( test_bit(_VCPUF_running, &next->vcpu_flags) )
     1.9 +            cpu_relax();
    1.10          /* Other cpus call __sync_lazy_execstate from flush ipi handler. */
    1.11 -        flush_tlb_mask(dirty_mask);
    1.12 +        if ( !cpus_empty(next->vcpu_dirty_cpumask) )
    1.13 +            flush_tlb_mask(next->vcpu_dirty_cpumask);
    1.14      }
    1.15  
    1.16      local_irq_disable();