ia64/xen-unstable

changeset 14829:c42ae7839750

[IA64] Fix ptc.ga emulation

ptc.ga infrequently clobbers the region register 0.

When vcpu1 purges TLBs of vcpu2 and ptc_ga_remote_func() is called
locally not via IPI (i.e. vcpu1 shares the same pcpu with vcpu2),
in ptc_ga_remote_func(),

save vrr[0] of vcpu2
... => switch to vcpu2 and set a new value of vrr[0]
restore vrr[0] of vcpu2 // the new value is lost

Windows will crash due to this issue.

Signed-off-by: Kouya Shimura <kouya@jp.fujitsu.com>
author Alex Williamson <alex.williamson@hp.com>
date Fri Apr 13 08:33:21 2007 -0600 (2007-04-13)
parents 41471cc650a2
children 039daabebad5
files xen/arch/ia64/vmx/vmmu.c
line diff
     1.1 --- a/xen/arch/ia64/vmx/vmmu.c	Thu Apr 12 10:30:12 2007 -0600
     1.2 +++ b/xen/arch/ia64/vmx/vmmu.c	Fri Apr 13 08:33:21 2007 -0600
     1.3 @@ -34,6 +34,7 @@
     1.4  #include <asm/vcpu.h>
     1.5  #include <xen/irq.h>
     1.6  #include <xen/errno.h>
     1.7 +#include <xen/sched-if.h>
     1.8  
     1.9  /*
    1.10   * Get the machine page frame number in 16KB unit
    1.11 @@ -613,8 +614,14 @@ again: /* Try again if VCPU has migrated
    1.12          } else if (v == vcpu) {
    1.13              vmx_vcpu_ptc_l(v, va, ps);
    1.14          } else {
    1.15 -            ptc_ga_remote_func(&args);
    1.16 -            if (proc != v->processor)
    1.17 +            vcpu_schedule_lock_irq(v);
    1.18 +            proc = v->processor;
    1.19 +            if (proc == vcpu->processor)
    1.20 +                ptc_ga_remote_func(&args);
    1.21 +            else
    1.22 +                proc = INVALID_PROCESSOR;
    1.23 +            vcpu_schedule_unlock_irq(v);
    1.24 +            if (proc == INVALID_PROCESSOR)
    1.25                  goto again;
    1.26          }
    1.27      }