diff options
author | Avi Kivity <avi@redhat.com> | 2011-06-01 08:34:25 -0400 |
---|---|---|
committer | Avi Kivity <avi@redhat.com> | 2011-07-12 06:16:09 -0400 |
commit | 9dac77fa4011bdb4b541a8db087eac96a602faec (patch) | |
tree | 13305ebc63f91513d9ff579748fd73385603c8dd /arch/x86/include | |
parent | 36dd9bb5ce32bc39e25a5fcc61415f13e3ed5d17 (diff) |
KVM: x86 emulator: fold decode_cache into x86_emulate_ctxt
This saves a lot of pointless casts x86_emulate_ctxt and decode_cache.
Signed-off-by: Avi Kivity <avi@redhat.com>
Signed-off-by: Marcelo Tosatti <mtosatti@redhat.com>
Diffstat (limited to 'arch/x86/include')
-rw-r--r-- | arch/x86/include/asm/kvm_emulate.h | 44 |
1 files changed, 20 insertions, 24 deletions
diff --git a/arch/x86/include/asm/kvm_emulate.h b/arch/x86/include/asm/kvm_emulate.h index d0e100f55b76..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; |
@@ -261,29 +280,6 @@ struct decode_cache { | |||
261 | struct read_cache mem_read; | 280 | struct read_cache mem_read; |
262 | }; | 281 | }; |
263 | 282 | ||
264 | struct x86_emulate_ctxt { | ||
265 | struct x86_emulate_ops *ops; | ||
266 | |||
267 | /* Register state before/after emulation. */ | ||
268 | unsigned long eflags; | ||
269 | unsigned long eip; /* eip before instruction emulation */ | ||
270 | /* Emulated execution mode, represented by an X86EMUL_MODE value. */ | ||
271 | int mode; | ||
272 | |||
273 | /* interruptibility state, as a result of execution of STI or MOV SS */ | ||
274 | int interruptibility; | ||
275 | |||
276 | bool guest_mode; /* guest running a nested guest */ | ||
277 | bool perm_ok; /* do not check permissions if true */ | ||
278 | bool only_vendor_specific_insn; | ||
279 | |||
280 | bool have_exception; | ||
281 | struct x86_exception exception; | ||
282 | |||
283 | /* decode cache */ | ||
284 | struct decode_cache decode; | ||
285 | }; | ||
286 | |||
287 | /* Repeat String Operation Prefix */ | 283 | /* Repeat String Operation Prefix */ |
288 | #define REPE_PREFIX 0xf3 | 284 | #define REPE_PREFIX 0xf3 |
289 | #define REPNE_PREFIX 0xf2 | 285 | #define REPNE_PREFIX 0xf2 |