diff options
Diffstat (limited to 'arch/x86/include/asm/kvm_emulate.h')
-rw-r--r-- | arch/x86/include/asm/kvm_emulate.h | 52 |
1 files changed, 24 insertions, 28 deletions
diff --git a/arch/x86/include/asm/kvm_emulate.h b/arch/x86/include/asm/kvm_emulate.h index 0049211959c0..6040d115ef51 100644 --- a/arch/x86/include/asm/kvm_emulate.h +++ b/arch/x86/include/asm/kvm_emulate.h | |||
@@ -229,7 +229,26 @@ struct read_cache { | |||
229 | unsigned long end; | 229 | unsigned long end; |
230 | }; | 230 | }; |
231 | 231 | ||
232 | struct decode_cache { | 232 | struct x86_emulate_ctxt { |
233 | struct x86_emulate_ops *ops; | ||
234 | |||
235 | /* Register state before/after emulation. */ | ||
236 | unsigned long eflags; | ||
237 | unsigned long eip; /* eip before instruction emulation */ | ||
238 | /* Emulated execution mode, represented by an X86EMUL_MODE value. */ | ||
239 | int mode; | ||
240 | |||
241 | /* interruptibility state, as a result of execution of STI or MOV SS */ | ||
242 | int interruptibility; | ||
243 | |||
244 | bool guest_mode; /* guest running a nested guest */ | ||
245 | bool perm_ok; /* do not check permissions if true */ | ||
246 | bool only_vendor_specific_insn; | ||
247 | |||
248 | bool have_exception; | ||
249 | struct x86_exception exception; | ||
250 | |||
251 | /* decode cache */ | ||
233 | u8 twobyte; | 252 | u8 twobyte; |
234 | u8 b; | 253 | u8 b; |
235 | u8 intercept; | 254 | u8 intercept; |
@@ -246,8 +265,6 @@ struct decode_cache { | |||
246 | unsigned int d; | 265 | unsigned int d; |
247 | int (*execute)(struct x86_emulate_ctxt *ctxt); | 266 | int (*execute)(struct x86_emulate_ctxt *ctxt); |
248 | int (*check_perm)(struct x86_emulate_ctxt *ctxt); | 267 | int (*check_perm)(struct x86_emulate_ctxt *ctxt); |
249 | unsigned long regs[NR_VCPU_REGS]; | ||
250 | unsigned long eip; | ||
251 | /* modrm */ | 268 | /* modrm */ |
252 | u8 modrm; | 269 | u8 modrm; |
253 | u8 modrm_mod; | 270 | u8 modrm_mod; |
@@ -255,34 +272,14 @@ struct decode_cache { | |||
255 | u8 modrm_rm; | 272 | u8 modrm_rm; |
256 | u8 modrm_seg; | 273 | u8 modrm_seg; |
257 | bool rip_relative; | 274 | bool rip_relative; |
275 | unsigned long _eip; | ||
276 | /* Fields above regs are cleared together. */ | ||
277 | unsigned long regs[NR_VCPU_REGS]; | ||
258 | struct fetch_cache fetch; | 278 | struct fetch_cache fetch; |
259 | struct read_cache io_read; | 279 | struct read_cache io_read; |
260 | struct read_cache mem_read; | 280 | struct read_cache mem_read; |
261 | }; | 281 | }; |
262 | 282 | ||
263 | struct x86_emulate_ctxt { | ||
264 | struct x86_emulate_ops *ops; | ||
265 | |||
266 | /* Register state before/after emulation. */ | ||
267 | unsigned long eflags; | ||
268 | unsigned long eip; /* eip before instruction emulation */ | ||
269 | /* Emulated execution mode, represented by an X86EMUL_MODE value. */ | ||
270 | int mode; | ||
271 | |||
272 | /* interruptibility state, as a result of execution of STI or MOV SS */ | ||
273 | int interruptibility; | ||
274 | |||
275 | bool guest_mode; /* guest running a nested guest */ | ||
276 | bool perm_ok; /* do not check permissions if true */ | ||
277 | bool only_vendor_specific_insn; | ||
278 | |||
279 | bool have_exception; | ||
280 | struct x86_exception exception; | ||
281 | |||
282 | /* decode cache */ | ||
283 | struct decode_cache decode; | ||
284 | }; | ||
285 | |||
286 | /* Repeat String Operation Prefix */ | 283 | /* Repeat String Operation Prefix */ |
287 | #define REPE_PREFIX 0xf3 | 284 | #define REPE_PREFIX 0xf3 |
288 | #define REPNE_PREFIX 0xf2 | 285 | #define REPNE_PREFIX 0xf2 |
@@ -373,6 +370,5 @@ int x86_emulate_insn(struct x86_emulate_ctxt *ctxt); | |||
373 | int emulator_task_switch(struct x86_emulate_ctxt *ctxt, | 370 | int emulator_task_switch(struct x86_emulate_ctxt *ctxt, |
374 | u16 tss_selector, int reason, | 371 | u16 tss_selector, int reason, |
375 | bool has_error_code, u32 error_code); | 372 | bool has_error_code, u32 error_code); |
376 | int emulate_int_real(struct x86_emulate_ctxt *ctxt, | 373 | int emulate_int_real(struct x86_emulate_ctxt *ctxt, int irq); |
377 | struct x86_emulate_ops *ops, int irq); | ||
378 | #endif /* _ASM_X86_KVM_X86_EMULATE_H */ | 374 | #endif /* _ASM_X86_KVM_X86_EMULATE_H */ |