]> git.baikalelectronics.ru Git - kernel.git/commit
KVM: x86/mmu: Pass memory caches to allocate SPs separately
authorDavid Matlack <dmatlack@google.com>
Wed, 22 Jun 2022 19:26:57 +0000 (15:26 -0400)
committerPaolo Bonzini <pbonzini@redhat.com>
Fri, 24 Jun 2022 08:51:56 +0000 (04:51 -0400)
commit1a0a479a213f2cadfb12dac9e46cffd9047ad208
treede2b6a55eee4081e0f48dd8e88ef8a2750afc1c5
parent950158c0e1234bc6a3b47f20e2b0ed22561cb2b1
KVM: x86/mmu: Pass memory caches to allocate SPs separately

Refactor kvm_mmu_alloc_shadow_page() to receive the caches from which it
will allocate the various pieces of memory for shadow pages as a
parameter, rather than deriving them from the vcpu pointer. This will be
useful in a future commit where shadow pages are allocated during VM
ioctls for eager page splitting, and thus will use a different set of
caches.

Preemptively pull the caches out all the way to
kvm_mmu_get_shadow_page() since eager page splitting will not be calling
kvm_mmu_alloc_shadow_page() directly.

No functional change intended.

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