From: Isaku Yamahata Date: Fri, 12 Dec 2008 01:35:58 +0000 (+0900) Subject: IA64: make the fpswa emulation keep the previous behaviour. X-Git-Tag: archive/raspbian/4.8.0-1+rpi1~1^2~14031 X-Git-Url: https://dgit.raspbian.org/?a=commitdiff_plain;h=8344be4d2fce09d2fbf3e47cfcf0b9efa07f9cc6;p=xen.git 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 --- diff --git a/xen/arch/ia64/xen/faults.c b/xen/arch/ia64/xen/faults.c index d1327e8681..7aec52d3b0 100644 --- a/xen/arch/ia64/xen/faults.c +++ b/xen/arch/ia64/xen/faults.c @@ -337,6 +337,7 @@ handle_fpu_swa(int fp_fault, struct pt_regs *regs, unsigned long isr) rc = IA64_RETRY; } if (rc == IA64_RETRY) { + PSCBX(current, fpswa_ret) = (fpswa_ret_t){IA64_RETRY, 0, 0, 0}; gdprintk(XENLOG_DEBUG, "%s(%s): floating-point bundle at 0x%lx not mapped\n", __FUNCTION__, fp_fault ? "fault" : "trap", fault_ip); @@ -347,6 +348,7 @@ handle_fpu_swa(int fp_fault, struct pt_regs *regs, unsigned long isr) &isr, ®s->pr, ®s->cr_ifs, regs); if (ret.status) { + PSCBX(current, fpswa_ret) = ret; printk("%s(%s): fp_emulate() returned %ld\n", __FUNCTION__, fp_fault ? "fault" : "trap", ret.status); } diff --git a/xen/arch/ia64/xen/hypercall.c b/xen/arch/ia64/xen/hypercall.c index 0ae317e96e..f727729746 100644 --- a/xen/arch/ia64/xen/hypercall.c +++ b/xen/arch/ia64/xen/hypercall.c @@ -165,6 +165,13 @@ fw_hypercall_fpswa (struct vcpu *v, struct pt_regs *regs) struct page_info *hv_page = NULL; XEN_EFI_RR_DECLARE(rr6, rr7); + if (unlikely(PSCBX(v, fpswa_ret).status != 0 && + PSCBX(v, fpswa_ret).status != IA64_RETRY)) { + ret = PSCBX(v, fpswa_ret); + PSCBX(v, fpswa_ret) = (fpswa_ret_t){0, 0, 0, 0}; + return ret; + } + if (!fpswa_interface) goto error; diff --git a/xen/include/asm-ia64/domain.h b/xen/include/asm-ia64/domain.h index 2c9f21f089..f04ed5b790 100644 --- a/xen/include/asm-ia64/domain.h +++ b/xen/include/asm-ia64/domain.h @@ -288,6 +288,7 @@ struct arch_vcpu { char irq_new_condition; // vpsr.i/vtpr change, check for pending VHPI char hypercall_continuation; + fpswa_ret_t fpswa_ret; /* save return values of FPSWA emulation */ struct timer hlt_timer; struct arch_vmx_struct arch_vmx; /* Virtual Machine Extensions */