diff options
-rw-r--r-- | arch/x86/kvm/mmu.c | 6 | ||||
-rw-r--r-- | arch/x86/kvm/svm.c | 3 | ||||
-rw-r--r-- | include/asm-x86/kvm_host.h | 1 |
3 files changed, 9 insertions, 1 deletions
diff --git a/arch/x86/kvm/mmu.c b/arch/x86/kvm/mmu.c index b0e4ddca6c18..d087d9c4f2d9 100644 --- a/arch/x86/kvm/mmu.c +++ b/arch/x86/kvm/mmu.c | |||
@@ -1870,6 +1870,12 @@ void kvm_enable_tdp(void) | |||
1870 | } | 1870 | } |
1871 | EXPORT_SYMBOL_GPL(kvm_enable_tdp); | 1871 | EXPORT_SYMBOL_GPL(kvm_enable_tdp); |
1872 | 1872 | ||
1873 | void kvm_disable_tdp(void) | ||
1874 | { | ||
1875 | tdp_enabled = false; | ||
1876 | } | ||
1877 | EXPORT_SYMBOL_GPL(kvm_disable_tdp); | ||
1878 | |||
1873 | static void free_mmu_pages(struct kvm_vcpu *vcpu) | 1879 | static void free_mmu_pages(struct kvm_vcpu *vcpu) |
1874 | { | 1880 | { |
1875 | struct kvm_mmu_page *sp; | 1881 | struct kvm_mmu_page *sp; |
diff --git a/arch/x86/kvm/svm.c b/arch/x86/kvm/svm.c index b756e876dce3..951b789cc913 100644 --- a/arch/x86/kvm/svm.c +++ b/arch/x86/kvm/svm.c | |||
@@ -453,7 +453,8 @@ static __init int svm_hardware_setup(void) | |||
453 | if (npt_enabled) { | 453 | if (npt_enabled) { |
454 | printk(KERN_INFO "kvm: Nested Paging enabled\n"); | 454 | printk(KERN_INFO "kvm: Nested Paging enabled\n"); |
455 | kvm_enable_tdp(); | 455 | kvm_enable_tdp(); |
456 | } | 456 | } else |
457 | kvm_disable_tdp(); | ||
457 | 458 | ||
458 | return 0; | 459 | return 0; |
459 | 460 | ||
diff --git a/include/asm-x86/kvm_host.h b/include/asm-x86/kvm_host.h index fdde0bedaa90..bc34dc21f178 100644 --- a/include/asm-x86/kvm_host.h +++ b/include/asm-x86/kvm_host.h | |||
@@ -556,6 +556,7 @@ int kvm_fix_hypercall(struct kvm_vcpu *vcpu); | |||
556 | int kvm_mmu_page_fault(struct kvm_vcpu *vcpu, gva_t gva, u32 error_code); | 556 | int kvm_mmu_page_fault(struct kvm_vcpu *vcpu, gva_t gva, u32 error_code); |
557 | 557 | ||
558 | void kvm_enable_tdp(void); | 558 | void kvm_enable_tdp(void); |
559 | void kvm_disable_tdp(void); | ||
559 | 560 | ||
560 | int load_pdptrs(struct kvm_vcpu *vcpu, unsigned long cr3); | 561 | int load_pdptrs(struct kvm_vcpu *vcpu, unsigned long cr3); |
561 | int complete_pio(struct kvm_vcpu *vcpu); | 562 | int complete_pio(struct kvm_vcpu *vcpu); |