From mboxrd@z Thu Jan 1 00:00:00 1970 From: Joerg Roedel Subject: Re: [PATCH 3/3] KVM: Cache pdptrs Date: Tue, 2 Jun 2009 11:04:28 +0200 Message-ID: <20090602090428.GN4062@amd.com> References: <1243862524-22120-1-git-send-email-avi@redhat.com> <1243862524-22120-4-git-send-email-avi@redhat.com> Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: QUOTED-PRINTABLE Cc: kvm@vger.kernel.org, Marcelo Tosatti , Sheng Yang To: Avi Kivity Return-path: Received: from outbound-dub.frontbridge.com ([213.199.154.16]:4565 "EHLO IE1EHSOBE005.bigfish.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751440AbZFBJEo convert rfc822-to-8bit (ORCPT ); Tue, 2 Jun 2009 05:04:44 -0400 Content-Disposition: inline In-Reply-To: <1243862524-22120-4-git-send-email-avi@redhat.com> Sender: kvm-owner@vger.kernel.org List-ID: On Mon, Jun 01, 2009 at 04:22:03PM +0300, Avi Kivity wrote: > +static void svm_cache_reg(struct kvm_vcpu *vcpu, enum kvm_reg reg) > +{ > + switch (reg) { > + case VCPU_EXREG_PDPTR: > + BUG_ON(!npt_enabled); > + load_pdptrs(vcpu, vcpu->arch.cr3); > + break; > + default: > + BUG(); > + } > +} Don't we need to check for the return value of load_pdptrs() here and i= nject a #GP it it fails? > + > static void svm_set_vintr(struct vcpu_svm *svm) > { > svm->vmcb->control.intercept |=3D 1ULL << INTERCEPT_VINTR; > @@ -2286,12 +2298,6 @@ static int handle_exit(struct kvm_run *kvm_run= , struct kvm_vcpu *vcpu) > } > vcpu->arch.cr0 =3D svm->vmcb->save.cr0; > vcpu->arch.cr3 =3D svm->vmcb->save.cr3; > - if (is_paging(vcpu) && is_pae(vcpu) && !is_long_mode(vcpu)) { > - if (!load_pdptrs(vcpu, vcpu->arch.cr3)) { > - kvm_inject_gp(vcpu, 0); > - return 1; > - } > - } =2E.. as done here. Joerg --=20 | Advanced Micro Devices GmbH Operating | Karl-Hammerschmidt-Str. 34, 85609 Dornach bei M=FCnchen System |=20 Research | Gesch=E4ftsf=FChrer: Thomas M. McCoy, Giuliano Meroni Center | Sitz: Dornach, Gemeinde Aschheim, Landkreis M=FCnchen | Registergericht M=FCnchen, HRB Nr. 43632