ia64/xen-unstable

changeset 8894:f933aae43044

Svm patch to fix asid logic on multicore.

Signed-off-by: Tom Woller <thomas.woller@amd.com>
author kaf24@firebug.cl.cam.ac.uk
date Sat Feb 18 01:01:52 2006 +0100 (2006-02-18)
parents 0851d92183a1
children e05c67854218
files xen/arch/x86/hvm/svm/svm.c
line diff
     1.1 --- a/xen/arch/x86/hvm/svm/svm.c	Sat Feb 18 01:01:31 2006 +0100
     1.2 +++ b/xen/arch/x86/hvm/svm/svm.c	Sat Feb 18 01:01:52 2006 +0100
     1.3 @@ -2666,18 +2666,22 @@ asmlinkage void svm_asid(void)
     1.4      struct vcpu *v = current;
     1.5      struct vmcb_struct *vmcb = v->arch.hvm_svm.vmcb;
     1.6      int core = smp_processor_id();
     1.7 +    int oldcore = v->arch.hvm_svm.core; 
     1.8      /* 
     1.9       * if need to assign new asid or if switching cores, 
    1.10       * then retire asid for old core, and assign new for new core.
    1.11       */
    1.12 -    if( svm_dbg_on)
    1.13 -        printk("old core %d new core %d\n",(int)v->arch.hvm_svm.core,(int)core);
    1.14 -
    1.15 +    if( v->arch.hvm_svm.core != core ) {
    1.16 +        if (svm_dbg_on)
    1.17 +            printk("old core %d new core %d\n",(int)v->arch.hvm_svm.core,(int)core);
    1.18 +        v->arch.hvm_svm.core = core;
    1.19 +    }
    1.20      if( test_bit(ARCH_SVM_VMCB_ASSIGN_ASID, &v->arch.hvm_svm.flags) ||
    1.21 -          (v->arch.hvm_svm.core != core)) {
    1.22 +          (oldcore != core)) {
    1.23          if(!asidpool_assign_next(vmcb, 1, 
    1.24 -	            v->arch.hvm_svm.core, core)) {
    1.25 -           BUG();        	
    1.26 +	            oldcore, core)) {
    1.27 +            /* If we get here, we have a major problem */
    1.28 +            domain_crash_synchronous();
    1.29          }
    1.30      }
    1.31      clear_bit(ARCH_SVM_VMCB_ASSIGN_ASID, &v->arch.hvm_svm.flags);