Linux Kernel  3.7.1
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Data Structures | Macros | Typedefs | Enumerations | Functions
kvm_emulate.h File Reference
#include <asm/desc_defs.h>

Go to the source code of this file.

Data Structures

struct  x86_exception
 
struct  x86_instruction_info
 
struct  x86_emulate_ops
 
struct  operand
 
struct  fetch_cache
 
struct  read_cache
 
struct  x86_emulate_ctxt
 

Macros

#define X86EMUL_CONTINUE   0
 
#define X86EMUL_UNHANDLEABLE   1
 
#define X86EMUL_PROPAGATE_FAULT   2 /* propagate a generated fault to guest */
 
#define X86EMUL_RETRY_INSTR   3 /* retry the instruction for some reason */
 
#define X86EMUL_CMPXCHG_FAILED   4 /* cmpxchg did not see expected value */
 
#define X86EMUL_IO_NEEDED   5 /* IO is needed to complete emulation */
 
#define X86EMUL_INTERCEPTED   6 /* Intercepted by nested VMCB/VMCS */
 
#define REPE_PREFIX   0xf3
 
#define REPNE_PREFIX   0xf2
 
#define X86EMUL_CPUID_VENDOR_AuthenticAMD_ebx   0x68747541
 
#define X86EMUL_CPUID_VENDOR_AuthenticAMD_ecx   0x444d4163
 
#define X86EMUL_CPUID_VENDOR_AuthenticAMD_edx   0x69746e65
 
#define X86EMUL_CPUID_VENDOR_AMDisbetterI_ebx   0x69444d41
 
#define X86EMUL_CPUID_VENDOR_AMDisbetterI_ecx   0x21726574
 
#define X86EMUL_CPUID_VENDOR_AMDisbetterI_edx   0x74656273
 
#define X86EMUL_CPUID_VENDOR_GenuineIntel_ebx   0x756e6547
 
#define X86EMUL_CPUID_VENDOR_GenuineIntel_ecx   0x6c65746e
 
#define X86EMUL_CPUID_VENDOR_GenuineIntel_edx   0x49656e69
 
#define EMULATION_FAILED   -1
 
#define EMULATION_OK   0
 
#define EMULATION_RESTART   1
 
#define EMULATION_INTERCEPTED   2
 

Typedefs

typedef u32 __attribute__ ((vector_size(16))) sse128_t
 

Enumerations

enum  x86emul_mode {
  X86EMUL_MODE_REAL, X86EMUL_MODE_VM86, X86EMUL_MODE_PROT16, X86EMUL_MODE_PROT32,
  X86EMUL_MODE_PROT64
}
 
enum  x86_intercept_stage { X86_ICTP_NONE = 0, X86_ICPT_PRE_EXCEPT, X86_ICPT_POST_EXCEPT, X86_ICPT_POST_MEMACCESS }
 
enum  x86_intercept {
  x86_intercept_none, x86_intercept_cr_read, x86_intercept_cr_write, x86_intercept_clts,
  x86_intercept_lmsw, x86_intercept_smsw, x86_intercept_dr_read, x86_intercept_dr_write,
  x86_intercept_lidt, x86_intercept_sidt, x86_intercept_lgdt, x86_intercept_sgdt,
  x86_intercept_lldt, x86_intercept_sldt, x86_intercept_ltr, x86_intercept_str,
  x86_intercept_rdtsc, x86_intercept_rdpmc, x86_intercept_pushf, x86_intercept_popf,
  x86_intercept_cpuid, x86_intercept_rsm, x86_intercept_iret, x86_intercept_intn,
  x86_intercept_invd, x86_intercept_pause, x86_intercept_hlt, x86_intercept_invlpg,
  x86_intercept_invlpga, x86_intercept_vmrun, x86_intercept_vmload, x86_intercept_vmsave,
  x86_intercept_vmmcall, x86_intercept_stgi, x86_intercept_clgi, x86_intercept_skinit,
  x86_intercept_rdtscp, x86_intercept_icebp, x86_intercept_wbinvd, x86_intercept_monitor,
  x86_intercept_mwait, x86_intercept_rdmsr, x86_intercept_wrmsr, x86_intercept_in,
  x86_intercept_ins, x86_intercept_out, x86_intercept_outs, nr_x86_intercepts
}
 

Functions

int x86_decode_insn (struct x86_emulate_ctxt *ctxt, void *insn, int insn_len)
 
bool x86_page_table_writing_insn (struct x86_emulate_ctxt *ctxt)
 
int x86_emulate_insn (struct x86_emulate_ctxt *ctxt)
 
int emulator_task_switch (struct x86_emulate_ctxt *ctxt, u16 tss_selector, int idt_index, int reason, bool has_error_code, u32 error_code)
 
int emulate_int_real (struct x86_emulate_ctxt *ctxt, int irq)
 
void emulator_invalidate_register_cache (struct x86_emulate_ctxt *ctxt)
 
void emulator_writeback_register_cache (struct x86_emulate_ctxt *ctxt)
 

Macro Definition Documentation

#define EMULATION_FAILED   -1

Definition at line 403 of file kvm_emulate.h.

#define EMULATION_INTERCEPTED   2

Definition at line 406 of file kvm_emulate.h.

#define EMULATION_OK   0

Definition at line 404 of file kvm_emulate.h.

#define EMULATION_RESTART   1

Definition at line 405 of file kvm_emulate.h.

#define REPE_PREFIX   0xf3

Definition at line 319 of file kvm_emulate.h.

#define REPNE_PREFIX   0xf2

Definition at line 320 of file kvm_emulate.h.

