diff options
Diffstat (limited to 'arch/x86/kvm/mmu.c')
-rw-r--r-- | arch/x86/kvm/mmu.c | 17 |
1 files changed, 11 insertions, 6 deletions
diff --git a/arch/x86/kvm/mmu.c b/arch/x86/kvm/mmu.c index 2d4477c71473..f15023c11fea 100644 --- a/arch/x86/kvm/mmu.c +++ b/arch/x86/kvm/mmu.c | |||
@@ -1204,8 +1204,7 @@ static struct kvm_mmu_page *kvm_mmu_get_page(struct kvm_vcpu *vcpu, | |||
1204 | struct kvm_mmu_page *sp; | 1204 | struct kvm_mmu_page *sp; |
1205 | struct hlist_node *node, *tmp; | 1205 | struct hlist_node *node, *tmp; |
1206 | 1206 | ||
1207 | role.word = 0; | 1207 | role = vcpu->arch.mmu.base_role; |
1208 | role.glevels = vcpu->arch.mmu.root_level; | ||
1209 | role.level = level; | 1208 | role.level = level; |
1210 | role.metaphysical = metaphysical; | 1209 | role.metaphysical = metaphysical; |
1211 | role.access = access; | 1210 | role.access = access; |
@@ -2251,17 +2250,23 @@ static int init_kvm_tdp_mmu(struct kvm_vcpu *vcpu) | |||
2251 | 2250 | ||
2252 | static int init_kvm_softmmu(struct kvm_vcpu *vcpu) | 2251 | static int init_kvm_softmmu(struct kvm_vcpu *vcpu) |
2253 | { | 2252 | { |
2253 | int r; | ||
2254 | |||
2254 | ASSERT(vcpu); | 2255 | ASSERT(vcpu); |
2255 | ASSERT(!VALID_PAGE(vcpu->arch.mmu.root_hpa)); | 2256 | ASSERT(!VALID_PAGE(vcpu->arch.mmu.root_hpa)); |
2256 | 2257 | ||
2257 | if (!is_paging(vcpu)) | 2258 | if (!is_paging(vcpu)) |
2258 | return nonpaging_init_context(vcpu); | 2259 | r = nonpaging_init_context(vcpu); |
2259 | else if (is_long_mode(vcpu)) | 2260 | else if (is_long_mode(vcpu)) |
2260 | return paging64_init_context(vcpu); | 2261 | r = paging64_init_context(vcpu); |
2261 | else if (is_pae(vcpu)) | 2262 | else if (is_pae(vcpu)) |
2262 | return paging32E_init_context(vcpu); | 2263 | r = paging32E_init_context(vcpu); |
2263 | else | 2264 | else |
2264 | return paging32_init_context(vcpu); | 2265 | r = paging32_init_context(vcpu); |
2266 | |||
2267 | vcpu->arch.mmu.base_role.glevels = vcpu->arch.mmu.root_level; | ||
2268 | |||
2269 | return r; | ||
2265 | } | 2270 | } |
2266 | 2271 | ||
2267 | static int init_kvm_mmu(struct kvm_vcpu *vcpu) | 2272 | static int init_kvm_mmu(struct kvm_vcpu *vcpu) |