diff options
author | Keir Fraser <keir.fraser@citrix.com> | 2008-02-20 14:36:45 +0000 |
---|---|---|
committer | Keir Fraser <keir.fraser@citrix.com> | 2008-02-20 14:36:45 +0000 |
commit | 3bb4f99d8cec90c3d7731d004333dd03998e2287 (patch) | |
tree | 106e622cfc9218e44d1c25a29c3409172a55acb0 /xen/include/asm-x86/hvm/emulate.h | |
parent | 10d08139c54258700129aebe4193b86efdd94f13 (diff) | |
download | xen-3bb4f99d8cec90c3d7731d004333dd03998e2287.tar.gz xen-3bb4f99d8cec90c3d7731d004333dd03998e2287.tar.bz2 xen-3bb4f99d8cec90c3d7731d004333dd03998e2287.zip |
x86 hvm: Replace old MMIO emulator with x86_emulate()-based harness.
Re-factor VMX real-mode emulation to use the same harness.
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
Diffstat (limited to 'xen/include/asm-x86/hvm/emulate.h')
-rw-r--r-- | xen/include/asm-x86/hvm/emulate.h | 55 |
1 files changed, 55 insertions, 0 deletions
diff --git a/xen/include/asm-x86/hvm/emulate.h b/xen/include/asm-x86/hvm/emulate.h new file mode 100644 index 0000000000..f059bcdedf --- /dev/null +++ b/xen/include/asm-x86/hvm/emulate.h @@ -0,0 +1,55 @@ +/****************************************************************************** + * hvm/emulate.h + * + * HVM instruction emulation. Used for MMIO and VMX real mode. + * + * Copyright (c) 2008 Citrix Systems, Inc. + * + * Authors: + * Keir Fraser <keir.fraser@citrix.com> + */ + +#ifndef __ASM_X86_HVM_EMULATE_H__ +#define __ASM_X86_HVM_EMULATE_H__ + +#include <xen/config.h> +#include <asm/x86_emulate.h> + +struct hvm_emulate_ctxt { + struct x86_emulate_ctxt ctxt; + + /* Cache of 16 bytes of instruction. */ + uint8_t insn_buf[16]; + unsigned long insn_buf_eip; + unsigned int insn_buf_bytes; + + struct segment_register seg_reg[10]; + unsigned long seg_reg_accessed; + unsigned long seg_reg_dirty; + + union { + struct { + unsigned int hlt:1; + unsigned int mov_ss:1; + unsigned int sti:1; + unsigned int exn_pending:1; + } flags; + unsigned int flag_word; + }; + + uint8_t exn_vector; + uint8_t exn_insn_len; +}; + +int hvm_emulate_one( + struct hvm_emulate_ctxt *hvmemul_ctxt); +void hvm_emulate_prepare( + struct hvm_emulate_ctxt *hvmemul_ctxt, + struct cpu_user_regs *regs); +void hvm_emulate_writeback( + struct hvm_emulate_ctxt *hvmemul_ctxt); +struct segment_register *hvmemul_get_seg_reg( + enum x86_segment seg, + struct hvm_emulate_ctxt *hvmemul_ctxt); + +#endif /* __ASM_X86_HVM_EMULATE_H__ */ |