aboutsummaryrefslogtreecommitdiffstats
path: root/arch/powerpc/kvm/book3s.c
diff options
context:
space:
mode:
authorAlexander Graf <agraf@suse.de>2010-08-02 05:06:26 -0400
committerAvi Kivity <avi@redhat.com>2010-10-24 04:52:00 -0400
commitbed1ed9860d3744cc6488831fa5672d5c7aff4be (patch)
tree72aa499b692d2c1e136dfcac03f6028c697e4946 /arch/powerpc/kvm/book3s.c
parent55438cc751c32cfafac52938403a86069e25b1bf (diff)
KVM: PPC: Move EXIT_DEBUG partially to tracepoints
We have a debug printk on every exit that is usually #ifdef'ed out. Using tracepoints makes a lot more sense here though, as they can be dynamically enabled. This patch converts the most commonly used debug printks of EXIT_DEBUG to tracepoints. Signed-off-by: Alexander Graf <agraf@suse.de>
Diffstat (limited to 'arch/powerpc/kvm/book3s.c')
-rw-r--r--arch/powerpc/kvm/book3s.c26
1 files changed, 4 insertions, 22 deletions
diff --git a/arch/powerpc/kvm/book3s.c b/arch/powerpc/kvm/book3s.c
index 7656b6df0d8..37db61d3704 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
41static int kvmppc_handle_ext(struct kvm_vcpu *vcpu, unsigned int exit_nr, 41static 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)
109static 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
116static void kvmppc_recalc_shadow_msr(struct kvm_vcpu *vcpu) 108static 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}