diff options
Diffstat (limited to 'arch/powerpc/kvm/book3s.c')
-rw-r--r-- | arch/powerpc/kvm/book3s.c | 26 |
1 files changed, 4 insertions, 22 deletions
diff --git a/arch/powerpc/kvm/book3s.c b/arch/powerpc/kvm/book3s.c index 7656b6df0d8b..37db61d37041 100644 --- a/arch/powerpc/kvm/book3s.c +++ b/arch/powerpc/kvm/book3s.c | |||
@@ -17,6 +17,7 @@ | |||
17 | #include <linux/kvm_host.h> | 17 | #include <linux/kvm_host.h> |
18 | #include <linux/err.h> | 18 | #include <linux/err.h> |
19 | #include <linux/slab.h> | 19 | #include <linux/slab.h> |
20 | #include "trace.h" | ||
20 | 21 | ||
21 | #include <asm/reg.h> | 22 | #include <asm/reg.h> |
22 | #include <asm/cputable.h> | 23 | #include <asm/cputable.h> |
@@ -35,7 +36,6 @@ | |||
35 | #define VCPU_STAT(x) offsetof(struct kvm_vcpu, stat.x), KVM_STAT_VCPU | 36 | #define VCPU_STAT(x) offsetof(struct kvm_vcpu, stat.x), KVM_STAT_VCPU |
36 | 37 | ||
37 | /* #define EXIT_DEBUG */ | 38 | /* #define EXIT_DEBUG */ |
38 | /* #define EXIT_DEBUG_SIMPLE */ | ||
39 | /* #define DEBUG_EXT */ | 39 | /* #define DEBUG_EXT */ |
40 | 40 | ||
41 | static int kvmppc_handle_ext(struct kvm_vcpu *vcpu, unsigned int exit_nr, | 41 | static int kvmppc_handle_ext(struct kvm_vcpu *vcpu, unsigned int exit_nr, |
@@ -105,14 +105,6 @@ void kvmppc_core_vcpu_put(struct kvm_vcpu *vcpu) | |||
105 | kvmppc_giveup_ext(vcpu, MSR_VSX); | 105 | kvmppc_giveup_ext(vcpu, MSR_VSX); |
106 | } | 106 | } |
107 | 107 | ||
108 | #if defined(EXIT_DEBUG) | ||
109 | static u32 kvmppc_get_dec(struct kvm_vcpu *vcpu) | ||
110 | { | ||
111 | u64 jd = mftb() - vcpu->arch.dec_jiffies; | ||
112 | return vcpu->arch.dec - jd; | ||
113 | } | ||
114 | #endif | ||
115 | |||
116 | static void kvmppc_recalc_shadow_msr(struct kvm_vcpu *vcpu) | 108 | static void kvmppc_recalc_shadow_msr(struct kvm_vcpu *vcpu) |
117 | { | 109 | { |
118 | ulong smsr = vcpu->arch.shared->msr; | 110 | ulong smsr = vcpu->arch.shared->msr; |
@@ -850,16 +842,8 @@ int kvmppc_handle_exit(struct kvm_run *run, struct kvm_vcpu *vcpu, | |||
850 | 842 | ||
851 | run->exit_reason = KVM_EXIT_UNKNOWN; | 843 | run->exit_reason = KVM_EXIT_UNKNOWN; |
852 | run->ready_for_interrupt_injection = 1; | 844 | run->ready_for_interrupt_injection = 1; |
853 | #ifdef EXIT_DEBUG | 845 | |
854 | printk(KERN_EMERG "exit_nr=0x%x | pc=0x%lx | dar=0x%lx | dec=0x%x | msr=0x%lx\n", | 846 | trace_kvm_book3s_exit(exit_nr, vcpu); |
855 | exit_nr, kvmppc_get_pc(vcpu), kvmppc_get_fault_dar(vcpu), | ||
856 | kvmppc_get_dec(vcpu), to_svcpu(vcpu)->shadow_srr1); | ||
857 | #elif defined (EXIT_DEBUG_SIMPLE) | ||
858 | if ((exit_nr != 0x900) && (exit_nr != 0x500)) | ||
859 | printk(KERN_EMERG "exit_nr=0x%x | pc=0x%lx | dar=0x%lx | msr=0x%lx\n", | ||
860 | exit_nr, kvmppc_get_pc(vcpu), kvmppc_get_fault_dar(vcpu), | ||
861 | vcpu->arch.shared->msr); | ||
862 | #endif | ||
863 | kvm_resched(vcpu); | 847 | kvm_resched(vcpu); |
864 | switch (exit_nr) { | 848 | switch (exit_nr) { |
865 | case BOOK3S_INTERRUPT_INST_STORAGE: | 849 | case BOOK3S_INTERRUPT_INST_STORAGE: |
@@ -1091,9 +1075,7 @@ program_interrupt: | |||
1091 | } | 1075 | } |
1092 | } | 1076 | } |
1093 | 1077 | ||
1094 | #ifdef EXIT_DEBUG | 1078 | trace_kvm_book3s_reenter(r, vcpu); |
1095 | printk(KERN_EMERG "KVM exit: vcpu=0x%p pc=0x%lx r=0x%x\n", vcpu, kvmppc_get_pc(vcpu), r); | ||
1096 | #endif | ||
1097 | 1079 | ||
1098 | return r; | 1080 | return r; |
1099 | } | 1081 | } |