ia64/xen-unstable
changeset 18875:05b293d7fbb7
IA64: make the fpswa emulation keep the previous behaviour.
When fpswa library return statue > 0, keep the previous behavior.
This case should be addressed somehow later, but it seems somewhat
difficult to resolve, so keep the previous behavor for now.
It is assumed that a guest kernel calls fpswa library
without preemption. This assumption breaks if a guest kernel is
preemptive.
Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp>
When fpswa library return statue > 0, keep the previous behavior.
This case should be addressed somehow later, but it seems somewhat
difficult to resolve, so keep the previous behavor for now.
It is assumed that a guest kernel calls fpswa library
without preemption. This assumption breaks if a guest kernel is
preemptive.
Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp>
author | Isaku Yamahata <yamahata@valinux.co.jp> |
---|---|
date | Fri Dec 12 10:35:58 2008 +0900 (2008-12-12) |
parents | 9e0f8f78d37a |
children | 09c467481a44 |
files | xen/arch/ia64/xen/faults.c xen/arch/ia64/xen/hypercall.c xen/include/asm-ia64/domain.h |
line diff
1.1 --- a/xen/arch/ia64/xen/faults.c Fri Dec 12 10:34:18 2008 +0900 1.2 +++ b/xen/arch/ia64/xen/faults.c Fri Dec 12 10:35:58 2008 +0900 1.3 @@ -337,6 +337,7 @@ handle_fpu_swa(int fp_fault, struct pt_r 1.4 rc = IA64_RETRY; 1.5 } 1.6 if (rc == IA64_RETRY) { 1.7 + PSCBX(current, fpswa_ret) = (fpswa_ret_t){IA64_RETRY, 0, 0, 0}; 1.8 gdprintk(XENLOG_DEBUG, 1.9 "%s(%s): floating-point bundle at 0x%lx not mapped\n", 1.10 __FUNCTION__, fp_fault ? "fault" : "trap", fault_ip); 1.11 @@ -347,6 +348,7 @@ handle_fpu_swa(int fp_fault, struct pt_r 1.12 &isr, ®s->pr, ®s->cr_ifs, regs); 1.13 1.14 if (ret.status) { 1.15 + PSCBX(current, fpswa_ret) = ret; 1.16 printk("%s(%s): fp_emulate() returned %ld\n", 1.17 __FUNCTION__, fp_fault ? "fault" : "trap", ret.status); 1.18 }
2.1 --- a/xen/arch/ia64/xen/hypercall.c Fri Dec 12 10:34:18 2008 +0900 2.2 +++ b/xen/arch/ia64/xen/hypercall.c Fri Dec 12 10:35:58 2008 +0900 2.3 @@ -165,6 +165,13 @@ fw_hypercall_fpswa (struct vcpu *v, stru 2.4 struct page_info *hv_page = NULL; 2.5 XEN_EFI_RR_DECLARE(rr6, rr7); 2.6 2.7 + if (unlikely(PSCBX(v, fpswa_ret).status != 0 && 2.8 + PSCBX(v, fpswa_ret).status != IA64_RETRY)) { 2.9 + ret = PSCBX(v, fpswa_ret); 2.10 + PSCBX(v, fpswa_ret) = (fpswa_ret_t){0, 0, 0, 0}; 2.11 + return ret; 2.12 + } 2.13 + 2.14 if (!fpswa_interface) 2.15 goto error; 2.16
3.1 --- a/xen/include/asm-ia64/domain.h Fri Dec 12 10:34:18 2008 +0900 3.2 +++ b/xen/include/asm-ia64/domain.h Fri Dec 12 10:35:58 2008 +0900 3.3 @@ -288,6 +288,7 @@ 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