Commit 1fe859b8 authored by Yu Zhang's avatar Yu Zhang
Browse files

KVM: x86/mmu: Make KVM parameter tdp_mmu writeable

Intel inclusion
category: feature
bugzilla: https://gitee.com/openeuler/intel-kernel/issues/I9HH9U


CVE: NA

----------------------------------------------------------------------

As discussed earlier in openEuler virt-sig meeting, we wanna keep
tdp_mmu disabled as default configuration, and meanwhile let user
be able to enable it. So just make KVM parameter tdp_mmu writeable.

Note: after backporting upstream commit edbdb43f ("KVM: x86:
Preserve TDP MMU roots until they are explicitly invalidated") and
commit 01b31714 ("KVM: x86: Do not unload MMU roots when only
toggling CR0.WP with TDP enabled"), chances of KVM MMU to rebuild
whole TDP page table are drastically reduced. And KVM TDP MMU is
enabled by default in upstreaming KVM code. The reason we do not
enable TDP MMU is not because we have any known bugs, just because
we wanna leave the choice to the user(e.g., to enable TDP MMU on
platforms which run VMs wich large memory and vCPU number, while
keep using legacy MMU on platforms for relatively small VMs).

Signed-off-by: default avatarYu Zhang <yu.c.zhang@linux.intel.com>
parent 76896465
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -105,7 +105,7 @@ static bool __ro_after_init tdp_mmu_allowed;

#ifdef CONFIG_X86_64
bool __read_mostly tdp_mmu_enabled = false;
module_param_named(tdp_mmu, tdp_mmu_enabled, bool, 0444);
module_param_named(tdp_mmu, tdp_mmu_enabled, bool, 0644);
#endif

static int max_huge_page_level __read_mostly;