]> git.baikalelectronics.ru Git - kernel.git/commit
KVM: x86/mmu: Decompose kvm_mmu_get_page() into separate functions
authorDavid Matlack <dmatlack@google.com>
Wed, 22 Jun 2022 19:26:53 +0000 (15:26 -0400)
committerPaolo Bonzini <pbonzini@redhat.com>
Fri, 24 Jun 2022 08:51:54 +0000 (04:51 -0400)
commit6a8a9c5619f486b72ba0e652eb6d25e1cadf8255
tree2c95f32435fd0e854d518fe6851855b4e113c645
parenta1d08be5816cd3b6cb50041e5ac74e582b5bdca0
KVM: x86/mmu: Decompose kvm_mmu_get_page() into separate functions

Decompose kvm_mmu_get_page() into separate helper functions to increase
readability and prepare for allocating shadow pages without a vcpu
pointer.

Specifically, pull the guts of kvm_mmu_get_page() into 2 helper
functions:

kvm_mmu_find_shadow_page() -
  Walks the page hash checking for any existing mmu pages that match the
  given gfn and role.

kvm_mmu_alloc_shadow_page()
  Allocates and initializes an entirely new kvm_mmu_page. This currently
  requries a vcpu pointer for allocation and looking up the memslot but
  that will be removed in a future commit.

No functional change intended.

Reviewed-by: Sean Christopherson <seanjc@google.com>
Signed-off-by: David Matlack <dmatlack@google.com>
Message-Id: <20220516232138.1783324-7-dmatlack@google.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
arch/x86/kvm/mmu/mmu.c