From mboxrd@z Thu Jan 1 00:00:00 1970 From: Gleb Natapov Subject: Re: [PATCH 04/24] KVM: Provide current CPL as part of emulator context. Date: Tue, 9 Mar 2010 16:27:01 +0200 Message-ID: <20100309142701.GQ16909@redhat.com> References: <1268143762-4000-1-git-send-email-gleb@redhat.com> <1268143762-4000-5-git-send-email-gleb@redhat.com> <4B965A2D.30305@redhat.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: kvm@vger.kernel.org To: Avi Kivity Return-path: Received: from mx1.redhat.com ([209.132.183.28]:48488 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753749Ab0CIO1C (ORCPT ); Tue, 9 Mar 2010 09:27:02 -0500 Received: from int-mx04.intmail.prod.int.phx2.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.17]) by mx1.redhat.com (8.13.8/8.13.8) with ESMTP id o29ER241024806 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Tue, 9 Mar 2010 09:27:02 -0500 Content-Disposition: inline In-Reply-To: <4B965A2D.30305@redhat.com> Sender: kvm-owner@vger.kernel.org List-ID: On Tue, Mar 09, 2010 at 04:24:45PM +0200, Avi Kivity wrote: > On 03/09/2010 04:09 PM, Gleb Natapov wrote: > >Eliminate the need to call back into KVM to get it from emulator. > > > > > >@@ -3499,6 +3499,7 @@ int emulate_instruction(struct kvm_vcpu *vcpu, > > > > vcpu->arch.emulate_ctxt.vcpu = vcpu; > > vcpu->arch.emulate_ctxt.eflags = kvm_x86_ops->get_rflags(vcpu); > >+ vcpu->arch.emulate_ctxt.cpl = kvm_x86_ops->get_cpl(vcpu); > > vcpu->arch.emulate_ctxt.mode = > > (!is_protmode(vcpu)) ? X86EMUL_MODE_REAL : > > (vcpu->arch.emulate_ctxt.eflags& X86_EFLAGS_VM) > > This is an unconditional VMREAD, which is slow (extra slow if > nested). Most common emulator ops do not need the cpl. > Will have to make it one of x86_emulate_ops callback then. -- Gleb.