diff options
Diffstat (limited to 'arch/x86/kvm/mmu.c')
-rw-r--r-- | arch/x86/kvm/mmu.c | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/arch/x86/kvm/mmu.c b/arch/x86/kvm/mmu.c index fd5579cc8abd..4c2585cab189 100644 --- a/arch/x86/kvm/mmu.c +++ b/arch/x86/kvm/mmu.c | |||
@@ -3260,20 +3260,28 @@ static void audit_write_protection(struct kvm_vcpu *vcpu) | |||
3260 | struct kvm_mmu_page *sp; | 3260 | struct kvm_mmu_page *sp; |
3261 | struct kvm_memory_slot *slot; | 3261 | struct kvm_memory_slot *slot; |
3262 | unsigned long *rmapp; | 3262 | unsigned long *rmapp; |
3263 | u64 *spte; | ||
3263 | gfn_t gfn; | 3264 | gfn_t gfn; |
3264 | 3265 | ||
3265 | list_for_each_entry(sp, &vcpu->kvm->arch.active_mmu_pages, link) { | 3266 | list_for_each_entry(sp, &vcpu->kvm->arch.active_mmu_pages, link) { |
3266 | if (sp->role.direct) | 3267 | if (sp->role.direct) |
3267 | continue; | 3268 | continue; |
3269 | if (sp->unsync) | ||
3270 | continue; | ||
3268 | 3271 | ||
3269 | gfn = unalias_gfn(vcpu->kvm, sp->gfn); | 3272 | gfn = unalias_gfn(vcpu->kvm, sp->gfn); |
3270 | slot = gfn_to_memslot_unaliased(vcpu->kvm, sp->gfn); | 3273 | slot = gfn_to_memslot_unaliased(vcpu->kvm, sp->gfn); |
3271 | rmapp = &slot->rmap[gfn - slot->base_gfn]; | 3274 | rmapp = &slot->rmap[gfn - slot->base_gfn]; |
3272 | if (*rmapp) | 3275 | |
3273 | printk(KERN_ERR "%s: (%s) shadow page has writable" | 3276 | spte = rmap_next(vcpu->kvm, rmapp, NULL); |
3274 | " mappings: gfn %lx role %x\n", | 3277 | while (spte) { |
3278 | if (*spte & PT_WRITABLE_MASK) | ||
3279 | printk(KERN_ERR "%s: (%s) shadow page has " | ||
3280 | "writable mappings: gfn %lx role %x\n", | ||
3275 | __func__, audit_msg, sp->gfn, | 3281 | __func__, audit_msg, sp->gfn, |
3276 | sp->role.word); | 3282 | sp->role.word); |
3283 | spte = rmap_next(vcpu->kvm, rmapp, spte); | ||
3284 | } | ||
3277 | } | 3285 | } |
3278 | } | 3286 | } |
3279 | 3287 | ||