From mboxrd@z Thu Jan 1 00:00:00 1970 From: Gleb Natapov Subject: Re: [PATCH 4/9] KVM: VMX: Cache cpl Date: Tue, 8 Mar 2011 16:38:28 +0200 Message-ID: <20110308143828.GF2504@redhat.com> References: <1299592665-12325-1-git-send-email-avi@redhat.com> <1299592665-12325-5-git-send-email-avi@redhat.com> <20110308142010.GE2504@redhat.com> <4D763D36.9050202@redhat.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: Marcelo Tosatti , kvm@vger.kernel.org, Jan Kiszka To: Avi Kivity Return-path: Received: from mx1.redhat.com ([209.132.183.28]:19872 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755247Ab1CHOic (ORCPT ); Tue, 8 Mar 2011 09:38:32 -0500 Content-Disposition: inline In-Reply-To: <4D763D36.9050202@redhat.com> Sender: kvm-owner@vger.kernel.org List-ID: On Tue, Mar 08, 2011 at 04:29:10PM +0200, Avi Kivity wrote: > On 03/08/2011 04:20 PM, Gleb Natapov wrote: > >On Tue, Mar 08, 2011 at 03:57:40PM +0200, Avi Kivity wrote: > >> We may read the cpl quite often in the same vmexit (instruction privilege > >> check, memory access checks for instruction and operands), so we gain > >> a bit if we cache the value. > >> > >Shouldn't VCPU_EXREG_CPL be cleared in vmx_set_efer too? > > I anticipated that question (which really means that a comment is > needed). Flipping EFER.LMA is done by flipping CR0.PG (and doesn't > affect cpl. in any case). > Ah, so you can't clear LMA by writing to EFER. -- Gleb.