ia64/xen-unstable

changeset 14071:21d0d23a2cca

[IA64] Fix ptc.ga emulation bug

If a vcpu migrates to the local cpu, smp_call_function_single() doesn't
work. Call ptc_ga_remote_func() directly instead.

Signed-off-by: Anthony Xu <anthony.xu@intel.com>
author awilliam@xenbuild2.aw
date Wed Feb 28 10:18:44 2007 -0700 (2007-02-28)
parents ac28d6c41e6f
children 2e2019e09e6c
files xen/arch/ia64/vmx/vmmu.c
line diff
     1.1 --- a/xen/arch/ia64/vmx/vmmu.c	Wed Feb 28 09:43:09 2007 -0700
     1.2 +++ b/xen/arch/ia64/vmx/vmmu.c	Wed Feb 28 10:18:44 2007 -0700
     1.3 @@ -590,6 +590,7 @@ IA64FAULT vmx_vcpu_ptc_ga(VCPU *vcpu, u6
     1.4      struct domain *d = vcpu->domain;
     1.5      struct vcpu *v;
     1.6      struct ptc_ga_args args;
     1.7 +    int proc;
     1.8  
     1.9      args.vadr = va;
    1.10      vcpu_get_rr(vcpu, va, &args.rid);
    1.11 @@ -599,20 +600,21 @@ IA64FAULT vmx_vcpu_ptc_ga(VCPU *vcpu, u6
    1.12              continue;
    1.13  
    1.14          args.vcpu = v;
    1.15 -        if (v->processor != vcpu->processor) {
    1.16 -            int proc;
    1.17 +again: /* Try again if VCPU has migrated.  */
    1.18 +        proc = v->processor;
    1.19 +        if (proc != vcpu->processor) {
    1.20              /* Flush VHPT on remote processors.  */
    1.21 -            do {
    1.22 -                proc = v->processor;
    1.23 -                smp_call_function_single(v->processor, 
    1.24 -                    &ptc_ga_remote_func, &args, 0, 1);
    1.25 -                /* Try again if VCPU has migrated.  */
    1.26 -            } while (proc != v->processor);
    1.27 +            smp_call_function_single(v->processor,
    1.28 +                                     &ptc_ga_remote_func, &args, 0, 1);
    1.29 +            if (proc != v->processor)
    1.30 +                goto again;
    1.31 +        } else if (v == vcpu) {
    1.32 +            vmx_vcpu_ptc_l(v, va, ps);
    1.33 +        } else {
    1.34 +            ptc_ga_remote_func(&args);
    1.35 +            if (proc != v->processor)
    1.36 +                goto again;
    1.37          }
    1.38 -        else if(v == vcpu)
    1.39 -            vmx_vcpu_ptc_l(v, va, ps);
    1.40 -        else
    1.41 -            ptc_ga_remote_func(&args);
    1.42      }
    1.43      return IA64_NO_FAULT;
    1.44  }