]> 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)
commit1223559f52bb37bd9fb087a1c4327b7cafc0e11f
treeba19053957d0401791e98443a27d7c2c899ef5e5
parentb3cff1265950ed18bb8f72b8a34344478f415312
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