aboutsummaryrefslogtreecommitdiffstats
path: root/arch
diff options
context:
space:
mode:
authorScott Wood <scottwood@freescale.com>2013-02-13 14:37:49 -0500
committerAlexander Graf <agraf@suse.de>2013-04-11 09:53:38 -0400
commit66a5fecdccd4f32a22d2d110cf4f002755b520d8 (patch)
tree41db4b099f1d7a90e2301f8526a24aaa5db0ece1 /arch
parent6b2ba1a9129bd98b5268a4efb167c95189b3eabf (diff)
kvm/ppc/e500: g2h_tlb1_map: clear old bit before setting new bit
It's possible that we're using the same host TLB1 slot to map (a presumably different portion of) the same guest TLB1 entry. Clear the bit in the map before setting it, so that if the esels are the same the bit will remain set. Signed-off-by: Scott Wood <scottwood@freescale.com> Signed-off-by: Alexander Graf <agraf@suse.de>
Diffstat (limited to 'arch')
-rw-r--r--arch/powerpc/kvm/e500_mmu_host.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/arch/powerpc/kvm/e500_mmu_host.c b/arch/powerpc/kvm/e500_mmu_host.c
index 35fb80ec1f57..8e72b2124f63 100644
--- a/arch/powerpc/kvm/e500_mmu_host.c
+++ b/arch/powerpc/kvm/e500_mmu_host.c
@@ -507,13 +507,14 @@ static int kvmppc_e500_tlb1_map_tlb1(struct kvmppc_vcpu_e500 *vcpu_e500,
507 if (unlikely(vcpu_e500->host_tlb1_nv >= tlb1_max_shadow_size())) 507 if (unlikely(vcpu_e500->host_tlb1_nv >= tlb1_max_shadow_size()))
508 vcpu_e500->host_tlb1_nv = 0; 508 vcpu_e500->host_tlb1_nv = 0;
509 509
510 vcpu_e500->tlb_refs[1][sesel] = *ref;
511 vcpu_e500->g2h_tlb1_map[esel] |= (u64)1 << sesel;
512 vcpu_e500->gtlb_priv[1][esel].ref.flags |= E500_TLB_BITMAP;
513 if (vcpu_e500->h2g_tlb1_rmap[sesel]) { 510 if (vcpu_e500->h2g_tlb1_rmap[sesel]) {
514 unsigned int idx = vcpu_e500->h2g_tlb1_rmap[sesel] - 1; 511 unsigned int idx = vcpu_e500->h2g_tlb1_rmap[sesel] - 1;
515 vcpu_e500->g2h_tlb1_map[idx] &= ~(1ULL << sesel); 512 vcpu_e500->g2h_tlb1_map[idx] &= ~(1ULL << sesel);
516 } 513 }
514
515 vcpu_e500->tlb_refs[1][sesel] = *ref;
516 vcpu_e500->gtlb_priv[1][esel].ref.flags |= E500_TLB_BITMAP;
517 vcpu_e500->g2h_tlb1_map[esel] |= (u64)1 << sesel;
517 vcpu_e500->h2g_tlb1_rmap[sesel] = esel + 1; 518 vcpu_e500->h2g_tlb1_rmap[sesel] = esel + 1;
518 519
519 return sesel; 520 return sesel;