Thread (30 messages) 30 messages, 3 authors, 2016-02-24
STALE3755d

[PATCH v12 07/21] KVM: ARM64: PMU: Add perf event map and introduce perf event creating function

From: Marc Zyngier <hidden>
Date: 2016-02-23 17:42:42
Also in: kvm, kvmarm

Hi Shannon,

Still picking up on details...

On 22/02/16 09:37, Shannon Zhao wrote:
quoted hunk ↗ jump to hunk
From: Shannon Zhao <redacted>

When we use tools like perf on host, perf passes the event type and the
id of this event type category to kernel, then kernel will map them to
hardware event number and write this number to PMU PMEVTYPER<n>_EL0
register. When getting the event number in KVM, directly use raw event
type to create a perf_event for it.

Signed-off-by: Shannon Zhao <redacted>
Reviewed-by: Marc Zyngier <redacted>
---
 arch/arm64/include/asm/perf_event.h |   2 +
 arch/arm64/kvm/Makefile             |   1 +
 include/kvm/arm_pmu.h               |  12 ++++
 virt/kvm/arm/pmu.c                  | 122 ++++++++++++++++++++++++++++++++++++
 4 files changed, 137 insertions(+)
 create mode 100644 virt/kvm/arm/pmu.c
diff --git a/arch/arm64/include/asm/perf_event.h b/arch/arm64/include/asm/perf_event.h
index 5c77ef8..867140d 100644
--- a/arch/arm64/include/asm/perf_event.h
+++ b/arch/arm64/include/asm/perf_event.h
@@ -29,6 +29,8 @@
 #define ARMV8_PMU_PMCR_D	(1 << 3) /* CCNT counts every 64th cpu cycle */
 #define ARMV8_PMU_PMCR_X	(1 << 4) /* Export to ETM */
 #define ARMV8_PMU_PMCR_DP	(1 << 5) /* Disable CCNT if non-invasive debug*/
+/* Determines which bit of PMCCNTR_EL0 generates an overflow */
+#define ARMV8_PMU_PMCR_LC	(1 << 6)
nit: this #define is only being used in patch #14. Consider moving it
there...

Thanks,

	M.
-- 
Jazz is not dead. It just smells funny...
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help