From mboxrd@z Thu Jan 1 00:00:00 1970 From: Avi Kivity Subject: Re: [PATCH 02/10] nEPT: MMU context for nested EPT Date: Thu, 24 Nov 2011 15:36:51 +0200 Message-ID: <4ECE4873.1000300@redhat.com> References: <1320919040-nyh@il.ibm.com> <201111100958.pAA9wrIv019614@rice.haifa.ibm.com> <4EBBC848.7050400@redhat.com> <20111110144027.GB3327@fermat.math.technion.ac.il> <4EBBEB65.8050600@redhat.com> <20111110200532.GA17475@fermat.math.technion.ac.il> <4EBE4CE0.7070708@redhat.com> <20111112213747.GA741@fermat.math.technion.ac.il> <4EBFAA47.406@redhat.com> <20111123150623.GA2566@fermat.math.technion.ac.il> <20111123154410.GB2566@fermat.math.technion.ac.il> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Cc: Orit Wasserman , kvm@vger.kernel.org, "Roedel, Joerg" , abelg@il.ibm.com To: "Nadav Har'El" Return-path: Received: from mx1.redhat.com ([209.132.183.28]:23698 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754686Ab1KXNhE (ORCPT ); Thu, 24 Nov 2011 08:37:04 -0500 In-Reply-To: <20111123154410.GB2566@fermat.math.technion.ac.il> Sender: kvm-owner@vger.kernel.org List-ID: On 11/23/2011 05:44 PM, Nadav Har'El wrote: > On Wed, Nov 23, 2011, Nadav Har'El wrote about "Re: [PATCH 02/10] nEPT: MMU context for nested EPT": > > > +static int nested_ept_init_mmu_context(struct kvm_vcpu *vcpu) > > > +{ > > > + int r = kvm_init_shadow_mmu(vcpu, &vcpu->arch.mmu); > > > + > > > + vcpu->arch.nested_mmu.gva_to_gpa = EPT_gva_to_gpa_nested; > > > + > > > + return r; > > > +} > >.. > > I didn't see you actually call this function anywhere - how is it > > supposed to work? > >.. > > It seems we need a fifth case in that function. > >.. > > On second thought, why is this modifying nested_mmu.gva_to_gpa, and not > mmu.gva_to_gpa? Isn't the nested_mmu the L2 CR3, which is *not* in EPT > format, and what we really want to change is the outer mmu, which is > EPT12 and is indeed in EPT format? > Or am I missing something? I think you're right. The key is to look at what ->walk_mmu points at. -- error compiling committee.c: too many arguments to function