aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJerone Young <jyoung5@us.ibm.com>2008-07-14 08:00:03 -0400
committerAvi Kivity <avi@qumranet.com>2008-10-15 04:15:15 -0400
commit31711f2294b38d8334efaf7dbac6da4781fd151e (patch)
tree0e60487f9c79113f1f0c9cbc094d9a167d5c3f46
parent12f67556023389a6be929a56617142a8e8ab20fe (diff)
KVM: ppc: adds trace points for ppc tlb activity
This patch adds trace points to track powerpc TLB activities using the KVM_TRACE infrastructure. Signed-off-by: Jerone Young <jyoung5@us.ibm.com> Signed-off-by: Christian Ehrhardt <ehrhardt@linux.vnet.ibm.com> Signed-off-by: Avi Kivity <avi@qumranet.com>
-rw-r--r--arch/powerpc/kvm/44x_tlb.c15
-rw-r--r--arch/powerpc/kvm/emulate.c4
-rw-r--r--include/linux/kvm.h3
3 files changed, 21 insertions, 1 deletions
diff --git a/arch/powerpc/kvm/44x_tlb.c b/arch/powerpc/kvm/44x_tlb.c
index 5a5602da5091..a207d16b9dbb 100644
--- a/arch/powerpc/kvm/44x_tlb.c
+++ b/arch/powerpc/kvm/44x_tlb.c
@@ -19,6 +19,7 @@
19 19
20#include <linux/types.h> 20#include <linux/types.h>
21#include <linux/string.h> 21#include <linux/string.h>
22#include <linux/kvm.h>
22#include <linux/kvm_host.h> 23#include <linux/kvm_host.h>
23#include <linux/highmem.h> 24#include <linux/highmem.h>
24#include <asm/mmu-44x.h> 25#include <asm/mmu-44x.h>
@@ -175,6 +176,10 @@ void kvmppc_mmu_map(struct kvm_vcpu *vcpu, u64 gvaddr, gfn_t gfn, u64 asid,
175 stlbe->word1 = (hpaddr & 0xfffffc00) | ((hpaddr >> 32) & 0xf); 176 stlbe->word1 = (hpaddr & 0xfffffc00) | ((hpaddr >> 32) & 0xf);
176 stlbe->word2 = kvmppc_44x_tlb_shadow_attrib(flags, 177 stlbe->word2 = kvmppc_44x_tlb_shadow_attrib(flags,
177 vcpu->arch.msr & MSR_PR); 178 vcpu->arch.msr & MSR_PR);
179
180 KVMTRACE_5D(STLB_WRITE, vcpu, victim,
181 stlbe->tid, stlbe->word0, stlbe->word1, stlbe->word2,
182 handler);
178} 183}
179 184
180void kvmppc_mmu_invalidate(struct kvm_vcpu *vcpu, gva_t eaddr, 185void kvmppc_mmu_invalidate(struct kvm_vcpu *vcpu, gva_t eaddr,
@@ -204,6 +209,9 @@ void kvmppc_mmu_invalidate(struct kvm_vcpu *vcpu, gva_t eaddr,
204 209
205 kvmppc_44x_shadow_release(vcpu, i); 210 kvmppc_44x_shadow_release(vcpu, i);
206 stlbe->word0 = 0; 211 stlbe->word0 = 0;
212 KVMTRACE_5D(STLB_INVAL, vcpu, i,
213 stlbe->tid, stlbe->word0, stlbe->word1,
214 stlbe->word2, handler);
207 } 215 }
208 up_write(&current->mm->mmap_sem); 216 up_write(&current->mm->mmap_sem);
209} 217}
@@ -217,8 +225,13 @@ void kvmppc_mmu_priv_switch(struct kvm_vcpu *vcpu, int usermode)
217 /* XXX Replace loop with fancy data structures. */ 225 /* XXX Replace loop with fancy data structures. */
218 down_write(&current->mm->mmap_sem); 226 down_write(&current->mm->mmap_sem);
219 for (i = 0; i <= tlb_44x_hwater; i++) { 227 for (i = 0; i <= tlb_44x_hwater; i++) {
228 struct tlbe *stlbe = &vcpu->arch.shadow_tlb[i];
229
220 kvmppc_44x_shadow_release(vcpu, i); 230 kvmppc_44x_shadow_release(vcpu, i);
221 vcpu->arch.shadow_tlb[i].word0 = 0; 231 stlbe->word0 = 0;
232 KVMTRACE_5D(STLB_INVAL, vcpu, i,
233 stlbe->tid, stlbe->word0, stlbe->word1,
234 stlbe->word2, handler);
222 } 235 }
223 up_write(&current->mm->mmap_sem); 236 up_write(&current->mm->mmap_sem);
224} 237}
diff --git a/arch/powerpc/kvm/emulate.c b/arch/powerpc/kvm/emulate.c
index 8c605d0a5488..4a3e274bac12 100644
--- a/arch/powerpc/kvm/emulate.c
+++ b/arch/powerpc/kvm/emulate.c
@@ -170,6 +170,10 @@ static int kvmppc_emul_tlbwe(struct kvm_vcpu *vcpu, u32 inst)
170 kvmppc_mmu_map(vcpu, eaddr, raddr >> PAGE_SHIFT, asid, flags); 170 kvmppc_mmu_map(vcpu, eaddr, raddr >> PAGE_SHIFT, asid, flags);
171 } 171 }
172 172
173 KVMTRACE_5D(GTLB_WRITE, vcpu, index,
174 tlbe->tid, tlbe->word0, tlbe->word1, tlbe->word2,
175 handler);
176
173 return EMULATE_DONE; 177 return EMULATE_DONE;
174} 178}
175 179
diff --git a/include/linux/kvm.h b/include/linux/kvm.h
index 5d08f11bb27f..e21a5050d4d6 100644
--- a/include/linux/kvm.h
+++ b/include/linux/kvm.h
@@ -471,5 +471,8 @@ struct kvm_trace_rec {
471#define KVM_TRC_LMSW (KVM_TRC_HANDLER + 0x13) 471#define KVM_TRC_LMSW (KVM_TRC_HANDLER + 0x13)
472#define KVM_TRC_APIC_ACCESS (KVM_TRC_HANDLER + 0x14) 472#define KVM_TRC_APIC_ACCESS (KVM_TRC_HANDLER + 0x14)
473#define KVM_TRC_TDP_FAULT (KVM_TRC_HANDLER + 0x15) 473#define KVM_TRC_TDP_FAULT (KVM_TRC_HANDLER + 0x15)
474#define KVM_TRC_GTLB_WRITE (KVM_TRC_HANDLER + 0x16)
475#define KVM_TRC_STLB_WRITE (KVM_TRC_HANDLER + 0x17)
476#define KVM_TRC_STLB_INVAL (KVM_TRC_HANDLER + 0x18)
474 477
475#endif 478#endif