diff options
author | Keir Fraser <keir.fraser@citrix.com> | 2008-01-23 14:30:56 +0000 |
---|---|---|
committer | Keir Fraser <keir.fraser@citrix.com> | 2008-01-23 14:30:56 +0000 |
commit | 52e877db6815b8dfd0046b323195e63990cc57d4 (patch) | |
tree | 13aa016d162339e764bf244ca0cfe71b4678a55e | |
parent | 5979d61397078388d979e71d9092322c57225833 (diff) | |
download | xen-52e877db6815b8dfd0046b323195e63990cc57d4.tar.gz xen-52e877db6815b8dfd0046b323195e63990cc57d4.tar.bz2 xen-52e877db6815b8dfd0046b323195e63990cc57d4.zip |
vmx realmode: Implement new x86_emulate hook load_fpu_ctxt().
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
-rw-r--r-- | xen/arch/x86/hvm/vmx/realmode.c | 10 | ||||
-rw-r--r-- | xen/arch/x86/hvm/vmx/vmx.c | 2 | ||||
-rw-r--r-- | xen/include/asm-x86/hvm/vmx/vmx.h | 1 |
3 files changed, 11 insertions, 2 deletions
diff --git a/xen/arch/x86/hvm/vmx/realmode.c b/xen/arch/x86/hvm/vmx/realmode.c index 39b1fdb590..6bb778e965 100644 --- a/xen/arch/x86/hvm/vmx/realmode.c +++ b/xen/arch/x86/hvm/vmx/realmode.c @@ -473,6 +473,13 @@ static int realmode_inject_sw_interrupt( return X86EMUL_OKAY; } +static void realmode_load_fpu_ctxt( + struct x86_emulate_ctxt *ctxt) +{ + if ( !current->fpu_dirtied ) + vmx_do_no_device_fault(); +} + static struct x86_emulate_ops realmode_emulator_ops = { .read = realmode_emulate_read, .insn_fetch = realmode_emulate_insn_fetch, @@ -491,7 +498,8 @@ static struct x86_emulate_ops realmode_emulator_ops = { .cpuid = realmode_cpuid, .hlt = realmode_hlt, .inject_hw_exception = realmode_inject_hw_exception, - .inject_sw_interrupt = realmode_inject_sw_interrupt + .inject_sw_interrupt = realmode_inject_sw_interrupt, + .load_fpu_ctxt = realmode_load_fpu_ctxt }; void vmx_realmode(struct cpu_user_regs *regs) diff --git a/xen/arch/x86/hvm/vmx/vmx.c b/xen/arch/x86/hvm/vmx/vmx.c index 3cb137268e..486a7bf44d 100644 --- a/xen/arch/x86/hvm/vmx/vmx.c +++ b/xen/arch/x86/hvm/vmx/vmx.c @@ -1214,7 +1214,7 @@ static void __update_guest_eip(unsigned long inst_len) vmx_inject_exception(TRAP_debug, HVM_DELIVER_NO_ERROR_CODE, 0); } -static void vmx_do_no_device_fault(void) +void vmx_do_no_device_fault(void) { struct vcpu *v = current; diff --git a/xen/include/asm-x86/hvm/vmx/vmx.h b/xen/include/asm-x86/hvm/vmx/vmx.h index af50427ed3..ec03e75d9c 100644 --- a/xen/include/asm-x86/hvm/vmx/vmx.h +++ b/xen/include/asm-x86/hvm/vmx/vmx.h @@ -33,6 +33,7 @@ void vmx_intr_assist(void); void vmx_do_resume(struct vcpu *); void set_guest_time(struct vcpu *v, u64 gtime); void vmx_vlapic_msr_changed(struct vcpu *v); +void vmx_do_no_device_fault(void); void vmx_cpuid_intercept( unsigned int *eax, unsigned int *ebx, unsigned int *ecx, unsigned int *edx); |