]> git.baikalelectronics.ru Git - kernel.git/commit
KVM: x86/mmu: Skip rmap operations if rmaps not allocated
authorBen Gardon <bgardon@google.com>
Tue, 18 May 2021 17:34:13 +0000 (10:34 -0700)
committerPaolo Bonzini <pbonzini@redhat.com>
Thu, 17 Jun 2021 17:09:26 +0000 (13:09 -0400)
commit08763ffdb3a232c11502906962a87c5b1b65031a
treef198fad36374a91f85df2e836f1f30c1b226e1fe
parentd54c9b6875c54178d2b064f59222510cd4a05128
KVM: x86/mmu: Skip rmap operations if rmaps not allocated

If only the TDP MMU is being used to manage the memory mappings for a VM,
then many rmap operations can be skipped as they are guaranteed to be
no-ops. This saves some time which would be spent on the rmap operation.
It also avoids acquiring the MMU lock in write mode for many operations.

This makes it safe to run the VM without rmaps allocated, when only
using the TDP MMU and sets the stage for waiting to allocate the rmaps
until they're needed.

Signed-off-by: Ben Gardon <bgardon@google.com>
Message-Id: <20210518173414.450044-7-bgardon@google.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
arch/x86/kvm/mmu.h
arch/x86/kvm/mmu/mmu.c
arch/x86/kvm/x86.c