public inbox for kvm@vger.kernel.org
 help / color / mirror / Atom feed
From: Xiao Guangrong <guangrong.xiao@linux.intel.com>
To: Andres Lagar-Cavilla <andreslc@google.com>
Cc: Wanpeng Li <wanpeng.li@linux.intel.com>,
	kvm@vger.kernel.org, linux-kernel@vger.kernel.org,
	Paolo Bonzini <pbonzini@redhat.com>,
	Eric Northup <digitaleric@google.com>
Subject: [PATCH] KVM: MMU: fix comment in kvm_mmu_zap_collapsible_spte
Date: Tue, 14 Apr 2015 12:04:10 +0800	[thread overview]
Message-ID: <552C91BA.1010703@linux.intel.com> (raw)
In-Reply-To: <CAJu=L5_=TSJxsJbcHC=uhmGY2wo+CAjBSPSoxZC0YoOQ=9UvXQ@mail.gmail.com>

Soft mmu uses direct shadow page to fill guest large mapping with small pages
if huge mamping is disallowed on host. So zapping direct shadow page works well
both for soft mmu and hard mmu

Fix the comment to reflect this truth

Signed-off-by: Xiao Guangrong <guangrong.xiao@linux.intel.com>
---
  arch/x86/kvm/mmu.c | 8 +++++---
  1 file changed, 5 insertions(+), 3 deletions(-)

diff --git a/arch/x86/kvm/mmu.c b/arch/x86/kvm/mmu.c
index 146f295..68c5487 100644
--- a/arch/x86/kvm/mmu.c
+++ b/arch/x86/kvm/mmu.c
@@ -4481,9 +4481,11 @@ static bool kvm_mmu_zap_collapsible_spte(struct kvm *kvm,
  		pfn = spte_to_pfn(*sptep);

  		/*
-		 * Only EPT supported for now; otherwise, one would need to
-		 * find out efficiently whether the guest page tables are
-		 * also using huge pages.
+		 * We can not do huge page mapping for the indirect shadow
+		 * page (sp) found on the last rmap (level = 1 ) since
+		 * indirect sp is synced with the page table in guest and
+		 * indirect sp->level = 1 means the guest page table is
+		 * using 4K page size mapping.
  		 */
  		if (sp->role.direct &&
  			!kvm_is_reserved_pfn(pfn) &&
-- 
2.1.0



  reply	other threads:[~2015-04-14  4:06 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-04-03  7:40 [PATCH v3] kvm: mmu: lazy collapse small sptes into large sptes Wanpeng Li
2015-04-07 15:41 ` Paolo Bonzini
2015-04-10 18:05 ` Andres Lagar-Cavilla
2015-04-13  1:45   ` Xiao Guangrong
2015-04-13  5:59     ` Wanpeng Li
2015-04-13  6:31     ` Andres Lagar-Cavilla
2015-04-14  4:04       ` Xiao Guangrong [this message]
2015-04-15 15:05         ` [PATCH] KVM: MMU: fix comment in kvm_mmu_zap_collapsible_spte Paolo Bonzini
2015-04-16  0:38           ` Xiao Guangrong
2015-04-16  8:14           ` Wanpeng Li
2015-04-14  5:25   ` [PATCH v3] kvm: mmu: lazy collapse small sptes into large sptes Wanpeng Li
2015-04-14  6:06     ` Andres Lagar-Cavilla
2015-04-14  6:38       ` Wanpeng Li

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=552C91BA.1010703@linux.intel.com \
    --to=guangrong.xiao@linux.intel.com \
    --cc=andreslc@google.com \
    --cc=digitaleric@google.com \
    --cc=kvm@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=pbonzini@redhat.com \
    --cc=wanpeng.li@linux.intel.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