ia64/xen-unstable

changeset 4453:7d50508a59d1

bitkeeper revision 1.1236.1.207 (424fece5IsVIZO7m8xtxHyuGSvbJCQ)

Fix context switching between VCPUs belonging to the same domain. Setting
and then clearing the physical CPU bit in the cpuset bitmap is incorrect.
Signed-off-by: Keir Fraser <keir@xensource.com>
author kaf24@viper.(none)
date Sun Apr 03 13:17:25 2005 +0000 (2005-04-03)
parents 26c1fc477929
children be9687d4b0e8 445b12a7221a 09e69c727ad2 9dfa12fa3add
files xen/arch/x86/domain.c
line diff
     1.1 --- a/xen/arch/x86/domain.c	Sun Apr 03 11:22:11 2005 +0000
     1.2 +++ b/xen/arch/x86/domain.c	Sun Apr 03 13:17:25 2005 +0000
     1.3 @@ -808,10 +808,14 @@ static void __context_switch(void)
     1.4          }
     1.5      }
     1.6  
     1.7 -    set_bit(cpu, &n->domain->cpuset);
     1.8 +    if ( p->domain != n->domain )
     1.9 +        set_bit(cpu, &n->domain->cpuset);
    1.10 +
    1.11      write_ptbase(n);
    1.12      __asm__ __volatile__ ( "lgdt %0" : "=m" (*n->arch.gdt) );
    1.13 -    clear_bit(cpu, &p->domain->cpuset);
    1.14 +
    1.15 +    if ( p->domain != n->domain )
    1.16 +        clear_bit(cpu, &p->domain->cpuset);
    1.17  
    1.18      percpu_ctxt[cpu].curr_ed = n;
    1.19  }