aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/kvm/x86_emulate.h
diff options
context:
space:
mode:
authorAvi Kivity <avi@qumranet.com>2007-11-20 06:15:52 -0500
committerAvi Kivity <avi@qumranet.com>2008-01-30 10:53:09 -0500
commit6226686954c4cce3d63ffe1777e60360fcbf0b83 (patch)
tree900614019cbc1c1cf4039d81bfa198624c7316cd /drivers/kvm/x86_emulate.h
parent93a0039c8d93074d5f92dfb69f6a7d453905d002 (diff)
KVM: x86 emulator: prefetch up to 15 bytes of the instruction executed
Instead of fetching one byte at a time, prefetch 15 bytes (or until the next page boundary) to avoid guest page table walks. Signed-off-by: Avi Kivity <avi@qumranet.com>
Diffstat (limited to 'drivers/kvm/x86_emulate.h')
-rw-r--r--drivers/kvm/x86_emulate.h7
1 files changed, 7 insertions, 0 deletions
diff --git a/drivers/kvm/x86_emulate.h b/drivers/kvm/x86_emulate.h
index a62bf14bbf89..4603b2bf3488 100644
--- a/drivers/kvm/x86_emulate.h
+++ b/drivers/kvm/x86_emulate.h
@@ -108,6 +108,12 @@ struct operand {
108 unsigned long val, orig_val, *ptr; 108 unsigned long val, orig_val, *ptr;
109}; 109};
110 110
111struct fetch_cache {
112 u8 data[15];
113 unsigned long start;
114 unsigned long end;
115};
116
111struct decode_cache { 117struct decode_cache {
112 u8 twobyte; 118 u8 twobyte;
113 u8 b; 119 u8 b;
@@ -130,6 +136,7 @@ struct decode_cache {
130 u8 use_modrm_ea; 136 u8 use_modrm_ea;
131 unsigned long modrm_ea; 137 unsigned long modrm_ea;
132 unsigned long modrm_val; 138 unsigned long modrm_val;
139 struct fetch_cache fetch;
133}; 140};
134 141
135struct x86_emulate_ctxt { 142struct x86_emulate_ctxt {