direct-io.hg

changeset 10376:8771f539663a

[IA64] Handle VTi's fp fault & trap in hypervisor instead of injecting to guest

Signed-off-by : Zhang xiantao <xiantao.zhang@intel.com>
Signed-off-by : Kevin Tian <kevin.tian@intel.com>
author awilliam@xenbuild.aw
date Sat Jun 03 15:34:07 2006 -0600 (2006-06-03)
parents 976517433993
children 3f8523ce8895
files xen/arch/ia64/vmx/vmx_process.c xen/arch/ia64/xen/process.c
line diff
     1.1 --- a/xen/arch/ia64/vmx/vmx_process.c	Sat Jun 03 15:21:07 2006 -0600
     1.2 +++ b/xen/arch/ia64/vmx/vmx_process.c	Sat Jun 03 15:34:07 2006 -0600
     1.3 @@ -62,6 +62,7 @@ extern unsigned long translate_domain_mp
     1.4  extern void alt_itlb (VCPU *vcpu, u64 vadr);
     1.5  extern void itlb_fault (VCPU *vcpu, u64 vadr);
     1.6  extern void ivhpt_fault (VCPU *vcpu, u64 vadr);
     1.7 +extern unsigned long handle_fpu_swa (int fp_fault, struct pt_regs *regs, unsigned long isr);
     1.8  
     1.9  #define DOMN_PAL_REQUEST    0x110000
    1.10  #define DOMN_SAL_REQUEST    0x110001
    1.11 @@ -84,9 +85,20 @@ void vmx_reflect_interruption(UINT64 ifa
    1.12      VCPU *vcpu = current;
    1.13      UINT64 vpsr = vmx_vcpu_get_psr(vcpu);
    1.14      vector=vec2off[vector];
    1.15 -    if(!(vpsr&IA64_PSR_IC)&&(vector!=0x1400)){
    1.16 +    if(!(vpsr&IA64_PSR_IC)&&(vector!=IA64_DATA_NESTED_TLB_VECTOR)){
    1.17          panic_domain(regs, "Guest nested fault vector=%lx!\n", vector);
    1.18      }
    1.19 +    else{ // handle fpswa emulation
    1.20 +        // fp fault
    1.21 +        if(vector == IA64_FP_FAULT_VECTOR && !handle_fpu_swa(1, regs, isr)){
    1.22 +            vmx_vcpu_increment_iip(vcpu);
    1.23 +            return;
    1.24 +        }
    1.25 +        //fp trap
    1.26 +        else if(vector == IA64_FP_TRAP_VECTOR && !handle_fpu_swa(0, regs, isr)){
    1.27 +            return; 
    1.28 +        }
    1.29 +    }
    1.30      VCPU(vcpu,isr)=isr;
    1.31      VCPU(vcpu,iipa) = regs->cr_iip;
    1.32      if (vector == IA64_BREAK_VECTOR || vector == IA64_SPECULATION_VECTOR)
     2.1 --- a/xen/arch/ia64/xen/process.c	Sat Jun 03 15:21:07 2006 -0600
     2.2 +++ b/xen/arch/ia64/xen/process.c	Sat Jun 03 15:34:07 2006 -0600
     2.3 @@ -447,7 +447,7 @@ fp_emulate (int fp_fault, void *bundle, 
     2.4  /*
     2.5   * Handle floating-point assist faults and traps for domain.
     2.6   */
     2.7 -static unsigned long
     2.8 +unsigned long
     2.9  handle_fpu_swa (int fp_fault, struct pt_regs *regs, unsigned long isr)
    2.10  {
    2.11  	struct vcpu *v = current;
    2.12 @@ -477,11 +477,6 @@ handle_fpu_swa (int fp_fault, struct pt_
    2.13  		PSCBX(v, fpswa_ret) = ret;
    2.14  		printk("%s(%s): fp_emulate() returned %ld\n",
    2.15  		       __FUNCTION__, fp_fault?"fault":"trap", ret.status);
    2.16 -	} else {
    2.17 -		if (fp_fault) {
    2.18 -			/* emulation was successful */
    2.19 -			vcpu_increment_iip(v);
    2.20 -		}
    2.21  	}
    2.22  
    2.23  	return ret.status;
    2.24 @@ -869,7 +864,10 @@ ia64_handle_reflection (unsigned long if
    2.25  		// FIXME: Should we handle unaligned refs in Xen??
    2.26  		vector = IA64_UNALIGNED_REF_VECTOR; break;
    2.27  	    case 32:
    2.28 -		if (!(handle_fpu_swa(1, regs, isr))) return;
    2.29 +		if (!(handle_fpu_swa(1, regs, isr))) {
    2.30 +		    vcpu_increment_iip(v);
    2.31 +		    return;
    2.32 +		}
    2.33  		printf("ia64_handle_reflection: handling FP fault\n");
    2.34  		vector = IA64_FP_FAULT_VECTOR; break;
    2.35  	    case 33: