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, 10 Nov 2011 12:31:48 +0200 Message-ID: <4EBBA814.9060606@redhat.com> References: <1320919040-nyh@il.ibm.com> <201111100958.pAA9wrIv019614@rice.haifa.ibm.com> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Cc: kvm@vger.kernel.org, "Roedel, Joerg" , owasserm@redhat.com, abelg@il.ibm.com To: "Nadav Har'El" Return-path: Received: from mx1.redhat.com ([209.132.183.28]:20565 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751277Ab1KJKbz (ORCPT ); Thu, 10 Nov 2011 05:31:55 -0500 In-Reply-To: <201111100958.pAA9wrIv019614@rice.haifa.ibm.com> Sender: kvm-owner@vger.kernel.org List-ID: On 11/10/2011 11:58 AM, Nadav Har'El wrote: > KVM's existing shadow MMU code already supports nested TDP. To use it, we > need to set up a new "MMU context" for nested EPT, and create a few callbacks > for it (nested_ept_*()). We then need to switch back and forth between this > nested context and the regular MMU context when switching between L1 and L2. > > + > +static void nested_ept_inject_page_fault(struct kvm_vcpu *vcpu, > + struct x86_exception *fault) > +{ > + struct vmcs12 *vmcs12; > + nested_vmx_vmexit(vcpu); > + vmcs12 = get_vmcs12(vcpu); > + /* > + * Note no need to set vmcs12->vm_exit_reason as it is already copied > + * from vmcs02 in nested_vmx_vmexit() above, i.e., EPT_VIOLATION. > + */ Not in all cases. For example, L0 may emulate an L2 instruction, which then faults at the EPT level. > + vmcs12->exit_qualification = fault->error_code; > + vmcs12->guest_physical_address = fault->address; > +} What about the guest linear address field? -- error compiling committee.c: too many arguments to function