diff options
author | Avi Kivity <avi@qumranet.com> | 2008-06-22 09:22:51 -0400 |
---|---|---|
committer | Avi Kivity <avi@qumranet.com> | 2008-07-20 05:42:35 -0400 |
commit | 7a5b56dfd3a682a51fc84682290d5147872a8e99 (patch) | |
tree | f7b6f0e746df3c43ab8317d1c4b585334808e5fb /include/asm-x86/kvm_x86_emulate.h | |
parent | 0adc8675d645940139d12477e5e05b8a0a7a1117 (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.h | 10 |
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 { | |||
124 | u8 rex_prefix; | 124 | u8 rex_prefix; |
125 | struct operand src; | 125 | struct operand src; |
126 | struct operand dst; | 126 | struct operand dst; |
127 | unsigned long *override_base; | 127 | bool has_seg_override; |
128 | u8 seg_override; | ||
128 | unsigned int d; | 129 | unsigned int d; |
129 | unsigned long regs[NR_VCPU_REGS]; | 130 | unsigned long regs[NR_VCPU_REGS]; |
130 | unsigned long eip; | 131 | unsigned long eip; |
@@ -151,12 +152,7 @@ struct x86_emulate_ctxt { | |||
151 | /* Emulated execution mode, represented by an X86EMUL_MODE value. */ | 152 | /* Emulated execution mode, represented by an X86EMUL_MODE value. */ |
152 | int mode; | 153 | int mode; |
153 | 154 | ||
154 | unsigned long cs_base; | 155 | u32 cs_base; |
155 | unsigned long ds_base; | ||
156 | unsigned long es_base; | ||
157 | unsigned long ss_base; | ||
158 | unsigned long gs_base; | ||
159 | unsigned long fs_base; | ||
160 | 156 | ||
161 | /* decode cache */ | 157 | /* decode cache */ |
162 | 158 | ||