KVM: x86: make FNAME(fetch) and __direct_map more similar
authorPaolo Bonzini <pbonzini@redhat.com>
Mon, 24 Jun 2019 11:06:21 +0000 (13:06 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 12 Nov 2019 18:21:41 +0000 (19:21 +0100)
commite79234ce5765dd9ce329746cea88cc5b903b1254
treeec3fb935f0651cd71492ca944533332cb5f89847
parent8aaac30686233108e8a8648f95dd4ec0e0123389
KVM: x86: make FNAME(fetch) and __direct_map more similar

commit 3fcf2d1bdeb6a513523cb2c77012a6b047aa859c upstream.

These two functions are basically doing the same thing through
kvm_mmu_get_page, link_shadow_page and mmu_set_spte; yet, for historical
reasons, their code looks very different.  This patch tries to take the
best of each and make them very similar, so that it is easy to understand
changes that apply to both of them.

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
arch/x86/kvm/mmu.c
arch/x86/kvm/paging_tmpl.h