]> git.hungrycats.org Git - linux/commit
KVM: x86/mmu: Move TDP MMU VM init/uninit behind tdp_mmu_enabled
authorDavid Matlack <dmatlack@google.com>
Wed, 21 Sep 2022 17:35:38 +0000 (10:35 -0700)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 17 May 2023 11:58:54 +0000 (13:58 +0200)
commit60726cf2e56e4123e1dd92ad15ec4082a0dbfa28
tree03377d28775cc7c11e11db252f7fd3cc68d17d61
parent8c335aadeebd3eb1fbb5b95628baaa054fbaa9bc
KVM: x86/mmu: Move TDP MMU VM init/uninit behind tdp_mmu_enabled

[ Upstream commit 991c8047b740f192a057d5f22df2f91f087cdb72 ]

Move kvm_mmu_{init,uninit}_tdp_mmu() behind tdp_mmu_enabled. This makes
these functions consistent with the rest of the calls into the TDP MMU
from mmu.c, and which is now possible since tdp_mmu_enabled is only
modified when the x86 vendor module is loaded. i.e. It will never change
during the lifetime of a VM.

This change also enabled removing the stub definitions for 32-bit KVM,
as the compiler will just optimize the calls out like it does for all
the other TDP MMU functions.

No functional change intended.

Signed-off-by: David Matlack <dmatlack@google.com>
Reviewed-by: Isaku Yamahata <isaku.yamahata@intel.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Message-Id: <20220921173546.2674386-3-dmatlack@google.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Stable-dep-of: edbdb43fc96b ("KVM: x86: Preserve TDP MMU roots until they are explicitly invalidated")
Signed-off-by: Sasha Levin <sashal@kernel.org>
arch/x86/kvm/mmu/mmu.c
arch/x86/kvm/mmu/tdp_mmu.c
arch/x86/kvm/mmu/tdp_mmu.h