aboutsummaryrefslogtreecommitdiffstats
path: root/arch/x86
diff options
context:
space:
mode:
Diffstat (limited to 'arch/x86')
-rw-r--r--arch/x86/kvm/mmu.c12
1 files changed, 8 insertions, 4 deletions
diff --git a/arch/x86/kvm/mmu.c b/arch/x86/kvm/mmu.c
index ddfa8658fb6d..9696d654b01f 100644
--- a/arch/x86/kvm/mmu.c
+++ b/arch/x86/kvm/mmu.c
@@ -2059,10 +2059,12 @@ static int mmu_alloc_roots(struct kvm_vcpu *vcpu)
2059 hpa_t root = vcpu->arch.mmu.root_hpa; 2059 hpa_t root = vcpu->arch.mmu.root_hpa;
2060 2060
2061 ASSERT(!VALID_PAGE(root)); 2061 ASSERT(!VALID_PAGE(root));
2062 if (tdp_enabled)
2063 direct = 1;
2064 if (mmu_check_root(vcpu, root_gfn)) 2062 if (mmu_check_root(vcpu, root_gfn))
2065 return 1; 2063 return 1;
2064 if (tdp_enabled) {
2065 direct = 1;
2066 root_gfn = 0;
2067 }
2066 sp = kvm_mmu_get_page(vcpu, root_gfn, 0, 2068 sp = kvm_mmu_get_page(vcpu, root_gfn, 0,
2067 PT64_ROOT_LEVEL, direct, 2069 PT64_ROOT_LEVEL, direct,
2068 ACC_ALL, NULL); 2070 ACC_ALL, NULL);
@@ -2072,8 +2074,6 @@ static int mmu_alloc_roots(struct kvm_vcpu *vcpu)
2072 return 0; 2074 return 0;
2073 } 2075 }
2074 direct = !is_paging(vcpu); 2076 direct = !is_paging(vcpu);
2075 if (tdp_enabled)
2076 direct = 1;
2077 for (i = 0; i < 4; ++i) { 2077 for (i = 0; i < 4; ++i) {
2078 hpa_t root = vcpu->arch.mmu.pae_root[i]; 2078 hpa_t root = vcpu->arch.mmu.pae_root[i];
2079 2079
@@ -2089,6 +2089,10 @@ static int mmu_alloc_roots(struct kvm_vcpu *vcpu)
2089 root_gfn = 0; 2089 root_gfn = 0;
2090 if (mmu_check_root(vcpu, root_gfn)) 2090 if (mmu_check_root(vcpu, root_gfn))
2091 return 1; 2091 return 1;
2092 if (tdp_enabled) {
2093 direct = 1;
2094 root_gfn = i << 30;
2095 }
2092 sp = kvm_mmu_get_page(vcpu, root_gfn, i << 30, 2096 sp = kvm_mmu_get_page(vcpu, root_gfn, i << 30,
2093 PT32_ROOT_LEVEL, direct, 2097 PT32_ROOT_LEVEL, direct,
2094 ACC_ALL, NULL); 2098 ACC_ALL, NULL);