diff options
Diffstat (limited to 'arch/x86/kvm/paging_tmpl.h')
| -rw-r--r-- | arch/x86/kvm/paging_tmpl.h | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/arch/x86/kvm/paging_tmpl.h b/arch/x86/kvm/paging_tmpl.h index ad75d77999d0..cba218a2f08d 100644 --- a/arch/x86/kvm/paging_tmpl.h +++ b/arch/x86/kvm/paging_tmpl.h | |||
| @@ -569,6 +569,9 @@ static int FNAME(fetch)(struct kvm_vcpu *vcpu, gva_t addr, | |||
| 569 | if (FNAME(gpte_changed)(vcpu, gw, top_level)) | 569 | if (FNAME(gpte_changed)(vcpu, gw, top_level)) |
| 570 | goto out_gpte_changed; | 570 | goto out_gpte_changed; |
| 571 | 571 | ||
| 572 | if (!VALID_PAGE(vcpu->arch.mmu.root_hpa)) | ||
| 573 | goto out_gpte_changed; | ||
| 574 | |||
| 572 | for (shadow_walk_init(&it, vcpu, addr); | 575 | for (shadow_walk_init(&it, vcpu, addr); |
| 573 | shadow_walk_okay(&it) && it.level > gw->level; | 576 | shadow_walk_okay(&it) && it.level > gw->level; |
| 574 | shadow_walk_next(&it)) { | 577 | shadow_walk_next(&it)) { |
| @@ -820,6 +823,11 @@ static void FNAME(invlpg)(struct kvm_vcpu *vcpu, gva_t gva) | |||
| 820 | */ | 823 | */ |
| 821 | mmu_topup_memory_caches(vcpu); | 824 | mmu_topup_memory_caches(vcpu); |
| 822 | 825 | ||
| 826 | if (!VALID_PAGE(vcpu->arch.mmu.root_hpa)) { | ||
| 827 | WARN_ON(1); | ||
| 828 | return; | ||
| 829 | } | ||
| 830 | |||
| 823 | spin_lock(&vcpu->kvm->mmu_lock); | 831 | spin_lock(&vcpu->kvm->mmu_lock); |
| 824 | for_each_shadow_entry(vcpu, gva, iterator) { | 832 | for_each_shadow_entry(vcpu, gva, iterator) { |
| 825 | level = iterator.level; | 833 | level = iterator.level; |
