All of lore.kernel.org
 help / color / mirror / Atom feed
From: Paolo Bonzini <pbonzini@redhat.com>
To: "Sean Christopherson" <sean.j.christopherson@intel.com>,
	"Radim Krčmář" <rkrcmar@redhat.com>,
	"Josh Poimboeuf" <jpoimboe@redhat.com>,
	"Peter Zijlstra" <peterz@infradead.org>
Cc: kvm@vger.kernel.org
Subject: Re: [PATCH 0/4] KVM: VMX: Preemptivly optimize VMX instrs
Date: Fri, 19 Jul 2019 20:01:38 +0200	[thread overview]
Message-ID: <0113d029-11b9-1955-907b-3dbc9ccd0b91@redhat.com> (raw)
In-Reply-To: <20190719172540.7697-1-sean.j.christopherson@intel.com>

On 19/07/19 19:25, Sean Christopherson wrote:
> An in-flight patch[1] to make __kvm_handle_fault_on_reboot() play nice
> with objtool will add a JMP after most VMX instructions so that the reboot
> macro can use an actual CALL to kvm_spurious_fault() instead of a funky
> PUSH+JMP facsimile.
> 
> Rework the low level VMX instruction helpers to handle unexpected faults
> manually instead of relying on the "fault on reboot" macro.  By using
> asm-goto, most helpers can branch directly to an in-function call to
> kvm_spurious_fault(), which can then be optimized by compilers to reside
> out-of-line at the end of the function instead of inline as done by
> "fault on reboot".
> 
> The net impact relative to the current code base is more or less a nop
> when building with a compiler that supports __GCC_ASM_FLAG_OUTPUTS__.
> A bunch of code that was previously in .fixup gets moved into the slow
> paths of functions, but the fast paths are more basically unchanged.
> 
> Without __GCC_ASM_FLAG_OUTPUTS__, manually coding the Jcc is a net
> positive as CC_SET() without compiler support almost always generates a
> SETcc+CMP+Jcc sequence, which is now replaced with a single Jcc.
> 
> A small bonus is that the Jcc instrs are hinted to predict that the VMX
> instr will be successful.
> 
> [1] https://lkml.kernel.org/r/64a9b64d127e87b6920a97afde8e96ea76f6524e.1563413318.git.jpoimboe@redhat.com
> 
> Sean Christopherson (4):
>   objtool: KVM: x86: Check kvm_rebooting in kvm_spurious_fault()
>   KVM: VMX: Optimize VMX instruction error and fault handling
>   KVM: VMX: Add error handling to VMREAD helper
>   KVM: x86: Drop ____kvm_handle_fault_on_reboot()
> 
>  arch/x86/include/asm/kvm_host.h |  6 +--
>  arch/x86/kvm/vmx/ops.h          | 93 ++++++++++++++++++++-------------
>  arch/x86/kvm/vmx/vmx.c          | 42 +++++++++++++++
>  arch/x86/kvm/x86.c              |  3 +-
>  tools/objtool/check.c           |  1 -
>  5 files changed, 102 insertions(+), 43 deletions(-)
> 

Very nice - series

Acked-by: Paolo Bonzini <pbonzini@redhat.com>

Paolo

      parent reply	other threads:[~2019-07-19 18:01 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-07-19 17:25 [PATCH 0/4] KVM: VMX: Preemptivly optimize VMX instrs Sean Christopherson
2019-07-19 17:25 ` [PATCH 1/4] objtool: KVM: x86: Check kvm_rebooting in kvm_spurious_fault() Sean Christopherson
2019-07-19 17:25 ` [PATCH 2/4] KVM: VMX: Optimize VMX instruction error and fault handling Sean Christopherson
2019-07-19 17:25 ` [PATCH 3/4] KVM: VMX: Add error handling to VMREAD helper Sean Christopherson
2019-07-19 17:25 ` [PATCH 4/4] KVM: x86: Drop ____kvm_handle_fault_on_reboot() Sean Christopherson
2019-07-19 18:01 ` [PATCH 0/4] KVM: VMX: Preemptivly optimize VMX instrs Paolo Bonzini
2019-07-19 18:27   ` Josh Poimboeuf
2019-07-19 18:01 ` Paolo Bonzini [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=0113d029-11b9-1955-907b-3dbc9ccd0b91@redhat.com \
    --to=pbonzini@redhat.com \
    --cc=jpoimboe@redhat.com \
    --cc=kvm@vger.kernel.org \
    --cc=peterz@infradead.org \
    --cc=rkrcmar@redhat.com \
    --cc=sean.j.christopherson@intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.