#define X86EMUL_CMPXCHG_FAILED   4 /* cmpxchg did not see expected value */

Definition at line 83 of file kvm_emulate.h.

#define X86EMUL_CONTINUE   0

Definition at line 77 of file kvm_emulate.h.

#define X86EMUL_CPUID_VENDOR_AMDisbetterI_ebx   0x69444d41

Definition at line 327 of file kvm_emulate.h.

#define X86EMUL_CPUID_VENDOR_AMDisbetterI_ecx   0x21726574

Definition at line 328 of file kvm_emulate.h.

#define X86EMUL_CPUID_VENDOR_AMDisbetterI_edx   0x74656273

Definition at line 329 of file kvm_emulate.h.

#define X86EMUL_CPUID_VENDOR_AuthenticAMD_ebx   0x68747541

Definition at line 323 of file kvm_emulate.h.

#define X86EMUL_CPUID_VENDOR_AuthenticAMD_ecx   0x444d4163

Definition at line 324 of file kvm_emulate.h.

#define X86EMUL_CPUID_VENDOR_AuthenticAMD_edx   0x69746e65

Definition at line 325 of file kvm_emulate.h.

#define X86EMUL_CPUID_VENDOR_GenuineIntel_ebx   0x756e6547

Definition at line 331 of file kvm_emulate.h.

#define X86EMUL_CPUID_VENDOR_GenuineIntel_ecx   0x6c65746e

Definition at line 332 of file kvm_emulate.h.

#define X86EMUL_CPUID_VENDOR_GenuineIntel_edx   0x49656e69

Definition at line 333 of file kvm_emulate.h.

#define X86EMUL_INTERCEPTED   6 /* Intercepted by nested VMCB/VMCS */

Definition at line 85 of file kvm_emulate.h.

#define X86EMUL_IO_NEEDED   5 /* IO is needed to complete emulation */

Definition at line 84 of file kvm_emulate.h.

#define X86EMUL_PROPAGATE_FAULT   2 /* propagate a generated fault to guest */

Definition at line 81 of file kvm_emulate.h.

#define X86EMUL_RETRY_INSTR   3 /* retry the instruction for some reason */

Definition at line 82 of file kvm_emulate.h.

#define X86EMUL_UNHANDLEABLE   1

Definition at line 79 of file kvm_emulate.h.

Typedef Documentation

typedef u32 __attribute__((vector_size(16))) sse128_t

Definition at line 212 of file kvm_emulate.h.

Enumeration Type Documentation

Enumerator:
x86_intercept_none 
x86_intercept_cr_read 
x86_intercept_cr_write 
x86_intercept_clts 
x86_intercept_lmsw 
x86_intercept_smsw 
x86_intercept_dr_read 
x86_intercept_dr_write 
x86_intercept_lidt 
x86_intercept_sidt 
x86_intercept_lgdt 
x86_intercept_sgdt 
x86_intercept_lldt 
x86_intercept_sldt 
x86_intercept_ltr 
x86_intercept_str 
x86_intercept_rdtsc 
x86_intercept_rdpmc 
x86_intercept_pushf 
x86_intercept_popf 
x86_intercept_cpuid 
x86_intercept_rsm 
x86_intercept_iret 
x86_intercept_intn 
x86_intercept_invd 
x86_intercept_pause 
x86_intercept_hlt 
x86_intercept_invlpg 
x86_intercept_invlpga 
x86_intercept_vmrun 
x86_intercept_vmload 
x86_intercept_vmsave 
x86_intercept_vmmcall 
x86_intercept_stgi 
x86_intercept_clgi 
x86_intercept_skinit 
x86_intercept_rdtscp 
x86_intercept_icebp 
x86_intercept_wbinvd 
x86_intercept_monitor 
x86_intercept_mwait 
x86_intercept_rdmsr 
x86_intercept_wrmsr 
x86_intercept_in 
x86_intercept_ins 
x86_intercept_out 
x86_intercept_outs 
nr_x86_intercepts 

Definition at line 342 of file kvm_emulate.h.

Enumerator:
X86_ICTP_NONE 
X86_ICPT_PRE_EXCEPT 
X86_ICPT_POST_EXCEPT 
X86_ICPT_POST_MEMACCESS 

Definition at line 335 of file kvm_emulate.h.

Enumerator:
X86EMUL_MODE_REAL 
X86EMUL_MODE_VM86 
X86EMUL_MODE_PROT16 
X86EMUL_MODE_PROT32 
X86EMUL_MODE_PROT64 

Definition at line 255 of file kvm_emulate.h.

Function Documentation

int emulate_int_real ( struct x86_emulate_ctxt ctxt,
int  irq 
)

Definition at line 1811 of file emulate.c.

void emulator_invalidate_register_cache ( struct x86_emulate_ctxt ctxt)

Definition at line 4707 of file emulate.c.

int emulator_task_switch ( struct x86_emulate_ctxt ctxt,
u16  tss_selector,
int  idt_index,
int  reason,
bool  has_error_code,
u32  error_code 
)

Definition at line 2786 of file emulate.c.

void emulator_writeback_register_cache ( struct x86_emulate_ctxt ctxt)

Definition at line 4712 of file emulate.c.

int x86_decode_insn ( struct x86_emulate_ctxt ctxt,
void insn,
int  insn_len 
)

Definition at line 4092 of file emulate.c.

int x86_emulate_insn ( struct x86_emulate_ctxt ctxt)

Definition at line 4357 of file emulate.c.

bool x86_page_table_writing_insn ( struct x86_emulate_ctxt ctxt)

Definition at line 4302 of file emulate.c.