perf & kvm: Enhance perf to collect KVM guest os statistics from host side
PATCH v5 2/3 perf & kvm: Enhance perf to collect KVM guest os statistics from host side
Below patch implements the perf_guest_info_callbacks on kvm.
Signed-off-by Zhang Yanmin <[email protected]>
---
arch/x86/kvm/vmx.c +4 -1
@@ -3654,8 +3654,11 @@ static void vmx_complete_interrupts(stru/* We need to handle NMIs before interrupts are enabled */ if ((exit_intr_info &INTR_INFO_INTR_TYPE_MASK ) ==INTR_TYPE_NMI_INTR && - (exit_intr_info &INTR_INFO_VALID_MASK )) + (exit_intr_info &INTR_INFO_VALID_MASK )) { +kvm_before_handle_nmi (&vmx->vcpu); asm("int $2" ); +kvm_after_handle_nmi (&vmx->vcpu); + } idtv_info_valid = idt_vectoring_info &VECTORING_INFO_VALID_MASK ;
arch/x86/kvm/x86.c +46 -0
70 lines not on this page · raw message
arch/x86/kvm/x86.h +3 -0
@@ -65,4 +65,7 @@ static inline int is_paging(struct kvm_v return kvm_read_cr0_bits(vcpu, X86_CR0_PG); } +void kvm_before_handle_nmi (struct kvm_vcpu *vcpu); +void kvm_after_handle_nmi (struct kvm_vcpu *vcpu); +#endif