mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH v4 0/9] Add support for monitoring guest TLB operations
@ 2017-01-31 17:16 Punit Agrawal
  2017-01-31 17:16 ` [PATCH v4 1/9] arm64/kvm: hyp: tlb: use __tlbi() helper Punit Agrawal
                   ` (8 more replies)
  0 siblings, 9 replies; 10+ messages in thread
From: Punit Agrawal @ 2017-01-31 17:16 UTC (permalink / raw)
  To: kvmarm, linux-arm-kernel
  Cc: Punit Agrawal, linux-kernel, kvm, Christoffer Dall, Marc Zyngier,
	Steven Rostedt, Peter Zijlstra, Will Deacon

Hi,

This series adds support for a software pmu on the host which can be
used to monitor VM operations. For arm and arm64, support is added to
monitor guest TLB operations using the host pmu infrastructure.

This posting addresses all feedback on the previous
version[0]. Instead of requiring a VM pid as part of the event
attribute, it now depends on vcpu thread ids being passed via the
standard perf interface (-t). Thread ids instead of process ids (-p)
is used as -p when called with the thread id ends up resolving to the
parent process.

Prior versions can be found at [1][2][3][4].

As a result of the changes, the user interface has changed as
well. With the patchset, TLB operations can be monitored using -

# perf stat -e kvm/tlb_invalidate/ -t 3967,3968
^C
 Performance counter stats for thread id '3967,3968':

                71      kvm/tlb_invalidate/

      10.207587028 seconds time elapsed

where 3967 and 3968 are the thread ids of the vcpus.

Patches based on v4.10-rc6.

Thanks,
Punit

[0] http://www.mail-archive.com/kvmarm@lists.cs.columbia.edu/msg09357.html
[1] http://www.mail-archive.com/linux-kernel@vger.kernel.org/msg1210715.html
[2] http://www.mail-archive.com/linux-kernel@vger.kernel.org/msg1224353.html
[3] https://marc.info/?l=linux-kernel&m=147376184208258&w=2
[4] https://marc.info/?l=kvm&m=147750373716545&w=2

Changes:
v3 -> v4
* Use vcpupid specified via perf instead of custom VM specifier. This
  results in simplifying the synchronisation requirements for
  callbacks
* Dropped change to track VM pid as it's no longer being used
* Moved host pmu to virt/kvm
* Added copyright headers

v2 -> v3
* Replaced perf trace monitoring with software PMU
* Re-ordered patches as a result of the above re-write

v1 -> v2
* New (Patch 6) - Add support for trapping and emulating TLB
  operations to ARM hosts
* Move common code to handle perf trace notifications to virt/kvm/arm
* Move tracepoint to include/trace/events/kvm.h
* Drop patch to introduce __tlbi helper as it is now merged
* Reorder patches

RFC v2 -> v1
* Dropped the RFC tag
* Patch 2 - Use VM thread group id for identification
* Patch 4 - Update comment for clarity
* Patch 6 - Add comment explaining switch to hype-role when VHE is enabled
* Patch 7 - Add comment to clarify struct kvm_trace_hook

RFC -> RFC v2
* Patch 4 - Rename left-over TLBI macro to __TLBI
* Patch 6 - Replace individual TLB operation emulation with
  invalidating all stage 1 TLB for the VM. TLB monitoring is expected
  to be a debug feature and performance is not critical.

Mark Rutland (1):
  arm64/kvm: hyp: tlb: use __tlbi() helper

Punit Agrawal (8):
  KVM: Add event to trace tlb invalidations
  arm: KVM: Handle trappable TLB instructions
  arm64: KVM: Handle trappable TLB instructions
  kvm: Add host pmu to support VM introspection
  kvm: host_pmu: Add support for tracking guest TLB operations
  arm64: KVM: Enable support for the host pmu
  arm: KVM: Enable support for host pmu
  arm: KVM: Initialise the host pmu

 arch/arm/include/asm/kvm_asm.h    |   2 +
 arch/arm/include/asm/kvm_host.h   |   9 ++
 arch/arm/kvm/Kconfig              |   1 +
 arch/arm/kvm/Makefile             |   1 +
 arch/arm/kvm/arm.c                |   2 +
 arch/arm/kvm/coproc.c             |  56 +++++++++
 arch/arm/kvm/hyp/tlb.c            |  33 +++++
 arch/arm64/include/asm/kvm_asm.h  |   2 +
 arch/arm64/include/asm/kvm_host.h |   9 ++
 arch/arm64/kvm/Kconfig            |   1 +
 arch/arm64/kvm/Makefile           |   1 +
 arch/arm64/kvm/hyp/tlb.c          |  87 +++++++++++++-
 arch/arm64/kvm/sys_regs.c         |  83 +++++++++++++
 include/kvm/host_pmu.h            |  35 ++++++
 include/trace/events/kvm.h        |  18 +++
 virt/kvm/Kconfig                  |   3 +
 virt/kvm/arm/host_pmu_events.c    |  82 +++++++++++++
 virt/kvm/host_pmu.c               | 246 ++++++++++++++++++++++++++++++++++++++
 18 files changed, 665 insertions(+), 6 deletions(-)
 create mode 100644 include/kvm/host_pmu.h
 create mode 100644 virt/kvm/arm/host_pmu_events.c
 create mode 100644 virt/kvm/host_pmu.c

-- 
2.11.0

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

end of thread, other threads:[~2017-01-31 17:30 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-01-31 17:16 [PATCH v4 0/9] Add support for monitoring guest TLB operations Punit Agrawal
2017-01-31 17:16 ` [PATCH v4 1/9] arm64/kvm: hyp: tlb: use __tlbi() helper Punit Agrawal
2017-01-31 17:16 ` [PATCH v4 2/9] KVM: Add event to trace tlb invalidations Punit Agrawal
2017-01-31 17:16 ` [PATCH v4 3/9] arm: KVM: Handle trappable TLB instructions Punit Agrawal
2017-01-31 17:16 ` [PATCH v4 4/9] arm64: " Punit Agrawal
2017-01-31 17:16 ` [PATCH v4 5/9] kvm: Add host pmu to support VM introspection Punit Agrawal
2017-01-31 17:16 ` [PATCH v4 6/9] KVM: arm/arm64: Add support for tracking guest TLB operations Punit Agrawal
2017-01-31 17:16 ` [PATCH v4 7/9] arm64: KVM: Enable support for the host pmu Punit Agrawal
2017-01-31 17:16 ` [PATCH v4 8/9] arm: KVM: Enable support for " Punit Agrawal
2017-01-31 17:16 ` [PATCH v4 9/9] arm/arm64: KVM: Initialise the " Punit Agrawal

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

Powered by JetHome