Merge tag 'perf_core_for_v5.17_rc1' of git://git.kernel.org/pub/scm/linux/kernel...
authorLinus Torvalds <torvalds@linux-foundation.org>
Thu, 13 Jan 2022 00:26:58 +0000 (16:26 -0800)
committerLinus Torvalds <torvalds@linux-foundation.org>
Thu, 13 Jan 2022 00:26:58 +0000 (16:26 -0800)
Pull perf updates from Borislav Petkov:
 "Cleanup of the perf/kvm interaction."

* tag 'perf_core_for_v5.17_rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
  perf: Drop guest callback (un)register stubs
  KVM: arm64: Drop perf.c and fold its tiny bits of code into arm.c
  KVM: arm64: Hide kvm_arm_pmu_available behind CONFIG_HW_PERF_EVENTS=y
  KVM: arm64: Convert to the generic perf callbacks
  KVM: x86: Move Intel Processor Trace interrupt handler to vmx.c
  KVM: Move x86's perf guest info callbacks to generic KVM
  KVM: x86: More precisely identify NMI from guest when handling PMI
  KVM: x86: Drop current_vcpu for kvm_running_vcpu + kvm_arch_vcpu variable
  perf/core: Use static_call to optimize perf_guest_info_callbacks
  perf: Force architectures to opt-in to guest callbacks
  perf: Add wrappers for invoking guest callbacks
  perf/core: Rework guest callbacks to prepare for static_call support
  perf: Drop dead and useless guest "support" from arm, csky, nds32 and riscv
  perf: Stop pretending that perf can handle multiple guest callbacks
  KVM: x86: Register Processor Trace interrupt hook iff PT enabled in guest
  KVM: x86: Register perf callbacks after calling vendor's hardware_setup()
  perf: Protect perf_guest_cbs with RCU

14 files changed:
1  2 
arch/arm64/kernel/perf_callchain.c
arch/arm64/kvm/arm.c
arch/x86/events/core.c
arch/x86/events/intel/core.c
arch/x86/include/asm/kvm_host.h
arch/x86/kvm/svm/svm.c
arch/x86/kvm/vmx/vmx.c
arch/x86/kvm/x86.c
arch/x86/kvm/x86.h
include/linux/kvm_host.h
include/linux/perf_event.h
init/Kconfig
kernel/events/core.c
virt/kvm/kvm_main.c

@@@ -141,7 -147,9 +141,7 @@@ static bool callchain_trace(void *data
  void perf_callchain_kernel(struct perf_callchain_entry_ctx *entry,
                           struct pt_regs *regs)
  {
-       if (perf_guest_cbs && perf_guest_cbs->is_in_guest()) {
 -      struct stackframe frame;
 -
+       if (perf_guest_state()) {
                /* We don't support guest os callchain now */
                return;
        }
@@@ -503,6 -496,11 +503,13 @@@ bool kvm_arch_vcpu_in_kernel(struct kvm
        return vcpu_mode_priv(vcpu);
  }
  
++#ifdef CONFIG_GUEST_PERF_EVENTS
+ unsigned long kvm_arch_vcpu_get_ip(struct kvm_vcpu *vcpu)
+ {
+       return *vcpu_pc(vcpu);
+ }
++#endif
  /* Just ensure a guest exit from a particular CPU */
  static void exit_vm_noop(void *info)
  {
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
diff --cc init/Kconfig
Simple merge
Simple merge
Simple merge