All of lore.kernel.org
 help / color / mirror / Atom feed
* [RFC PATCH v2 0/6] Emulator speedups - avoid initializations where possible
@ 2014-04-11  0:03 Bandan Das
  2014-04-11  0:03 ` [RFC PATCH v2 1/6] KVM: emulate: move init_decode_cache to emulate.c Bandan Das
                   ` (5 more replies)
  0 siblings, 6 replies; 10+ messages in thread
From: Bandan Das @ 2014-04-11  0:03 UTC (permalink / raw)
  To: kvm; +Cc: Marcelo Tosatti, Paolo Bonzini, Gleb Natapov, linux-kernel

While initializing emulation context structure, kvm memsets to 0 a
number of fields some of which are redundant since they get set
eventually in x86_decode_insn. Cleanup unnecessary initializations
and remove some fields.

This is on top of Paolo's RFC
KVM: x86: speedups for emulator memory accesses
https://lkml.org/lkml/2014/4/1/494

Here are the new realmode.flat numbers with improvement
wrt unpatched kernel -

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%)

v1 numbers - 
639 cycles/emulated jump instruction
786 cycles/emulated move instruction
802 cycles/emulated arithmetic instruction
936 cycles/emulated memory load instruction
970 cycles/emulated memory store instruction
1000 cycles/emulated memory RMW instruction

v2:
All thanks and credit to Paolo!
 - 1/6 - no change
 - 2/6 - new patch, inercept and check_perm replaced with checks for bits in ctxt->d
 - 3/6 - new patch, remove if condition in decode_rm and rearrange bit operations
 - 4/6 - remove else conditions from v1 and misc cleanups
 - 5/6 - new patch, remove seg_override and related fields and functions
 - 6/6 - new patch, remove memopp and move rip_relative to a local variable in
         decode_modrm

Bandan Das (6):
  KVM: emulate: move init_decode_cache to emulate.c
  KVM: emulate: Remove ctxt->intercept and ctxt->check_perm checks
  KVM: emulate: cleanup decode_rm
  KVM: emulate: clean up initializations in init_decode_cache
  KVM: emulate: rework seg_override
  KVM: emulate: remove memopp and rip_relative

 arch/x86/include/asm/kvm_emulate.h | 20 ++++-----
 arch/x86/kvm/emulate.c             | 85 ++++++++++++++++++--------------------
 arch/x86/kvm/x86.c                 | 13 ------
 3 files changed, 50 insertions(+), 68 deletions(-)

-- 
1.8.3.1


^ permalink raw reply	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2014-04-14 14:01 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-04-11  0:03 [RFC PATCH v2 0/6] Emulator speedups - avoid initializations where possible Bandan Das
2014-04-11  0:03 ` [RFC PATCH v2 1/6] KVM: emulate: move init_decode_cache to emulate.c Bandan Das
2014-04-11  0:03 ` [RFC PATCH v2 2/6] KVM: emulate: Remove ctxt->intercept and ctxt->check_perm checks Bandan Das
2014-04-11  0:03 ` [RFC PATCH v2 3/6] KVM: emulate: cleanup decode_rm Bandan Das
2014-04-13 12:51   ` Paolo Bonzini
2014-04-11  0:03 ` [RFC PATCH v2 4/6] KVM: emulate: clean up initializations in init_decode_cache Bandan Das
2014-04-11  0:03 ` [RFC PATCH v2 5/6] KVM: emulate: rework seg_override Bandan Das
2014-04-11  0:03 ` [RFC PATCH v2 6/6] KVM: emulate: remove memopp and rip_relative Bandan Das
2014-04-13 12:48   ` Paolo Bonzini
2014-04-14 14:01     ` Bandan Das

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.