aboutsummaryrefslogtreecommitdiffstats
path: root/arch/x86/kvm/mmu.c
diff options
context:
space:
mode:
Diffstat (limited to 'arch/x86/kvm/mmu.c')
-rw-r--r--arch/x86/kvm/mmu.c15
1 files changed, 15 insertions, 0 deletions
diff --git a/arch/x86/kvm/mmu.c b/arch/x86/kvm/mmu.c
index 6651dfadae50..21cfa289d0fe 100644
--- a/arch/x86/kvm/mmu.c
+++ b/arch/x86/kvm/mmu.c
@@ -32,6 +32,15 @@
32#include <asm/cmpxchg.h> 32#include <asm/cmpxchg.h>
33#include <asm/io.h> 33#include <asm/io.h>
34 34
35/*
36 * When setting this variable to true it enables Two-Dimensional-Paging
37 * where the hardware walks 2 page tables:
38 * 1. the guest-virtual to guest-physical
39 * 2. while doing 1. it walks guest-physical to host-physical
40 * If the hardware supports that we don't need to do shadow paging.
41 */
42static bool tdp_enabled = false;
43
35#undef MMU_DEBUG 44#undef MMU_DEBUG
36 45
37#undef AUDIT 46#undef AUDIT
@@ -1582,6 +1591,12 @@ out:
1582} 1591}
1583EXPORT_SYMBOL_GPL(kvm_mmu_page_fault); 1592EXPORT_SYMBOL_GPL(kvm_mmu_page_fault);
1584 1593
1594void kvm_enable_tdp(void)
1595{
1596 tdp_enabled = true;
1597}
1598EXPORT_SYMBOL_GPL(kvm_enable_tdp);
1599
1585static void free_mmu_pages(struct kvm_vcpu *vcpu) 1600static void free_mmu_pages(struct kvm_vcpu *vcpu)
1586{ 1601{
1587 struct kvm_mmu_page *sp; 1602 struct kvm_mmu_page *sp;