From mboxrd@z Thu Jan 1 00:00:00 1970 From: Avi Kivity Subject: Re: [PATCH 04/24] KVM: Provide current CPL as part of emulator context. Date: Tue, 09 Mar 2010 16:24:45 +0200 Message-ID: <4B965A2D.30305@redhat.com> References: <1268143762-4000-1-git-send-email-gleb@redhat.com> <1268143762-4000-5-git-send-email-gleb@redhat.com> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: kvm@vger.kernel.org To: Gleb Natapov Return-path: Received: from mx1.redhat.com ([209.132.183.28]:53041 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753353Ab0CIOYr (ORCPT ); Tue, 9 Mar 2010 09:24:47 -0500 Received: from int-mx05.intmail.prod.int.phx2.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.18]) by mx1.redhat.com (8.13.8/8.13.8) with ESMTP id o29EOk4K021558 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Tue, 9 Mar 2010 09:24:46 -0500 Received: from cleopatra.tlv.redhat.com (cleopatra.tlv.redhat.com [10.35.255.11]) by int-mx05.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id o29EOjp8006816 for ; Tue, 9 Mar 2010 09:24:46 -0500 In-Reply-To: <1268143762-4000-5-git-send-email-gleb@redhat.com> Sender: kvm-owner@vger.kernel.org List-ID: 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. -- error compiling committee.c: too many arguments to function