From: Xiao Guangrong Date: Fri, 4 Jun 2010 13:52:17 +0000 (+0800) Subject: KVM: MMU: skip invalid sp when unprotect page X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=03116aa57e75b1bbe8b5e04f3cd21cdb6588c4ba;p=GitHub%2Fexynos8895%2Fandroid_kernel_samsung_universal8895.git KVM: MMU: skip invalid sp when unprotect page In kvm_mmu_unprotect_page(), the invalid sp can be skipped Signed-off-by: Xiao Guangrong Signed-off-by: Avi Kivity --- diff --git a/arch/x86/kvm/mmu.c b/arch/x86/kvm/mmu.c index d3cd102aee26..3ac51153bc47 100644 --- a/arch/x86/kvm/mmu.c +++ b/arch/x86/kvm/mmu.c @@ -1629,7 +1629,7 @@ static int kvm_mmu_unprotect_page(struct kvm *kvm, gfn_t gfn) bucket = &kvm->arch.mmu_page_hash[index]; restart: hlist_for_each_entry_safe(sp, node, n, bucket, hash_link) - if (sp->gfn == gfn && !sp->role.direct) { + if (sp->gfn == gfn && !sp->role.direct && !sp->role.invalid) { pgprintk("%s: gfn %lx role %x\n", __func__, gfn, sp->role.word); r = 1;