From: David Matlack <dmatlack@google.com>
To: Paolo Bonzini <pbonzini@redhat.com>
Cc: Sean Christopherson <seanjc@google.com>,
Borislav Petkov <bp@suse.de>,
"Paul E. McKenney" <paulmck@kernel.org>,
Kees Cook <keescook@chromium.org>,
Peter Zijlstra <peterz@infradead.org>,
Andrew Morton <akpm@linux-foundation.org>,
Randy Dunlap <rdunlap@infradead.org>,
Damien Le Moal <damien.lemoal@opensource.wdc.com>,
kvm@vger.kernel.org, David Matlack <dmatlack@google.com>
Subject: [PATCH 1/9] KVM: x86/mmu: Always enable the TDP MMU when TDP is enabled
Date: Mon, 15 Aug 2022 16:01:02 -0700 [thread overview]
Message-ID: <20220815230110.2266741-2-dmatlack@google.com> (raw)
In-Reply-To: <20220815230110.2266741-1-dmatlack@google.com>
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@google.com>
---
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
next prev parent reply other threads:[~2022-08-16 2:39 UTC|newest]
Thread overview: 24+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-08-15 23:01 [PATCH 0/9] KVM: x86/mmu: Always enable the TDP MMU when TDP is enabled David Matlack
2022-08-15 23:01 ` David Matlack [this message]
2022-08-17 10:05 ` [PATCH 1/9] " Paolo Bonzini
2022-08-17 16:49 ` David Matlack
2022-08-17 16:53 ` Paolo Bonzini
2022-08-17 17:46 ` David Matlack
2022-08-15 23:01 ` [PATCH 2/9] KVM: x86/mmu: Drop kvm->arch.tdp_mmu_enabled David Matlack
2022-08-24 14:21 ` kernel test robot
2022-08-15 23:01 ` [PATCH 3/9] KVM: x86/mmu: Consolidate mmu_seq calculations in kvm_faultin_pfn() David Matlack
2022-08-15 23:01 ` [PATCH 4/9] KVM: x86/mmu: Rename __direct_map() to nonpaging_map() David Matlack
2022-08-15 23:01 ` [PATCH 5/9] KVM: x86/mmu: Separate TDP and non-paging fault handling David Matlack
2022-08-24 17:06 ` kernel test robot
2022-08-15 23:01 ` [PATCH 6/9] KVM: x86/mmu: Stop needlessly making MMU pages available for TDP MMU faults David Matlack
2022-08-15 23:01 ` [PATCH 7/9] KVM: x86/mmu: Handle "error PFNs" in kvm_faultin_pfn() David Matlack
2022-08-15 23:01 ` [PATCH 8/9] KVM: x86/mmu: Avoid memslot lookup during KVM_PFN_ERR_HWPOISON handling David Matlack
2022-08-15 23:01 ` [PATCH 9/9] KVM: x86/mmu: Try to handle no-slot faults during kvm_faultin_pfn() David Matlack
2022-08-15 23:09 ` David Matlack
2022-08-16 8:16 ` [PATCH 0/9] KVM: x86/mmu: Always enable the TDP MMU when TDP is enabled Peter Zijlstra
2022-08-16 16:30 ` David Matlack
2022-08-17 8:53 ` Peter Zijlstra
2022-08-17 10:01 ` Huang, Kai
2022-08-17 16:42 ` David Matlack
2022-08-17 23:36 ` Huang, Kai
2022-08-16 22:54 ` David Matlack
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20220815230110.2266741-2-dmatlack@google.com \
--to=dmatlack@google.com \
--cc=akpm@linux-foundation.org \
--cc=bp@suse.de \
--cc=damien.lemoal@opensource.wdc.com \
--cc=keescook@chromium.org \
--cc=kvm@vger.kernel.org \
--cc=paulmck@kernel.org \
--cc=pbonzini@redhat.com \
--cc=peterz@infradead.org \
--cc=rdunlap@infradead.org \
--cc=seanjc@google.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox