public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/6] KVM TSS cleanups and speedups
@ 2017-02-20 16:56 Andy Lutomirski
  2017-02-20 16:56 ` [PATCH 1/6] x86/asm: Define the kernel TSS limit in a macro Andy Lutomirski
                   ` (6 more replies)
  0 siblings, 7 replies; 10+ messages in thread
From: Andy Lutomirski @ 2017-02-20 16:56 UTC (permalink / raw)
  To: Paolo Bonzini, X86 ML
  Cc: kvm list, linux-kernel@vger.kernel.org, Borislav Petkov,
	Thomas Garnier, Jim Mattson, Andy Lutomirski

The first four patches here are intended to be straightforward
cleanups and to make a better base for Thomas' GDT series.  They may
be a slight speedup, too, because they remove an STR instruction
from the VMX entry path.

The last two patches are a reasonably large speedup but need careful
review.

FWIW, I can see lots of additional easy-ish speedups here.  For example:

 - The GDT reload on VM exit isn't really needed at all.  Instead let's
   just change the kernel limit to 0xFFFF.  Doing that naively would
   waste memory, but doing it carefully on top of Thomas' series would
   be straightforward and almost free.

 - RDMSR from MSR_GS_BASE is totally pointless.

 - Once I or someone finishes the FSGSBASE series, we get a big speedup
   there.

 - The LDT reload code should be split up and optimized better, I think.

Andy Lutomirski (6):
  x86/asm: Define the kernel TSS limit in a macro
  x86/kvm/vmx: Don't fetch the TSS base from the GDT
  x86/kvm/vmx: Get rid of segment_base() on 64-bit kernels
  x86/kvm/vmx: Simplify segment_base()
  x86/asm/64: Drop __cacheline_aligned from struct x86_hw_tss
  x86/kvm/vmx: Defer TR reload after VM exit

 arch/x86/include/asm/desc.h      | 58 ++++++++++++++++++++++++++++++------
 arch/x86/include/asm/processor.h | 12 +++++++-
 arch/x86/kernel/ioport.c         |  5 ++++
 arch/x86/kernel/process.c        | 10 +++++++
 arch/x86/kvm/vmx.c               | 63 +++++++++++++++++-----------------------
 5 files changed, 102 insertions(+), 46 deletions(-)

-- 
2.9.3

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

end of thread, other threads:[~2017-02-20 17:52 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-02-20 16:56 [PATCH 0/6] KVM TSS cleanups and speedups Andy Lutomirski
2017-02-20 16:56 ` [PATCH 1/6] x86/asm: Define the kernel TSS limit in a macro Andy Lutomirski
2017-02-20 16:56 ` [PATCH 2/6] x86/kvm/vmx: Don't fetch the TSS base from the GDT Andy Lutomirski
2017-02-20 16:56 ` [PATCH 3/6] x86/kvm/vmx: Get rid of segment_base() on 64-bit kernels Andy Lutomirski
2017-02-20 16:56 ` [PATCH 4/6] x86/kvm/vmx: Simplify segment_base() Andy Lutomirski
2017-02-20 17:49   ` Thomas Garnier
2017-02-20 16:56 ` [PATCH 5/6] x86/asm/64: Drop __cacheline_aligned from struct x86_hw_tss Andy Lutomirski
2017-02-20 16:56 ` [PATCH 6/6] x86/kvm/vmx: Defer TR reload after VM exit Andy Lutomirski
2017-02-20 17:51   ` Paolo Bonzini
2017-02-20 17:52 ` [PATCH 0/6] KVM TSS cleanups and speedups Paolo Bonzini

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox