linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: Yoan Picchi <yoan.picchi@arm.com>
To: maz@kernel.org, james.morse@arm.com,
	julien.thierry.kdev@gmail.com, suzuki.poulose@arm.com,
	linux-arm-kernel@lists.infradead.org,
	kvmarm@lists.cs.columbia.edu
Cc: catalin.marinas@arm.com, will@kernel.org,
	Yoan Picchi <yoan.picchi@arm.com>
Subject: [PATCH 1/7] KVM: arm64: Add two page mapping counters for kvm_stat
Date: Fri, 19 Mar 2021 16:17:05 +0000	[thread overview]
Message-ID: <20210319161711.24972-2-yoan.picchi@arm.com> (raw)
In-Reply-To: <20210319161711.24972-1-yoan.picchi@arm.com>

Add a counter for when a regular page is mapped, and another
for when a huge page is mapped.

Signed-off-by: Yoan Picchi <yoan.picchi@arm.com>
---
 arch/arm64/include/asm/kvm_host.h | 2 ++
 arch/arm64/kvm/guest.c            | 2 ++
 arch/arm64/kvm/mmu.c              | 7 +++++++
 3 files changed, 11 insertions(+)

diff --git a/arch/arm64/include/asm/kvm_host.h b/arch/arm64/include/asm/kvm_host.h
index 3d10e6527..863603285 100644
--- a/arch/arm64/include/asm/kvm_host.h
+++ b/arch/arm64/include/asm/kvm_host.h
@@ -561,6 +561,8 @@ struct kvm_vcpu_stat {
 	u64 wfi_exit_stat;
 	u64 mmio_exit_user;
 	u64 mmio_exit_kernel;
+	u64 regular_page_mapped;
+	u64 huge_page_mapped;
 	u64 exits;
 };
 
diff --git a/arch/arm64/kvm/guest.c b/arch/arm64/kvm/guest.c
index 9bbd30e62..14b15fb8f 100644
--- a/arch/arm64/kvm/guest.c
+++ b/arch/arm64/kvm/guest.c
@@ -38,6 +38,8 @@ struct kvm_stats_debugfs_item debugfs_entries[] = {
 	VCPU_STAT("wfi_exit_stat", wfi_exit_stat),
 	VCPU_STAT("mmio_exit_user", mmio_exit_user),
 	VCPU_STAT("mmio_exit_kernel", mmio_exit_kernel),
+	VCPU_STAT("regular_page_mapped", regular_page_mapped),
+	VCPU_STAT("huge_page_mapped", huge_page_mapped),
 	VCPU_STAT("exits", exits),
 	VCPU_STAT("halt_poll_success_ns", halt_poll_success_ns),
 	VCPU_STAT("halt_poll_fail_ns", halt_poll_fail_ns),
diff --git a/arch/arm64/kvm/mmu.c b/arch/arm64/kvm/mmu.c
index 77cb2d28f..3996b28da 100644
--- a/arch/arm64/kvm/mmu.c
+++ b/arch/arm64/kvm/mmu.c
@@ -914,6 +914,13 @@ static int user_mem_abort(struct kvm_vcpu *vcpu, phys_addr_t fault_ipa,
 		mark_page_dirty(kvm, gfn);
 	}
 
+	if (ret >= 0) {
+		if (vma_pagesize == PAGE_SIZE) {
+			vcpu->stat.regular_page_mapped++;
+		} else {
+			vcpu->stat.huge_page_mapped++;
+		}
+	}
 out_unlock:
 	spin_unlock(&kvm->mmu_lock);
 	kvm_set_pfn_accessed(pfn);
-- 
2.17.1


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

  reply	other threads:[~2021-03-19 16:19 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-03-19 16:17 [PATCH 0/7] KVM: arm64: add more event counters for kvm_stat Yoan Picchi
2021-03-19 16:17 ` Yoan Picchi [this message]
2021-03-23 11:52   ` [PATCH 1/7] KVM: arm64: Add two page mapping " Keqian Zhu
2021-03-23 17:03     ` Marc Zyngier
2021-03-19 16:17 ` [PATCH 2/7] KVM: arm64: Add remote_tlb_flush counter " Yoan Picchi
2021-03-23 17:12   ` Marc Zyngier
2021-03-19 16:17 ` [PATCH 3/7] KVM: arm64: Add cached_page_invalidated " Yoan Picchi
2021-03-23 17:17   ` Marc Zyngier
2021-03-19 16:17 ` [PATCH 4/7] KVM: arm64: Add flush_all_cache_lines " Yoan Picchi
2021-03-23 17:22   ` Marc Zyngier
2021-03-19 16:17 ` [PATCH 5/7] KVM: arm64: Add memory_slot_unmaped " Yoan Picchi
2021-03-23 17:33   ` Marc Zyngier
2021-03-19 16:17 ` [PATCH 6/7] KVM: arm64: Add stage2_unmap_vm " Yoan Picchi
2021-03-23 17:33   ` Marc Zyngier
2021-03-19 16:17 ` [PATCH 7/7] KVM: arm64: Add irq_inject " Yoan Picchi
2021-03-23 17:37   ` Marc Zyngier
2021-03-23 17:53     ` Yoan Picchi
2021-03-23 18:36       ` Marc Zyngier
2021-03-23 18:04 ` [PATCH 0/7] KVM: arm64: add more event counters " Marc Zyngier

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=20210319161711.24972-2-yoan.picchi@arm.com \
    --to=yoan.picchi@arm.com \
    --cc=catalin.marinas@arm.com \
    --cc=james.morse@arm.com \
    --cc=julien.thierry.kdev@gmail.com \
    --cc=kvmarm@lists.cs.columbia.edu \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=maz@kernel.org \
    --cc=suzuki.poulose@arm.com \
    --cc=will@kernel.org \
    /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;
as well as URLs for NNTP newsgroup(s).