1 // SPDX-License-Identifier: GPL-2.0
5 static bool __read_mostly tdp_mmu_enabled = false;
7 static bool is_tdp_mmu_enabled(void)
10 return tdp_enabled && READ_ONCE(tdp_mmu_enabled);
13 #endif /* CONFIG_X86_64 */
16 /* Initializes the TDP MMU for the VM, if enabled. */
17 void kvm_mmu_init_tdp_mmu(struct kvm *kvm)
19 if (!is_tdp_mmu_enabled())
22 /* This should not be changed for the lifetime of the VM. */
23 kvm->arch.tdp_mmu_enabled = true;
26 void kvm_mmu_uninit_tdp_mmu(struct kvm *kvm)
28 if (!kvm->arch.tdp_mmu_enabled)