summaryrefslogtreecommitdiff
path: root/arch/x86/events/intel
diff options
context:
space:
mode:
authorLuwei Kang <luwei.kang@intel.com>2019-02-18 19:26:07 -0500
committerPaolo Bonzini <pbonzini@redhat.com>2019-04-30 21:32:13 +0200
commit8479e04e7d6b1974629a0f657afa8ec5f17d2e90 (patch)
treecaee8e2fdcb18200174dcc7a548055e6c058fba9 /arch/x86/events/intel
parent3a1e5e4a2c7a1ec63e6d70a7e921f62bcbb57b85 (diff)
KVM: x86: Inject PMI for KVM guest
Inject a PMI for KVM guest when Intel PT working in Host-Guest mode and Guest ToPA entry memory buffer was completely filled. Signed-off-by: Luwei Kang <luwei.kang@intel.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Diffstat (limited to 'arch/x86/events/intel')
-rw-r--r--arch/x86/events/intel/core.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/arch/x86/events/intel/core.c b/arch/x86/events/intel/core.c
index 8baa441d8000..386151b2c62f 100644
--- a/arch/x86/events/intel/core.c
+++ b/arch/x86/events/intel/core.c
@@ -2307,7 +2307,11 @@ static int handle_pmi_common(struct pt_regs *regs, u64 status)
*/
if (__test_and_clear_bit(55, (unsigned long *)&status)) {
handled++;
- intel_pt_interrupt();
+ if (unlikely(perf_guest_cbs && perf_guest_cbs->is_in_guest() &&
+ perf_guest_cbs->handle_intel_pt_intr))
+ perf_guest_cbs->handle_intel_pt_intr();
+ else
+ intel_pt_interrupt();
}
/*