From mboxrd@z Thu Jan 1 00:00:00 1970 From: Paolo Bonzini Subject: Re: Seeking a KVM benchmark Date: Wed, 12 Nov 2014 12:56:40 -0500 (EST) Message-ID: <1257793896.944291.1415815000290.JavaMail.zimbra@redhat.com> References: <20141110173835.GA26770@minantech.com> <5463458C.2070000@redhat.com> <20141112152204.GC26187@minantech.com> <54637C25.5000305@redhat.com> <20141112153230.GD26187@minantech.com> <5463821C.2020900@redhat.com> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit Cc: Gleb Natapov , Avi Kivity , kvm list To: Andy Lutomirski Return-path: Received: from mx5-phx2.redhat.com ([209.132.183.37]:57988 "EHLO mx5-phx2.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751685AbaKLR4o (ORCPT ); Wed, 12 Nov 2014 12:56:44 -0500 In-Reply-To: Sender: kvm-owner@vger.kernel.org List-ID: > Assuming you're running both of my patches (LOAD_EFER regardless of > nx, but skip LOAD_EFER of guest == host), then some of the speedup may > be just less code running. I haven't figured out exactly when > vmx_save_host_state runs, but my patches avoid a call to > kvm_set_shared_msr, which is worth a few cycles. Yes, that's possible. vmx_save_host_state is here: preempt_disable(); kvm_x86_ops->prepare_guest_switch(vcpu); // <<<< if (vcpu->fpu_active) kvm_load_guest_fpu(vcpu); kvm_load_guest_xcr0(vcpu); vcpu->mode = IN_GUEST_MODE; srcu_read_unlock(&vcpu->kvm->srcu, vcpu->srcu_idx); and it's a fairly hot function. Paolo