linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [RFC PATCH] KVM: arm64: Force a PTE mapping when logging is enabled
@ 2019-03-02  3:35 Zenghui Yu
  2019-03-03 15:14 ` Zenghui Yu
  0 siblings, 1 reply; 8+ messages in thread
From: Zenghui Yu @ 2019-03-02  3:35 UTC (permalink / raw)
  To: christoffer.dall, marc.zyngier
  Cc: james.morse, julien.thierry, suzuki.poulose, wanghaibin.wang,
	kvmarm, linux-arm-kernel, linux-kernel, Zenghui Yu,
	Punit Agrawal

The idea behind this is: we don't want to keep tracking of huge pages when
logging_active is true, which will result in performance degradation.  We
still need to set vma_pagesize to PAGE_SIZE, so that we can make use of it
to force a PTE mapping.

Cc: Suzuki K Poulose <suzuki.poulose@arm.com>
Cc: Punit Agrawal <punit.agrawal@arm.com>
Signed-off-by: Zenghui Yu <yuzenghui@huawei.com>

---
Atfer looking into https://patchwork.codeaurora.org/patch/647985/ , the
"vma_pagesize = PAGE_SIZE" logic was not intended to be deleted. As far
as I can tell, we used to have "hugetlb" to force the PTE mapping, but
we have "vma_pagesize" currently instead. We should set it properly for
performance reasons (e.g, in VM migration). Did I miss something important?

---
 virt/kvm/arm/mmu.c | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/virt/kvm/arm/mmu.c b/virt/kvm/arm/mmu.c
index 30251e2..7d41b16 100644
--- a/virt/kvm/arm/mmu.c
+++ b/virt/kvm/arm/mmu.c
@@ -1705,6 +1705,13 @@ static int user_mem_abort(struct kvm_vcpu *vcpu, phys_addr_t fault_ipa,
 	     (vma_pagesize == PUD_SIZE && kvm_stage2_has_pmd(kvm))) &&
 	    !force_pte) {
 		gfn = (fault_ipa & huge_page_mask(hstate_vma(vma))) >> PAGE_SHIFT;
+	} else {
+		/*
+		 * Fallback to PTE if it's not one of the stage2
+		 * supported hugepage sizes or the corresponding level
+		 * doesn't exist, or logging is enabled.
+		 */
+		vma_pagesize = PAGE_SIZE;
 	}
 	up_read(&current->mm->mmap_sem);
 
-- 
1.8.3.1



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

end of thread, other threads:[~2019-03-05 11:51 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-03-02  3:35 [RFC PATCH] KVM: arm64: Force a PTE mapping when logging is enabled Zenghui Yu
2019-03-03 15:14 ` Zenghui Yu
2019-03-04 17:13   ` Suzuki K Poulose
2019-03-04 17:34     ` Marc Zyngier
2019-03-05 11:09       ` Zenghui Yu
2019-03-05 11:13         ` Suzuki K Poulose
2019-03-05 11:32           ` Zenghui Yu
2019-03-05 11:51         ` Marc Zyngier

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).