aboutsummaryrefslogtreecommitdiffstats
path: root/arch/x86/kvm/mmu.c
diff options
context:
space:
mode:
authorSheng Yang <sheng.yang@intel.com>2008-04-24 22:20:22 -0400
committerAvi Kivity <avi@qumranet.com>2008-05-04 07:44:34 -0400
commit67253af52e9133fb4cfbf7a2448a2d3524d1fa6c (patch)
tree5098624f90989a3844bb1b494658ea400d629b1f /arch/x86/kvm/mmu.c
parent8c6d6adc6b87daa364ee9deb2e966021d37a7622 (diff)
KVM: Add kvm_x86_ops get_tdp_level()
The function get_tdp_level() provided the number of tdp level for EPT and NPT rather than the NPT specific macro. Signed-off-by: Sheng Yang <sheng.yang@intel.com> Signed-off-by: Avi Kivity <avi@qumranet.com>
Diffstat (limited to 'arch/x86/kvm/mmu.c')
-rw-r--r--arch/x86/kvm/mmu.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/arch/x86/kvm/mmu.c b/arch/x86/kvm/mmu.c
index bcfaf7e4a2dc..20fb3c852db7 100644
--- a/arch/x86/kvm/mmu.c
+++ b/arch/x86/kvm/mmu.c
@@ -1343,7 +1343,7 @@ static int tdp_page_fault(struct kvm_vcpu *vcpu, gva_t gpa,
1343 spin_lock(&vcpu->kvm->mmu_lock); 1343 spin_lock(&vcpu->kvm->mmu_lock);
1344 kvm_mmu_free_some_pages(vcpu); 1344 kvm_mmu_free_some_pages(vcpu);
1345 r = __direct_map(vcpu, gpa, error_code & PFERR_WRITE_MASK, 1345 r = __direct_map(vcpu, gpa, error_code & PFERR_WRITE_MASK,
1346 largepage, gfn, pfn, TDP_ROOT_LEVEL); 1346 largepage, gfn, pfn, kvm_x86_ops->get_tdp_level());
1347 spin_unlock(&vcpu->kvm->mmu_lock); 1347 spin_unlock(&vcpu->kvm->mmu_lock);
1348 1348
1349 return r; 1349 return r;
@@ -1450,7 +1450,7 @@ static int init_kvm_tdp_mmu(struct kvm_vcpu *vcpu)
1450 context->page_fault = tdp_page_fault; 1450 context->page_fault = tdp_page_fault;
1451 context->free = nonpaging_free; 1451 context->free = nonpaging_free;
1452 context->prefetch_page = nonpaging_prefetch_page; 1452 context->prefetch_page = nonpaging_prefetch_page;
1453 context->shadow_root_level = TDP_ROOT_LEVEL; 1453 context->shadow_root_level = kvm_x86_ops->get_tdp_level();
1454 context->root_hpa = INVALID_PAGE; 1454 context->root_hpa = INVALID_PAGE;
1455 1455
1456 if (!is_paging(vcpu)) { 1456 if (!is_paging(vcpu)) {