kvm.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] KVM: MMU: initialize sptes early
@ 2011-10-24  7:21 Zhao Jin
  2011-10-24  7:21 ` [PATCH] KVM: MMU: fix the condition of syncing a new shadow page Zhao Jin
                   ` (2 more replies)
  0 siblings, 3 replies; 7+ messages in thread
From: Zhao Jin @ 2011-10-24  7:21 UTC (permalink / raw)
  To: avi, mtosatti; +Cc: linux-kernel, kvm

Otherwise, the following kvm_sync_pages() will see invalid sptes in a new
shadow page.

Signed-off-by: Zhao Jin <cronozhj@gmail.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

^ permalink raw reply related	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2011-10-24  9:04 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-10-24  7:21 [PATCH] KVM: MMU: initialize sptes early Zhao Jin
2011-10-24  7:21 ` [PATCH] KVM: MMU: fix the condition of syncing a new shadow page Zhao Jin
2011-10-24  7:46   ` Xiao Guangrong
2011-10-24  9:04     ` Zhao Jin
2011-10-24  7:21 ` [PATCH] KVM: VMX: fix incorrect operand Zhao Jin
2011-10-24  7:41 ` [PATCH] KVM: MMU: initialize sptes early Xiao Guangrong
2011-10-24  9:01   ` Zhao Jin

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).