Skip to content

RFC Emulator Speedups - Optimize Instruction fetches

Bandan Das kvm lkml 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 RFC Latest3 patches 4 repliesIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/3KVM: x86: pass ctxt to fetch helper functionarch/x86/kvm/x86.c+5 -50 replies
2/3KVM: x86: use memory_prepare in fetch helper functionarch/x86/kvm/x86.c+17 -82 replies
3/3KVM: x86: cache userspace address for faster fetchesarch/x86/include/asm/kvm_emulate.h arch/x86/kvm/x86.c+29 -112 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.

Read the v1 thread

Cover letter [RFC PATCH 0/3] Emulator Speedups - Optimize Instruction fetches

My initial attempt at caching gva->gpa->hva translations. Pretty straight forward with details in the individual patches.

I haven't yet looked into if there are other possibilities to speed things up, just thought of sending these out since the numbers are better

567 cycles/emulated jump instruction
718 cycles/emulated move instruction
730 cycles/emulated arithmetic instruction
946 cycles/emulated memory load instruction
956 cycles/emulated memory store instruction
921 cycles/emulated memory RMW instruction

Old realmode.flat numbers from init ctxt changes -
https://lkml.org/lkml/2014/4/16/848

639 cycles/emulated jump instruction (4.3%) 776 cycles/emulated move instruction (7.5%) 791 cycles/emulated arithmetic instruction (11%) 943 cycles/emulated memory load instruction (5.2%) 948 cycles/emulated memory store instruction (7.6%) 929 cycles/emulated memory RMW instruction (9.0%)

Bandan Das (3):
KVM: x86: pass ctxt to fetch helper function
KVM: x86: use memory_prepare in fetch helper function
KVM: x86: cache userspace address for faster fetches

 arch/x86/include/asm/kvm_emulate.h |  7 +++++-
 arch/x86/kvm/x86.c                 | 46 ++++++++++++++++++++++++++++----------
 2 files changed, 40 insertions(+), 13 deletions(-)
Signature · 1 line
1.8.3.1