From mboxrd@z Thu Jan 1 00:00:00 1970 From: Paolo Bonzini Subject: Re: [PATCH] kvm: x86: fix comment about {mmu,nested_mmu}.gva_to_gpa Date: Thu, 7 Jan 2016 11:04:02 +0100 Message-ID: <568E3812.6020804@redhat.com> References: <1451492777-7454-1-git-send-email-dmatlack@google.com> Mime-Version: 1.0 Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit To: David Matlack , kvm@vger.kernel.org Return-path: Received: from mail-wm0-f43.google.com ([74.125.82.43]:37676 "EHLO mail-wm0-f43.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753120AbcAGKEJ (ORCPT ); Thu, 7 Jan 2016 05:04:09 -0500 Received: by mail-wm0-f43.google.com with SMTP id f206so114850024wmf.0 for ; Thu, 07 Jan 2016 02:04:09 -0800 (PST) In-Reply-To: <1451492777-7454-1-git-send-email-dmatlack@google.com> Sender: kvm-owner@vger.kernel.org List-ID: On 30/12/2015 17:26, David Matlack wrote: > The comment had the meaning of mmu.gva_to_gpa and nested_mmu.gva_to_gpa > swapped. Fix that, and also add some details describing how each translation > works. > > Signed-off-by: David Matlack > --- > arch/x86/kvm/mmu.c | 10 ++++++---- > 1 file changed, 6 insertions(+), 4 deletions(-) > > diff --git a/arch/x86/kvm/mmu.c b/arch/x86/kvm/mmu.c > index e7c2c14..098a9c2 100644 > --- a/arch/x86/kvm/mmu.c > +++ b/arch/x86/kvm/mmu.c > @@ -4058,10 +4058,12 @@ static void init_kvm_nested_mmu(struct kvm_vcpu *vcpu) > g_context->inject_page_fault = kvm_inject_page_fault; > > /* > - * Note that arch.mmu.gva_to_gpa translates l2_gva to l1_gpa. The > - * translation of l2_gpa to l1_gpa addresses is done using the > - * arch.nested_mmu.gva_to_gpa function. Basically the gva_to_gpa > - * functions between mmu and nested_mmu are swapped. > + * Note that arch.mmu.gva_to_gpa translates l2_gpa to l1_gpa using > + * L1's nested page tables (e.g. EPT12). The nested translation > + * of l2_gva to l1_gpa is done by arch.nested_mmu.gva_to_gpa using > + * L2's page tables as the first level of translation and L1's > + * nested page tables as the second level of translation. Basically > + * the gva_to_gpa functions between mmu and nested_mmu are swapped. > */ > if (!is_paging(vcpu)) { > g_context->nx = false; > Applied, thanks. Paolo