]> git.karo-electronics.de Git - linux-beck.git/commitdiff
kvm: x86: fix comment about {mmu,nested_mmu}.gva_to_gpa
authorDavid Matlack <dmatlack@google.com>
Wed, 30 Dec 2015 16:26:17 +0000 (08:26 -0800)
committerPaolo Bonzini <pbonzini@redhat.com>
Thu, 7 Jan 2016 10:03:47 +0000 (11:03 +0100)
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 <dmatlack@google.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
arch/x86/kvm/mmu.c

index 7f5a82bb61e99f144d0eb2adab7a51a7774d2e7b..420a5ca3c0ee445d83f8b155726806fbe90f0810 100644 (file)
@@ -4024,10 +4024,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;