[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <1319440880-2610-1-git-send-email-cronozhj@gmail.com>
Date: Mon, 24 Oct 2011 15:21:18 +0800
From: Zhao Jin <cronozhj@...il.com>
To: avi@...hat.com, mtosatti@...hat.com
Cc: linux-kernel@...r.kernel.org, kvm@...r.kernel.org
Subject: [PATCH] KVM: MMU: initialize sptes early
Otherwise, the following kvm_sync_pages() will see invalid sptes in a new
shadow page.
Signed-off-by: Zhao Jin <cronozhj@...il.com>
---
arch/x86/kvm/mmu.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/arch/x86/kvm/mmu.c b/arch/x86/kvm/mmu.c
index 8e8da79..d7e1694 100644
--- a/arch/x86/kvm/mmu.c
+++ b/arch/x86/kvm/mmu.c
@@ -1692,6 +1692,7 @@ static struct kvm_mmu_page *kvm_mmu_get_page(struct kvm_vcpu *vcpu,
return sp;
sp->gfn = gfn;
sp->role = role;
+ init_shadow_page_table(sp);
hlist_add_head(&sp->hash_link,
&vcpu->kvm->arch.mmu_page_hash[kvm_page_table_hashfn(gfn)]);
if (!direct) {
@@ -1702,7 +1703,6 @@ static struct kvm_mmu_page *kvm_mmu_get_page(struct kvm_vcpu *vcpu,
account_shadowed(vcpu->kvm, gfn);
}
- init_shadow_page_table(sp);
trace_kvm_mmu_get_page(sp, true);
return sp;
}
--
1.7.5.4
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists