ia64/xen-unstable
changeset 18874:9e0f8f78d37a
IA64: fix fp fault/trap handler.
This patch is a part of fixes to bug reported as
http://bugzilla.xensource.com/bugzilla/show_bug.cgi?id=1392
When fpswa handler fails to get a bundle in guest,
fp fault/trap should be injected into the guest and let a guest
to handle it.
When the fpswa library return a error, there is no way to
pass the value to the guest. In that case, just inject fpswa
fault/trap into a guest running a risk that guest may get
error with their own fpswa call. Here it is assumed that
no applications depend on SIGFP process signal to recover
their computation.
Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp>
This patch is a part of fixes to bug reported as
http://bugzilla.xensource.com/bugzilla/show_bug.cgi?id=1392
When fpswa handler fails to get a bundle in guest,
fp fault/trap should be injected into the guest and let a guest
to handle it.
When the fpswa library return a error, there is no way to
pass the value to the guest. In that case, just inject fpswa
fault/trap into a guest running a risk that guest may get
error with their own fpswa call. Here it is assumed that
no applications depend on SIGFP process signal to recover
their computation.
Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp>
author | Isaku Yamahata <yamahata@valinux.co.jp> |
---|---|
date | Fri Dec 12 10:34:18 2008 +0900 (2008-12-12) |
parents | a86a4ddd8b2b |
children | 05b293d7fbb7 |
files | xen/arch/ia64/vmx/vmx_fault.c xen/arch/ia64/xen/faults.c xen/include/asm-ia64/domain.h |
line diff
1.1 --- a/xen/arch/ia64/vmx/vmx_fault.c Fri Dec 12 10:29:15 2008 +0900 1.2 +++ b/xen/arch/ia64/vmx/vmx_fault.c Fri Dec 12 10:34:18 2008 +0900 1.3 @@ -122,8 +122,7 @@ void vmx_reflect_interruption(u64 ifa, u 1.4 if (!status) { 1.5 vcpu_increment_iip(vcpu); 1.6 return; 1.7 - } else if (IA64_RETRY == status) 1.8 - return; 1.9 + } 1.10 break; 1.11 1.12 case 33: // IA64_FP_TRAP_VECTOR 1.13 @@ -133,10 +132,6 @@ void vmx_reflect_interruption(u64 ifa, u 1.14 status = handle_fpu_swa(0, regs, isr); 1.15 if (!status) 1.16 return; 1.17 - else if (IA64_RETRY == status) { 1.18 - vcpu_decrement_iip(vcpu); 1.19 - return; 1.20 - } 1.21 break; 1.22 1.23 case 29: // IA64_DEBUG_VECTOR
2.1 --- a/xen/arch/ia64/xen/faults.c Fri Dec 12 10:29:15 2008 +0900 2.2 +++ b/xen/arch/ia64/xen/faults.c Fri Dec 12 10:34:18 2008 +0900 2.3 @@ -314,7 +314,6 @@ fp_emulate(int fp_fault, void *bundle, u 2.4 unsigned long 2.5 handle_fpu_swa(int fp_fault, struct pt_regs *regs, unsigned long isr) 2.6 { 2.7 - struct vcpu *v = current; 2.8 IA64_BUNDLE bundle; 2.9 unsigned long fault_ip; 2.10 fpswa_ret_t ret; 2.11 @@ -348,7 +347,6 @@ handle_fpu_swa(int fp_fault, struct pt_r 2.12 &isr, ®s->pr, ®s->cr_ifs, regs); 2.13 2.14 if (ret.status) { 2.15 - PSCBX(v, fpswa_ret) = ret; 2.16 printk("%s(%s): fp_emulate() returned %ld\n", 2.17 __FUNCTION__, fp_fault ? "fault" : "trap", ret.status); 2.18 } 2.19 @@ -688,9 +686,6 @@ ia64_handle_reflection(unsigned long ifa 2.20 vcpu_increment_iip(v); 2.21 return; 2.22 } 2.23 - // fetch code fail 2.24 - if (IA64_RETRY == status) 2.25 - return; 2.26 printk("ia64_handle_reflection: handling FP fault\n"); 2.27 vector = IA64_FP_FAULT_VECTOR; 2.28 break; 2.29 @@ -698,11 +693,6 @@ ia64_handle_reflection(unsigned long ifa 2.30 status = handle_fpu_swa(0, regs, isr); 2.31 if (!status) 2.32 return; 2.33 - // fetch code fail 2.34 - if (IA64_RETRY == status) { 2.35 - vcpu_decrement_iip(v); 2.36 - return; 2.37 - } 2.38 printk("ia64_handle_reflection: handling FP trap\n"); 2.39 vector = IA64_FP_TRAP_VECTOR; 2.40 break;
3.1 --- a/xen/include/asm-ia64/domain.h Fri Dec 12 10:29:15 2008 +0900 3.2 +++ b/xen/include/asm-ia64/domain.h Fri Dec 12 10:34:18 2008 +0900 3.3 @@ -288,7 +288,6 @@ struct arch_vcpu { 3.4 char irq_new_condition; // vpsr.i/vtpr change, check for pending VHPI 3.5 char hypercall_continuation; 3.6 3.7 - fpswa_ret_t fpswa_ret; /* save return values of FPSWA emulation */ 3.8 struct timer hlt_timer; 3.9 struct arch_vmx_struct arch_vmx; /* Virtual Machine Extensions */ 3.10