aboutsummaryrefslogtreecommitdiffstats
path: root/arch/powerpc/kvm/e500_tlb.h
diff options
context:
space:
mode:
authorScott Wood <scottwood@freescale.com>2011-08-18 16:25:18 -0400
committerAvi Kivity <avi@redhat.com>2012-03-05 07:52:23 -0500
commit0164c0f0c404017fb04defb0ceb23fd1c3c3a53e (patch)
treec161e2268a1dfd367701e6208f52461f8e9b1022 /arch/powerpc/kvm/e500_tlb.h
parent90b92a6f51af9adf8c44e8ab3f435b336e5ba6ff (diff)
KVM: PPC: e500: clear up confusion between host and guest entries
Split out the portions of tlbe_priv that should be associated with host entries into tlbe_ref. Base victim selection on the number of hardware entries, not guest entries. For TLB1, where one guest entry can be mapped by multiple host entries, we use the host tlbe_ref for tracking page references. For the guest TLB0 entries, we still track it with gtlb_priv, to avoid having to retranslate if the entry is evicted from the host TLB but not the guest TLB. Signed-off-by: Scott Wood <scottwood@freescale.com> Signed-off-by: Alexander Graf <agraf@suse.de> Signed-off-by: Avi Kivity <avi@redhat.com>
Diffstat (limited to 'arch/powerpc/kvm/e500_tlb.h')
-rw-r--r--arch/powerpc/kvm/e500_tlb.h17
1 files changed, 0 insertions, 17 deletions
diff --git a/arch/powerpc/kvm/e500_tlb.h b/arch/powerpc/kvm/e500_tlb.h
index 59b88e99a23..b587f691459 100644
--- a/arch/powerpc/kvm/e500_tlb.h
+++ b/arch/powerpc/kvm/e500_tlb.h
@@ -155,23 +155,6 @@ static inline unsigned int get_tlb_esel_bit(
155 return (vcpu_e500->mas0 >> 16) & 0xfff; 155 return (vcpu_e500->mas0 >> 16) & 0xfff;
156} 156}
157 157
158static inline unsigned int get_tlb_esel(
159 const struct kvmppc_vcpu_e500 *vcpu_e500,
160 int tlbsel)
161{
162 unsigned int esel = get_tlb_esel_bit(vcpu_e500);
163
164 if (tlbsel == 0) {
165 esel &= KVM_E500_TLB0_WAY_NUM_MASK;
166 esel |= ((vcpu_e500->mas2 >> 12) & KVM_E500_TLB0_WAY_SIZE_MASK)
167 << KVM_E500_TLB0_WAY_NUM_BIT;
168 } else {
169 esel &= KVM_E500_TLB1_SIZE - 1;
170 }
171
172 return esel;
173}
174
175static inline int tlbe_is_host_safe(const struct kvm_vcpu *vcpu, 158static inline int tlbe_is_host_safe(const struct kvm_vcpu *vcpu,
176 const struct tlbe *tlbe) 159 const struct tlbe *tlbe)
177{ 160{