All of lore.kernel.org
 help / color / mirror / Atom feed
* RFC: Getting rid of LTR in VMX
@ 2017-02-18  3:29 Andy Lutomirski
  2017-02-18 15:19 ` Paolo Bonzini
  2017-02-20 11:05 ` Paolo Bonzini
  0 siblings, 2 replies; 8+ messages in thread
From: Andy Lutomirski @ 2017-02-18  3:29 UTC (permalink / raw)
  To: kvm list, Paolo Bonzini, linux-kernel, X86 ML, H. Peter Anvin,
	Borislav Petkov

There's no code here because the patch is trivial, but I want to run
the idea by you all first to see if there are any issues.

VMX is silly and forces the TSS limit to the minimum on VM exits.  KVM
wastes lots of cycles bumping it back up to accomodate the io bitmap.

I propose that we rework this.  Add a percpu variable that indicates
whether the TSS limit needs to be refreshed.  On task switch, if the
new task has TIF_IO_BITMAP set, then check that flag and, if set,
refresh TR and clear the flag.  On VMX exit, set the flag.

The TSS limit is (phew!) invisible to userspace, so we don't have ABI
issues to worry about here.  We also shouldn't have security issues
because a too-low TSS limit just results in unprivileged IO operations
generating #GP, which is exactly what we want.

What do you all think?  I expect a speedup of a couple hundred cycles
on each VM exit.

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

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

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-02-18  3:29 RFC: Getting rid of LTR in VMX Andy Lutomirski
2017-02-18 15:19 ` Paolo Bonzini
2017-02-20 11:05 ` Paolo Bonzini
2017-02-20 16:46   ` Andy Lutomirski
2017-02-20 16:51     ` Paolo Bonzini
2017-02-20 16:55       ` Andy Lutomirski
2017-02-20 22:02         ` Paolo Bonzini
2017-02-20 22:23           ` hpa

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.