diff options
author | Luwei Kang <luwei.kang@intel.com> | 2019-02-18 19:26:07 -0500 |
---|---|---|
committer | Paolo Bonzini <pbonzini@redhat.com> | 2019-04-30 15:32:13 -0400 |
commit | 8479e04e7d6b1974629a0f657afa8ec5f17d2e90 (patch) | |
tree | caee8e2fdcb18200174dcc7a548055e6c058fba9 /arch/x86/kvm | |
parent | 3a1e5e4a2c7a1ec63e6d70a7e921f62bcbb57b85 (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/kvm')
-rw-r--r-- | arch/x86/kvm/x86.c | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/arch/x86/kvm/x86.c b/arch/x86/kvm/x86.c index 6c27d224f744..cedd396e3003 100644 --- a/arch/x86/kvm/x86.c +++ b/arch/x86/kvm/x86.c | |||
@@ -6839,10 +6839,20 @@ static unsigned long kvm_get_guest_ip(void) | |||
6839 | return ip; | 6839 | return ip; |
6840 | } | 6840 | } |
6841 | 6841 | ||
6842 | static void kvm_handle_intel_pt_intr(void) | ||
6843 | { | ||
6844 | struct kvm_vcpu *vcpu = __this_cpu_read(current_vcpu); | ||
6845 | |||
6846 | kvm_make_request(KVM_REQ_PMI, vcpu); | ||
6847 | __set_bit(MSR_CORE_PERF_GLOBAL_OVF_CTRL_TRACE_TOPA_PMI_BIT, | ||
6848 | (unsigned long *)&vcpu->arch.pmu.global_status); | ||
6849 | } | ||
6850 | |||
6842 | static struct perf_guest_info_callbacks kvm_guest_cbs = { | 6851 | static struct perf_guest_info_callbacks kvm_guest_cbs = { |
6843 | .is_in_guest = kvm_is_in_guest, | 6852 | .is_in_guest = kvm_is_in_guest, |
6844 | .is_user_mode = kvm_is_user_mode, | 6853 | .is_user_mode = kvm_is_user_mode, |
6845 | .get_guest_ip = kvm_get_guest_ip, | 6854 | .get_guest_ip = kvm_get_guest_ip, |
6855 | .handle_intel_pt_intr = kvm_handle_intel_pt_intr, | ||
6846 | }; | 6856 | }; |
6847 | 6857 | ||
6848 | static void kvm_set_mmio_spte_mask(void) | 6858 | static void kvm_set_mmio_spte_mask(void) |