mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Zhao Jin <cronozhj@gmail.com>
To: avi@redhat.com, mtosatti@redhat.com
Cc: linux-kernel@vger.kernel.org, kvm@vger.kernel.org
Subject: [PATCH] KVM: MMU: fix the condition of syncing a new shadow page
Date: Mon, 24 Oct 2011 15:21:19 +0800	[thread overview]
Message-ID: <1319440880-2610-2-git-send-email-cronozhj@gmail.com> (raw)
In-Reply-To: <1319440880-2610-1-git-send-email-cronozhj@gmail.com>

Should be "or" since a new shadow page is synced if either it is
not leaf or there already exists another unsync shadow page with 
the same gfn.

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 d7e1694..f36de41 100644
--- a/arch/x86/kvm/mmu.c
+++ b/arch/x86/kvm/mmu.c
@@ -1698,7 +1698,7 @@ static struct kvm_mmu_page *kvm_mmu_get_page(struct kvm_vcpu *vcpu,
 	if (!direct) {
 		if (rmap_write_protect(vcpu->kvm, gfn))
 			kvm_flush_remote_tlbs(vcpu->kvm);
-		if (level > PT_PAGE_TABLE_LEVEL && need_sync)
+		if (level > PT_PAGE_TABLE_LEVEL || need_sync)
 			kvm_sync_pages(vcpu, gfn);
 
 		account_shadowed(vcpu->kvm, gfn);
-- 
1.7.5.4


  reply	other threads:[~2011-10-24  7:22 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-10-24  7:21 [PATCH] KVM: MMU: initialize sptes early Zhao Jin
2011-10-24  7:21 ` Zhao Jin [this message]
2011-10-24  7:46   ` [PATCH] KVM: MMU: fix the condition of syncing a new shadow page 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

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1319440880-2610-2-git-send-email-cronozhj@gmail.com \
    --to=cronozhj@gmail.com \
    --cc=avi@redhat.com \
    --cc=kvm@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mtosatti@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

Powered by JetHome