linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 00/18] KVM: ARM64: Add guest PMU support
@ 2015-07-06  2:17 shannon.zhao at linaro.org
  2015-07-06  2:17 ` [PATCH 01/18] ARM64: Move PMU register related defines to asm/pmu.h shannon.zhao at linaro.org
                   ` (17 more replies)
  0 siblings, 18 replies; 49+ messages in thread
From: shannon.zhao at linaro.org @ 2015-07-06  2:17 UTC (permalink / raw)
  To: linux-arm-kernel

From: Shannon Zhao <shannon.zhao@linaro.org>

This patchset adds guest PMU support for KVM on ARM64. It takes
trap-and-emulate approach. When guest wants to monitor one event, it
will be trapped by KVM and KVM will call perf_event API to create a perf
event and call relevant perf_event APIs to get the count value of event.

Use perf to test this patchset in guest. When using "perf list", it
shows the list of the hardware events and hardware cache events perf
supports. Then use "perf stat -e EVENT" to monitor some event. For
example, use "perf stat -e cycles" to count cpu cycles and
"perf stat -e cache-misses" to count cache misses.

This can be fetched from [1] and the relevant QEMU version for test can
be fetched from [2].

Thanks,
Shannon

[1] https://git.linaro.org/people/shannon.zhao/linux-mainline.git  KVM_ARM64_PMU_v1
[2] https://git.linaro.org/people/shannon.zhao/qemu.git  PMU

Shannon Zhao (18):
  ARM64: Move PMU register related defines to asm/pmu.h
  KVM: ARM64: Add initial support for PMU
  KVM: ARM64: Add offset defines for PMU registers
  KVM: ARM64: Add reset and access handlers for PMCR_EL0 register
  KVM: ARM64: Add reset and access handlers for PMSELR_EL0 register
  KVM: ARM64: Add reset and access handlers for PMCEID0_EL0 and
    PMCEID1_EL0 register
  KVM: ARM64: PMU: Add perf event map and introduce perf event creating
    function
  KVM: ARM64: Add reset and access handlers for PMXEVTYPER_EL0 register
  KVM: ARM64: Add reset and access handlers for PMXEVCNTR_EL0 register
  KVM: ARM64: Add reset and access handlers for PMCCNTR_EL0 register
  KVM: ARM64: Add reset and access handlers for PMCNTENSET_EL0 and
    PMCNTENCLR_EL0 register
  KVM: ARM64: Add reset and access handlers for PMINTENSET_EL1 and
    PMINTENCLR_EL1 register
  KVM: ARM64: Add reset and access handlers for PMOVSSET_EL0 and
    PMOVSCLR_EL0 register
  KVM: ARM64: Add reset and access handlers for PMUSERENR_EL0 register
  KVM: ARM64: Add reset and access handlers for PMSWINC_EL0 register
  KVM: ARM64: Add access handlers for PMEVCNTRn_EL0 and PMEVTYPERn_EL0
    register
  KVM: ARM64: Add PMU overflow interrupt routing
  KVM: ARM64: Add KVM_CAP_ARM_PMU and KVM_ARM_PMU_SET_IRQ

 arch/arm/kvm/arm.c                |  14 ++
 arch/arm64/include/asm/kvm_asm.h  |  59 ++++-
 arch/arm64/include/asm/kvm_host.h |   2 +
 arch/arm64/include/asm/pmu.h      |  47 ++++
 arch/arm64/kernel/perf_event.c    |  35 ---
 arch/arm64/kvm/Kconfig            |   7 +
 arch/arm64/kvm/Makefile           |   1 +
 arch/arm64/kvm/reset.c            |   3 +
 arch/arm64/kvm/sys_regs.c         | 448 ++++++++++++++++++++++++++++++++++++--
 include/kvm/arm_pmu.h             |  87 ++++++++
 include/uapi/linux/kvm.h          |   4 +
 virt/kvm/arm/pmu.c                | 414 +++++++++++++++++++++++++++++++++++
 12 files changed, 1064 insertions(+), 57 deletions(-)
 create mode 100644 include/kvm/arm_pmu.h
 create mode 100644 virt/kvm/arm/pmu.c

-- 
2.1.0

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

end of thread, other threads:[~2015-08-03 19:55 UTC | newest]

