summaryrefslogtreecommitdiff
path: root/include/asm-x86/kvm_x86_emulate.h
diff options
context:
space:
mode:
authorAvi Kivity <avi@qumranet.com>2008-06-22 16:22:51 +0300
committerAvi Kivity <avi@qumranet.com>2008-07-20 12:42:35 +0300
commit7a5b56dfd3a682a51fc84682290d5147872a8e99 (patch)
treef7b6f0e746df3c43ab8317d1c4b585334808e5fb /include/asm-x86/kvm_x86_emulate.h
parent0adc8675d645940139d12477e5e05b8a0a7a1117 (diff)
KVM: x86 emulator: lazily evaluate segment registers
Instead of prefetching all segment bases before emulation, read them at the last moment. Since most of them are unneeded, we save some cycles on Intel machines where this is a bit expensive. Signed-off-by: Avi Kivity <avi@qumranet.com>
Diffstat (limited to 'include/asm-x86/kvm_x86_emulate.h')
-rw-r--r--include/asm-x86/kvm_x86_emulate.h10
1 files changed, 3 insertions, 7 deletions
diff --git a/include/asm-x86/kvm_x86_emulate.h b/include/asm-x86/kvm_x86_emulate.h
index 9fda4b35e195..4e8c1e48d91d 100644
--- a/include/asm-x86/kvm_x86_emulate.h
+++ b/include/asm-x86/kvm_x86_emulate.h
@@ -124,7 +124,8 @@ struct decode_cache {
u8 rex_prefix;
struct operand src;
struct operand dst;
- unsigned long *override_base;
+ bool has_seg_override;
+ u8 seg_override;
unsigned int d;
unsigned long regs[NR_VCPU_REGS];
unsigned long eip;
@@ -151,12 +152,7 @@ struct x86_emulate_ctxt {
/* Emulated execution mode, represented by an X86EMUL_MODE value. */
int mode;
- unsigned long cs_base;
- unsigned long ds_base;
- unsigned long es_base;
- unsigned long ss_base;
- unsigned long gs_base;
- unsigned long fs_base;
+ u32 cs_base;
/* decode cache */