aboutsummaryrefslogtreecommitdiffstats
path: root/arch/powerpc/kvm
diff options
context:
space:
mode:
authorAlexander Graf <agraf@suse.de>2013-01-17 20:27:14 -0500
committerAlexander Graf <agraf@suse.de>2013-01-24 13:23:30 -0500
commit523f0e5421c12610527c620b983b443f329e3a32 (patch)
tree097041c9863c7d08aff4aacfddf0e6e2ab3d80a3 /arch/powerpc/kvm
parent9445ef0181ebe0b74c3f2a23191a6f3d9a92b14b (diff)
KVM: PPC: E500: Explicitly mark shadow maps invalid
When we invalidate shadow TLB maps on the host, we don't mark them as not valid. But we should. Fix this by removing the E500_TLB_VALID from their flags when invalidating. Signed-off-by: Alexander Graf <agraf@suse.de>
Diffstat (limited to 'arch/powerpc/kvm')
-rw-r--r--arch/powerpc/kvm/e500_tlb.c13
1 files changed, 10 insertions, 3 deletions
diff --git a/arch/powerpc/kvm/e500_tlb.c b/arch/powerpc/kvm/e500_tlb.c
index d38ad63fdcb9..8efb2acee2bf 100644
--- a/arch/powerpc/kvm/e500_tlb.c
+++ b/arch/powerpc/kvm/e500_tlb.c
@@ -204,9 +204,13 @@ static void inval_gtlbe_on_host(struct kvmppc_vcpu_e500 *vcpu_e500,
204{ 204{
205 struct kvm_book3e_206_tlb_entry *gtlbe = 205 struct kvm_book3e_206_tlb_entry *gtlbe =
206 get_entry(vcpu_e500, tlbsel, esel); 206 get_entry(vcpu_e500, tlbsel, esel);
207 struct tlbe_ref *ref = &vcpu_e500->gtlb_priv[tlbsel][esel].ref;
207 208
208 if (tlbsel == 1 && 209 /* Don't bother with unmapped entries */
209 vcpu_e500->gtlb_priv[1][esel].ref.flags & E500_TLB_BITMAP) { 210 if (!(ref->flags & E500_TLB_VALID))
211 return;
212
213 if (tlbsel == 1 && ref->flags & E500_TLB_BITMAP) {
210 u64 tmp = vcpu_e500->g2h_tlb1_map[esel]; 214 u64 tmp = vcpu_e500->g2h_tlb1_map[esel];
211 int hw_tlb_indx; 215 int hw_tlb_indx;
212 unsigned long flags; 216 unsigned long flags;
@@ -224,7 +228,7 @@ static void inval_gtlbe_on_host(struct kvmppc_vcpu_e500 *vcpu_e500,
224 } 228 }
225 mb(); 229 mb();
226 vcpu_e500->g2h_tlb1_map[esel] = 0; 230 vcpu_e500->g2h_tlb1_map[esel] = 0;
227 vcpu_e500->gtlb_priv[1][esel].ref.flags &= ~E500_TLB_BITMAP; 231 ref->flags &= ~(E500_TLB_BITMAP | E500_TLB_VALID);
228 local_irq_restore(flags); 232 local_irq_restore(flags);
229 233
230 return; 234 return;
@@ -232,6 +236,9 @@ static void inval_gtlbe_on_host(struct kvmppc_vcpu_e500 *vcpu_e500,
232 236
233 /* Guest tlbe is backed by at most one host tlbe per shadow pid. */ 237 /* Guest tlbe is backed by at most one host tlbe per shadow pid. */
234 kvmppc_e500_tlbil_one(vcpu_e500, gtlbe); 238 kvmppc_e500_tlbil_one(vcpu_e500, gtlbe);
239
240 /* Mark the TLB as not backed by the host anymore */
241 ref->flags &= ~E500_TLB_VALID;
235} 242}
236 243
237static int tlb0_set_base(gva_t addr, int sets, int ways) 244static int tlb0_set_base(gva_t addr, int sets, int ways)