]> git.baikalelectronics.ru Git - kernel.git/commit
KVM: x86/mmu: Avoid mixing gpa_t with gfn_t in walk_addr_generic()
authorVitaly Kuznetsov <vkuznets@redhat.com>
Mon, 22 Jun 2020 15:14:35 +0000 (17:14 +0200)
committerPaolo Bonzini <pbonzini@redhat.com>
Mon, 22 Jun 2020 17:38:30 +0000 (13:38 -0400)
commite751161bea054ed5ff5d0f875e0648c3c8c8bcca
treeba19053957d0401791e98443a27d7c2c899ef5e5
parentd97acc88df7b4aa7933571ea643b038cf05538d8
KVM: x86/mmu: Avoid mixing gpa_t with gfn_t in walk_addr_generic()

translate_gpa() returns a GPA, assigning it to 'real_gfn' seems obviously
wrong. There is no real issue because both 'gpa_t' and 'gfn_t' are u64 and
we don't use the value in 'real_gfn' as a GFN, we do

 real_gfn = gpa_to_gfn(real_gfn);

instead. 'If you see a "buffalo" sign on an elephant's cage, do not trust
your eyes', but let's fix it for good.

No functional change intended.

Signed-off-by: Vitaly Kuznetsov <vkuznets@redhat.com>
Message-Id: <20200622151435.752560-1-vkuznets@redhat.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
arch/x86/kvm/mmu/paging_tmpl.h