KVM: PPC: booke: Add booke206 TLB trace
Subsystems (3)
PATCH v2 1/1 KVM: PPC: booke: Add booke206 TLB trace
From: Liu Yu <[email protected]>
The existing kvm_stlb_write/kvm_gtlb_write were a poor match for the e500/book3e MMU -- mas1 was passed as "tid", mas2 was limited to "unsigned int" which will be a problem on 64-bit, mas3/7 got split up rather than treated as a single 64-bit word, etc.
Signed-off-by Liu Yu <[email protected]>
[[email protected]: made mas2 64-bit, and added mas8 init]
Signed-off-by Scott Wood <[email protected]>
---
v2: expanded commit message
arch/powerpc/kvm/e500_tlb.c | 10 ++++--- arch/powerpc/kvm/trace.h | 57 +++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 63 insertions(+), 4 deletions(-)
arch/powerpc/kvm/e500_tlb.c +6 -4
@@ -294,6 +294,9 @@ static inline void __write_host_tlbe(struct kvm_book3e_206_tlb_entry *stlbe,mtspr (SPRN_MAS7 , (u32)(stlbe->mas7_3 >>32 )); asmvolatile ("isync; tlbwe" : : :"memory" );local_irq_restore (flags); + +trace_kvm_booke206_stlb_write (mas0, stlbe->mas8, stlbe->mas1, + stlbe->mas2, stlbe->mas7_3); }/*
@@ -332,8 +335,6 @@ static inline void write_host_tlbe(struct kvmppc_vcpu_e500 *vcpu_e500,MAS0_TLBSEL (1 ) | MAS0_ESEL(to_htlb1_esel(sesel))); } -trace_kvm_stlb_write (index_of (tlbsel, esel), stlbe->mas1, stlbe->mas2, - (u32 )stlbe->mas7_3, (u32)(stlbe->mas7_3 >>32 )); }void kvmppc_map_magic (struct kvm_vcpu *vcpu)
@@ -355,6 +356,7 @@ void kvmppc_map_magic(struct kvm_vcpu *vcpu) magic.mas2 = vcpu->arch.magic_page_ea |MAS2_M ; magic.mas7_3 = ((u64 )pfn <<PAGE_SHIFT ) |MAS3_SW |MAS3_SR |MAS3_UW |MAS3_UR ; + magic.mas8 =0 ;__write_host_tlbe (&magic,MAS0_TLBSEL (1 ) |MAS0_ESEL (tlbcam_index));preempt_enable ();
@@ -954,8 +956,8 @@ int kvmppc_e500_emul_tlbwe(struct kvm_vcpu *vcpu) gtlbe->mas2 = vcpu->arch.shared->mas2; gtlbe->mas7_3 = vcpu->arch.shared->mas7_3; -trace_kvm_gtlb_write (vcpu->arch.shared->mas0, gtlbe->mas1, gtlbe->mas2, - (u32 )gtlbe->mas7_3, (u32)(gtlbe->mas7_3 >>32 )); +trace_kvm_booke206_gtlb_write (vcpu->arch.shared->mas0, gtlbe->mas1, + gtlbe->mas2, gtlbe->mas7_3);/* Invalidate shadow mappings for the about-to-be-clobbered TLBE. */ if (tlbe_is_host_safe (vcpu, gtlbe)) {
arch/powerpc/kvm/trace.h +57 -0
63 lines not on this page · raw message
Signature · 1 line
1.7.7.rc3.4.g8d714
Alexander Graf
AppliedQuoted 10 lines · Scott Wood
From: Liu Yu <[email protected]>
The existing kvm_stlb_write/kvm_gtlb_write were a poor match for the e500/book3e MMU -- mas1 was passed as "tid", mas2 was limited to "unsigned int" which will be a problem on 64-bit, mas3/7 got split up rather than treated as a single 64-bit word, etc.
Signed-off-by Liu Yu <[email protected]>[[email protected]: made mas2 64-bit, and added mas8 init]Signed-off-by Scott Wood <[email protected]>
Thanks, applied to kvm-ppc-next.
Alex