1 /* SPDX-License-Identifier: GPL-2.0-only */ 1 2 /* 3 * 4 * Copyright IBM Corp. 2008 5 * 6 * Authors: Christian Ehrhardt <ehrhardt@linux 7 */ 8 9 #ifndef __POWERPC_KVM_EXITTIMING_H__ 10 #define __POWERPC_KVM_EXITTIMING_H__ 11 12 #include <linux/kvm_host.h> 13 14 #ifdef CONFIG_KVM_EXIT_TIMING 15 void kvmppc_init_timing_stats(struct kvm_vcpu 16 void kvmppc_update_timing_stats(struct kvm_vcp 17 int kvmppc_create_vcpu_debugfs_e500(struct kvm 18 struct den 19 20 static inline void kvmppc_set_exit_type(struct 21 { 22 vcpu->arch.last_exit_type = type; 23 } 24 25 #else 26 /* if exit timing is not configured there is n 27 static inline void kvmppc_init_timing_stats(st 28 static inline void kvmppc_update_timing_stats( 29 static inline int kvmppc_create_vcpu_debugfs_e 30 31 { 32 return 0; 33 } 34 static inline void kvmppc_set_exit_type(struct 35 #endif /* CONFIG_KVM_EXIT_TIMING */ 36 37 /* account the exit in kvm_stats */ 38 static inline void kvmppc_account_exit_stat(st 39 { 40 /* type has to be known at build time 41 42 /* The BUILD_BUG_ON below breaks in fu 43 * for now ... -BenH 44 BUILD_BUG_ON(!__builtin_constant_p(typ 45 */ 46 switch (type) { 47 case EXT_INTR_EXITS: 48 vcpu->stat.ext_intr_exits++; 49 break; 50 case DEC_EXITS: 51 vcpu->stat.dec_exits++; 52 break; 53 case EMULATED_INST_EXITS: 54 vcpu->stat.emulated_inst_exits 55 break; 56 case DSI_EXITS: 57 vcpu->stat.dsi_exits++; 58 break; 59 case ISI_EXITS: 60 vcpu->stat.isi_exits++; 61 break; 62 case SYSCALL_EXITS: 63 vcpu->stat.syscall_exits++; 64 break; 65 case DTLB_REAL_MISS_EXITS: 66 vcpu->stat.dtlb_real_miss_exit 67 break; 68 case DTLB_VIRT_MISS_EXITS: 69 vcpu->stat.dtlb_virt_miss_exit 70 break; 71 case MMIO_EXITS: 72 vcpu->stat.mmio_exits++; 73 break; 74 case ITLB_REAL_MISS_EXITS: 75 vcpu->stat.itlb_real_miss_exit 76 break; 77 case ITLB_VIRT_MISS_EXITS: 78 vcpu->stat.itlb_virt_miss_exit 79 break; 80 case SIGNAL_EXITS: 81 vcpu->stat.signal_exits++; 82 break; 83 case DBELL_EXITS: 84 vcpu->stat.dbell_exits++; 85 break; 86 case GDBELL_EXITS: 87 vcpu->stat.gdbell_exits++; 88 break; 89 } 90 } 91 92 /* wrapper to set exit time and account for it 93 static inline void kvmppc_account_exit(struct 94 { 95 kvmppc_set_exit_type(vcpu, type); 96 kvmppc_account_exit_stat(vcpu, type); 97 } 98 99 #endif /* __POWERPC_KVM_EXITTIMING_H__ */ 100
Linux® is a registered trademark of Linus Torvalds in the United States and other countries.
TOMOYO® is a registered trademark of NTT DATA CORPORATION.