diff options
author | Jerone Young <jyoung5@us.ibm.com> | 2008-07-14 08:00:03 -0400 |
---|---|---|
committer | Avi Kivity <avi@qumranet.com> | 2008-10-15 04:15:15 -0400 |
commit | 31711f2294b38d8334efaf7dbac6da4781fd151e (patch) | |
tree | 0e60487f9c79113f1f0c9cbc094d9a167d5c3f46 /arch/powerpc/kvm/44x_tlb.c | |
parent | 12f67556023389a6be929a56617142a8e8ab20fe (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>
Diffstat (limited to 'arch/powerpc/kvm/44x_tlb.c')
-rw-r--r-- | arch/powerpc/kvm/44x_tlb.c | 15 |
1 files changed, 14 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 | ||
180 | void kvmppc_mmu_invalidate(struct kvm_vcpu *vcpu, gva_t eaddr, | 185 | void 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(¤t->mm->mmap_sem); | 216 | up_write(¤t->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(¤t->mm->mmap_sem); | 226 | down_write(¤t->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(¤t->mm->mmap_sem); | 236 | up_write(¤t->mm->mmap_sem); |
224 | } | 237 | } |