diff options
author | Avi Kivity <avi@qumranet.com> | 2007-11-20 13:15:52 +0200 |
---|---|---|
committer | Avi Kivity <avi@qumranet.com> | 2008-01-30 17:53:09 +0200 |
commit | 6226686954c4cce3d63ffe1777e60360fcbf0b83 (patch) | |
tree | 900614019cbc1c1cf4039d81bfa198624c7316cd /drivers/kvm/x86_emulate.h | |
parent | 93a0039c8d93074d5f92dfb69f6a7d453905d002 (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.h | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/drivers/kvm/x86_emulate.h b/drivers/kvm/x86_emulate.h index a62bf14bbf8..4603b2bf348 100644 --- a/drivers/kvm/x86_emulate.h +++ b/drivers/kvm/x86_emulate.h @@ -108,6 +108,12 @@ struct operand { unsigned long val, orig_val, *ptr; }; +struct fetch_cache { + u8 data[15]; + unsigned long start; + unsigned long end; +}; + struct decode_cache { u8 twobyte; u8 b; @@ -130,6 +136,7 @@ struct decode_cache { u8 use_modrm_ea; unsigned long modrm_ea; unsigned long modrm_val; + struct fetch_cache fetch; }; struct x86_emulate_ctxt { |