Thread overview: 49+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-07-06  2:17 [PATCH 00/18] KVM: ARM64: Add guest PMU support shannon.zhao at linaro.org
2015-07-06  2:17 ` [PATCH 01/18] ARM64: Move PMU register related defines to asm/pmu.h shannon.zhao at linaro.org
2015-07-08 17:18   ` Will Deacon
2015-07-06  2:17 ` [PATCH 02/18] KVM: ARM64: Add initial support for PMU shannon.zhao at linaro.org
2015-07-16 18:25   ` Christoffer Dall
2015-07-17  8:13     ` Shannon Zhao
2015-07-17  9:58       ` Christoffer Dall
2015-07-17 11:34         ` Shannon Zhao
2015-07-17 12:48           ` Christoffer Dall
2015-07-06  2:17 ` [PATCH 03/18] KVM: ARM64: Add offset defines for PMU registers shannon.zhao at linaro.org
2015-07-16 18:45   ` Christoffer Dall
2015-07-17  8:25     ` Shannon Zhao
2015-07-17 10:17       ` Christoffer Dall
2015-07-17 11:40         ` Shannon Zhao
2015-07-06  2:17 ` [PATCH 04/18] KVM: ARM64: Add reset and access handlers for PMCR_EL0 register shannon.zhao at linaro.org
2015-07-16 19:55   ` Christoffer Dall
2015-07-17  8:45     ` Shannon Zhao
2015-07-17 10:21       ` Christoffer Dall
2015-07-21  1:16         ` Shannon Zhao
2015-08-03 19:39           ` Christoffer Dall
2015-07-06  2:17 ` [PATCH 05/18] KVM: ARM64: Add reset and access handlers for PMSELR_EL0 register shannon.zhao at linaro.org
2015-07-06  2:17 ` [PATCH 06/18] KVM: ARM64: Add reset and access handlers for PMCEID0_EL0 and PMCEID1_EL0 register shannon.zhao at linaro.org
2015-07-17 13:51   ` Christoffer Dall
2015-07-06  2:17 ` [PATCH 07/18] KVM: ARM64: PMU: Add perf event map and introduce perf event creating function shannon.zhao at linaro.org
2015-07-17 14:30   ` Christoffer Dall
2015-07-21  1:35     ` Shannon Zhao
2015-08-03 19:55       ` Christoffer Dall
2015-07-06  2:17 ` [PATCH 08/18] KVM: ARM64: Add reset and access handlers for PMXEVTYPER_EL0 register shannon.zhao at linaro.org
2015-07-06  2:17 ` [PATCH 09/18] KVM: ARM64: Add reset and access handlers for PMXEVCNTR_EL0 register shannon.zhao at linaro.org
2015-07-17 14:41   ` Christoffer Dall
2015-07-06  2:17 ` [PATCH 10/18] KVM: ARM64: Add reset and access handlers for PMCCNTR_EL0 register shannon.zhao at linaro.org
2015-07-17 14:42   ` Christoffer Dall
2015-07-06  2:17 ` [PATCH 11/18] KVM: ARM64: Add reset and access handlers for PMCNTENSET_EL0 and PMCNTENCLR_EL0 register shannon.zhao at linaro.org
2015-07-17 14:52   ` Christoffer Dall
2015-07-06  2:17 ` [PATCH 12/18] KVM: ARM64: Add reset and access handlers for PMINTENSET_EL1 and PMINTENCLR_EL1 register shannon.zhao at linaro.org
2015-07-17 14:56   ` Christoffer Dall
2015-07-06  2:17 ` [PATCH 13/18] KVM: ARM64: Add reset and access handlers for PMOVSSET_EL0 and PMOVSCLR_EL0 register shannon.zhao at linaro.org
2015-07-17 14:59   ` Christoffer Dall
2015-07-17 15:02   ` Christoffer Dall
2015-07-06  2:17 ` [PATCH 14/18] KVM: ARM64: Add reset and access handlers for PMUSERENR_EL0 register shannon.zhao at linaro.org
2015-07-17 15:01   ` Christoffer Dall
2015-07-06  2:17 ` [PATCH 15/18] KVM: ARM64: Add reset and access handlers for PMSWINC_EL0 register shannon.zhao at linaro.org
2015-07-17 15:13   ` Christoffer Dall
2015-07-06  2:17 ` [PATCH 16/18] KVM: ARM64: Add access handlers for PMEVCNTRn_EL0 and PMEVTYPERn_EL0 register shannon.zhao at linaro.org
2015-07-17 15:19   ` Christoffer Dall
2015-07-06  2:17 ` [PATCH 17/18] KVM: ARM64: Add PMU overflow interrupt routing shannon.zhao at linaro.org
2015-07-17 15:28   ` Christoffer Dall
2015-07-06  2:17 ` [PATCH 18/18] KVM: ARM64: Add KVM_CAP_ARM_PMU and KVM_ARM_PMU_SET_IRQ shannon.zhao at linaro.org
2015-07-17 15:32   ` Christoffer Dall

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