提交 d39123a4 编写于 作者: Y Yang Zhang 提交者: Avi Kivity

KVM: ia64: fix fp fault/trap handler

The floating-point registers f6-f11 is used by vmm and
saved in kvm-pt-regs, so should set the correct bit mask
and the pointer in fp_state, otherwise, fpswa may touch
vmm's fp registers instead of guests'.

In addition, for fp trap handling,  since the instruction
which leads to fp trap is completely executed, so can't
use retry machanism to re-execute it, because it may
pollute some registers.
Signed-off-by: NYang Zhang <yang.zhang@intel.com>
Signed-off-by: NAvi Kivity <avi@redhat.com>
上级 d2f8d7ee
...@@ -455,11 +455,16 @@ fpswa_ret_t vmm_fp_emulate(int fp_fault, void *bundle, unsigned long *ipsr, ...@@ -455,11 +455,16 @@ fpswa_ret_t vmm_fp_emulate(int fp_fault, void *bundle, unsigned long *ipsr,
if (!vmm_fpswa_interface) if (!vmm_fpswa_interface)
return (fpswa_ret_t) {-1, 0, 0, 0}; return (fpswa_ret_t) {-1, 0, 0, 0};
memset(&fp_state, 0, sizeof(fp_state_t));
/* /*
* Just let fpswa driver to use hardware fp registers. * compute fp_state. only FP registers f6 - f11 are used by the
* No fp register is valid in memory. * vmm, so set those bits in the mask and set the low volatile
* pointer to point to these registers.
*/ */
memset(&fp_state, 0, sizeof(fp_state_t)); fp_state.bitmask_low64 = 0xfc0; /* bit6..bit11 */
fp_state.fp_state_low_volatile = (fp_state_low_volatile_t *) &regs->f6;
/* /*
* unsigned long (*EFI_FPSWA) ( * unsigned long (*EFI_FPSWA) (
...@@ -545,10 +550,6 @@ void reflect_interruption(u64 ifa, u64 isr, u64 iim, ...@@ -545,10 +550,6 @@ void reflect_interruption(u64 ifa, u64 isr, u64 iim,
status = vmm_handle_fpu_swa(0, regs, isr); status = vmm_handle_fpu_swa(0, regs, isr);
if (!status) if (!status)
return ; return ;
else if (-EAGAIN == status) {
vcpu_decrement_iip(vcpu);
return ;
}
break; break;
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册