Delete the module parameter tdp_mmu and force KVM to always use the TDP MMU when TDP hardware support is enabled. The TDP MMU was introduced in 5.10 and has been enabled by default since 5.15. At this point there are no known functionality gaps between the TDP MMU and the shadow MMU, and the TDP MMU uses less memory and scales better with the number of vCPUs. In other words, there is no good reason to disable the TDP MMU. Dropping the ability to disable the TDP MMU reduces the number of possible configurations that need to be tested to validate KVM (i.e. no need to test with tdp_mmu=N), and simplifies the code. Signed-off-by: David Matlack <dmatlack@xxxxxxxxxx> --- Documentation/admin-guide/kernel-parameters.txt | 3 ++- arch/x86/kvm/mmu/tdp_mmu.c | 5 +---- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/Documentation/admin-guide/kernel-parameters.txt b/Documentation/admin-guide/kernel-parameters.txt index f7561cd494cb..e75d45a42b01 100644 --- a/Documentation/admin-guide/kernel-parameters.txt +++ b/Documentation/admin-guide/kernel-parameters.txt @@ -2418,7 +2418,8 @@ the KVM_CLEAR_DIRTY ioctl, and only for the pages being cleared. - Eager page splitting is only supported when kvm.tdp_mmu=Y. + Eager page splitting is only supported when TDP hardware + support is enabled. Default is Y (on). diff --git a/arch/x86/kvm/mmu/tdp_mmu.c b/arch/x86/kvm/mmu/tdp_mmu.c index bf2ccf9debca..d6c30a648d8d 100644 --- a/arch/x86/kvm/mmu/tdp_mmu.c +++ b/arch/x86/kvm/mmu/tdp_mmu.c @@ -10,15 +10,12 @@ #include <asm/cmpxchg.h> #include <trace/events/kvm.h> -static bool __read_mostly tdp_mmu_enabled = true; -module_param_named(tdp_mmu, tdp_mmu_enabled, bool, 0644); - /* Initializes the TDP MMU for the VM, if enabled. */ int kvm_mmu_init_tdp_mmu(struct kvm *kvm) { struct workqueue_struct *wq; - if (!tdp_enabled || !READ_ONCE(tdp_mmu_enabled)) + if (!tdp_enabled) return 0; wq = alloc_workqueue("kvm", WQ_UNBOUND|WQ_MEM_RECLAIM|WQ_CPU_INTENSIVE, 0); base-commit: 93472b79715378a2386598d6632c654a2223267b prerequisite-patch-id: 8c230105c8a2f1245dedb5b386327d98865d0bb2 prerequisite-patch-id: 9b4329037e2e880db19f3221e47d956b78acadc8 prerequisite-patch-id: 2e3661ba8856c29b769499bac525b6943d9284b8 -- 2.37.1.595.g718a3a8f04-goog